diff --git a/src/lib/cards/esncard_2026.ts b/src/lib/cards/esncard_2026.ts new file mode 100644 index 0000000..4a9d00a --- /dev/null +++ b/src/lib/cards/esncard_2026.ts @@ -0,0 +1,31 @@ +import type { Card } from './types'; + +// User-configurable settings for PDF generation +export const ESNCard2026: Card = { + name: 'ESNcard 2026', + image: '/cards/2026.webp', + textCard: { + width: 50, // mm + height: 35 // mm + }, + photoCard: { + width: 32, // mm + height: 45 // mm + }, + photo: { + width: 28, // mm + height: 38 // mm + }, + textFields: { + name: { x: 3, y: 5, size: 9 }, + nationality: { x: 3, y: 14, size: 9 }, + birthday: { x: 33, y: 14, size: 9 }, + studiesAt: { x: 3, y: 23, size: 9 }, + esnSection: { x: 3, y: 32, size: 9 }, + validityStart: { x: 33, y: 32, size: 9 } + }, + photoFields: { + photo: { x: 2, y: 2, width: 28, height: 38 }, + name: { x: 2, y: 42, size: 7 } + } +}; diff --git a/src/lib/cards/esncard_anniversary.ts b/src/lib/cards/esncard_anniversary.ts new file mode 100644 index 0000000..771be45 --- /dev/null +++ b/src/lib/cards/esncard_anniversary.ts @@ -0,0 +1,31 @@ +import type { Card } from './types'; + +// User-configurable settings for PDF generation +export const ESNCardAnniversary: Card = { + name: 'ESNcard Anniversary', + image: '/cards/esncard_anniversary.png', + textCard: { + width: 45, // mm + height: 30 // mm + }, + photoCard: { + width: 29, // mm + height: 41 // mm + }, + photo: { + width: 26, // mm + height: 36 // mm + }, + textFields: { + name: { x: 2, y: 4, size: 8 }, + nationality: { x: 2, y: 12, size: 8 }, + birthday: { x: 30, y: 12, size: 8 }, + studiesAt: { x: 2, y: 20, size: 8 }, + esnSection: { x: 2, y: 28, size: 8 }, + validityStart: { x: 30, y: 28, size: 8 } + }, + photoFields: { + photo: { x: 2, y: 2, width: 26, height: 36 }, + name: { x: 2, y: 40, size: 6 } + } +}; diff --git a/src/lib/cards/index.ts b/src/lib/cards/index.ts new file mode 100644 index 0000000..294aca5 --- /dev/null +++ b/src/lib/cards/index.ts @@ -0,0 +1,5 @@ +import { ESNCardAnniversary } from './esncard_anniversary'; +import { ESNCard2026 } from './esncard_2026'; +import type { Card } from './types'; + +export const cardTypes: Card[] = [ESNCardAnniversary, ESNCard2026]; \ No newline at end of file diff --git a/src/lib/cards/types/index.ts b/src/lib/cards/types/index.ts new file mode 100644 index 0000000..5456c68 --- /dev/null +++ b/src/lib/cards/types/index.ts @@ -0,0 +1,46 @@ +export interface CardDimensions { + width: number; // mm + height: number; // mm +} + +export interface PhotoDimensions { + width: number; // mm + height: number; // mm +} + +export interface TextPosition { + x: number; // mm, relative to cell top-left + y: number; // mm, relative to cell top-left + size: number; // font size in points +} + +export interface PhotoPosition { + x: number; // mm, relative to cell top-left + y: number; // mm, relative to cell top-left + width: number; // mm + height: number; // mm +} + +export interface TextFieldLayout { + name: TextPosition; + nationality: TextPosition; + birthday: TextPosition; + studiesAt: TextPosition; + esnSection: TextPosition; + validityStart: TextPosition; +} + +export interface PhotoFieldLayout { + photo: PhotoPosition; + name: TextPosition; +} + +export interface Card { + name: string; + image: string; + textCard: CardDimensions; + photoCard: CardDimensions; + photo: PhotoDimensions; + textFields: TextFieldLayout; + photoFields: PhotoFieldLayout; +} diff --git a/src/lib/components/Wizard.svelte b/src/lib/components/Wizard.svelte index f731c0c..c5cb8b5 100644 --- a/src/lib/components/Wizard.svelte +++ b/src/lib/components/Wizard.svelte @@ -1,59 +1,71 @@
+ Choose the type of card you want to generate. This will determine the layout and dimensions of the final PDFs. +
+