Compare commits
2 Commits
main
...
vertex-app
| Author | SHA1 | Date | |
|---|---|---|---|
| 55a1371d11 | |||
| 0b68b29bd5 |
@ -28,7 +28,7 @@ Projects live entirely in your browser — no Shotluma account or project backen
|
||||
- **Direct manipulation** — typography, gradients, shapes, images, mockups, alignment, stacking, and spacing are all hand-editable, with or without AI.
|
||||
- **Perspective device mockups** — drop a raw screenshot into a device frame with correct 3D geometry.
|
||||
- **Local-first** — projects and uploads are stored in IndexedDB in your browser.
|
||||
- **Store-ready export** — download the whole set as `1290 × 2796` or `1242 × 2688` PNGs in one ZIP.
|
||||
- **Store-ready export** — download the whole set as PNGs in one ZIP, at any accepted App Store Connect iPhone screenshot size from 5.8-inch up to 6.9-inch.
|
||||
|
||||
## Refine one screen with AI
|
||||
|
||||
|
||||
@ -134,12 +134,16 @@ Developer AI run logging is enabled only when `SHOTLUMA_AI_LOGGING=true`. The br
|
||||
|
||||
`src/app/use-slide-export.ts` uses `html-to-image` to rasterize each artboard and JSZip to package the results. Output definitions live in `src/app/export-formats.ts`.
|
||||
|
||||
Supported output sizes are:
|
||||
Supported output sizes are every iPhone display category App Store Connect
|
||||
accepts within the artboard's portrait aspect ratio family (Dynamic Island and
|
||||
Face ID devices):
|
||||
|
||||
| Target | Dimensions |
|
||||
| --- | --- |
|
||||
| 6.9-inch display | `1290 × 2796` |
|
||||
| 6.5-inch display | `1242 × 2688` |
|
||||
| 6.9-inch display | `1320 × 2868` or `1290 × 2796` |
|
||||
| 6.5-inch display | `1284 × 2778` or `1242 × 2688` |
|
||||
| 6.1-inch display | `1179 × 2556` |
|
||||
| 5.8-inch display | `1170 × 2532` |
|
||||
|
||||
The rendered artboard is the source of truth. Editor-only UI, including transform handles, selections, and elements carrying `data-ai-overlay`, must be filtered out of export.
|
||||
|
||||
|
||||
47
src/app/export-formats.test.ts
Normal file
47
src/app/export-formats.test.ts
Normal file
@ -0,0 +1,47 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { EXPORT_FORMATS } from './export-formats'
|
||||
|
||||
// The reference aspect ratio shared by every Dynamic Island / Face ID iPhone
|
||||
// screenshot size (App Store Connect's "9:19.5"-ish display family). Formats
|
||||
// outside this tolerance would reflow the artboard into a visibly different
|
||||
// shape instead of just changing resolution.
|
||||
const REFERENCE_ASPECT_RATIO = 1290 / 2796
|
||||
const ASPECT_RATIO_TOLERANCE = 0.01
|
||||
|
||||
describe('EXPORT_FORMATS', () => {
|
||||
it('has a unique id and filename for every format', () => {
|
||||
const ids = EXPORT_FORMATS.map((format) => format.id)
|
||||
const filenames = EXPORT_FORMATS.map((format) => format.filename)
|
||||
|
||||
expect(new Set(ids).size).toBe(ids.length)
|
||||
expect(new Set(filenames).size).toBe(filenames.length)
|
||||
})
|
||||
|
||||
it('only defines positive integer pixel dimensions', () => {
|
||||
for (const format of EXPORT_FORMATS) {
|
||||
expect(Number.isInteger(format.width)).toBe(true)
|
||||
expect(Number.isInteger(format.height)).toBe(true)
|
||||
expect(format.width).toBeGreaterThan(0)
|
||||
expect(format.height).toBeGreaterThan(0)
|
||||
}
|
||||
})
|
||||
|
||||
it('keeps every format within the portrait aspect ratio family the artboard supports', () => {
|
||||
for (const format of EXPORT_FORMATS) {
|
||||
const ratio = format.width / format.height
|
||||
expect(Math.abs(ratio - REFERENCE_ASPECT_RATIO)).toBeLessThan(ASPECT_RATIO_TOLERANCE)
|
||||
}
|
||||
})
|
||||
|
||||
it('includes the accepted App Store Connect size for iPhone with Dynamic Island (medium display)', () => {
|
||||
const format = EXPORT_FORMATS.find((candidate) => candidate.id === 'iphone-6.1')
|
||||
expect(format?.width).toBe(1179)
|
||||
expect(format?.height).toBe(2556)
|
||||
})
|
||||
|
||||
it('includes the accepted App Store Connect size for iPhone with Face ID (medium display)', () => {
|
||||
const format = EXPORT_FORMATS.find((candidate) => candidate.id === 'iphone-5.8')
|
||||
expect(format?.width).toBe(1170)
|
||||
expect(format?.height).toBe(2532)
|
||||
})
|
||||
})
|
||||
@ -1,6 +1,29 @@
|
||||
export const EXPORT_ARTBOARD_WIDTH = 330
|
||||
|
||||
// Dimensions are accepted App Store Connect screenshot sizes
|
||||
// (https://developer.apple.com/help/app-store-connect/reference/screenshot-specifications),
|
||||
// restricted to the iPhone display categories that share the artboard's
|
||||
// portrait aspect ratio (Dynamic Island and Face ID devices, roughly 9:19.5).
|
||||
// Home Button-era displays (5.5-inch and smaller) use a visibly different
|
||||
// aspect ratio and are out of scope: resizing the artboard to fit them would
|
||||
// noticeably distort element placement rather than just changing resolution.
|
||||
export const EXPORT_FORMATS = [
|
||||
{
|
||||
id: 'iphone-6.9-1320',
|
||||
label: '6.9-inch display (1320 × 2868)',
|
||||
shortLabel: '6.9″ Pro Max',
|
||||
width: 1320,
|
||||
height: 2868,
|
||||
filename: '6.9-inch-1320x2868',
|
||||
},
|
||||
{
|
||||
id: 'iphone-6.5-1284',
|
||||
label: '6.5-inch display (1284 × 2778)',
|
||||
shortLabel: '6.5″ 1284',
|
||||
width: 1284,
|
||||
height: 2778,
|
||||
filename: '6.5-inch-1284x2778',
|
||||
},
|
||||
{
|
||||
id: 'iphone-6.9',
|
||||
label: '6.9-inch display',
|
||||
@ -17,6 +40,22 @@ export const EXPORT_FORMATS = [
|
||||
height: 2688,
|
||||
filename: '6.5-inch',
|
||||
},
|
||||
{
|
||||
id: 'iphone-6.1',
|
||||
label: '6.1-inch display',
|
||||
shortLabel: '6.1″',
|
||||
width: 1179,
|
||||
height: 2556,
|
||||
filename: '6.1-inch',
|
||||
},
|
||||
{
|
||||
id: 'iphone-5.8',
|
||||
label: '5.8-inch display',
|
||||
shortLabel: '5.8″',
|
||||
width: 1170,
|
||||
height: 2532,
|
||||
filename: '5.8-inch',
|
||||
},
|
||||
] as const
|
||||
|
||||
export type ExportFormat = (typeof EXPORT_FORMATS)[number]
|
||||
|
||||
@ -18,6 +18,7 @@ export default defineConfig({
|
||||
'src/ai/provider-catalog.ts',
|
||||
'src/ai/richtext.ts',
|
||||
'src/ai/run-log.ts',
|
||||
'src/app/export-formats.ts',
|
||||
'src/app/export-image-sizing.ts',
|
||||
'src/asset-sources.ts',
|
||||
'src/app/project-utils.ts',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user