diff --git a/.gitattributes b/.gitattributes index 6313b56..b3c7fad 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ * text=auto eol=lf +*.lockb binary diff=lockb diff --git a/bun.lockb b/bun.lockb index 912ad16..f57edc4 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/index.html b/index.html index 9e5fc8f..e13ffc9 100644 --- a/index.html +++ b/index.html @@ -1,10 +1,10 @@ - + - - - - Vite App + + + + Fachschaftsschilder
diff --git a/package.json b/package.json index 3bdf70a..b7a25e4 100644 --- a/package.json +++ b/package.json @@ -5,14 +5,17 @@ "type": "module", "scripts": { "dev": "vite", - "build": "run-p type-check \"build-only {@}\" --", + "build": "run-p type-check check \"build-only {@}\" --", "preview": "vite preview", "build-only": "vite build", "type-check": "vue-tsc --build", + "check": "prettier --check src/", "format": "prettier --write src/" }, "dependencies": { "@tailwindcss/vite": "^4.0.17", + "pinia": "^3.0.1", + "pinia-plugin-persistedstate": "^4.2.0", "tailwindcss": "^4.0.17", "vue": "^3.5.13" }, diff --git a/src/App.vue b/src/App.vue index c5c42fc..7ec50dd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,34 +1,85 @@ diff --git a/src/assets/main.css b/src/assets/main.css index 7bc7bd6..6f24b30 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -1,21 +1,23 @@ -@import "tailwindcss"; +@import 'tailwindcss'; +.card { + width: 9cm; + height: 6.5cm; +} @media print { - .noPrint{ - display:none; + .noPrint { + display: none; + } + + .page { + width: 100%; + grid-column: span 3 / span 3; + height: 100dvh !important; + body { + width: 21cm; + height: 29.7cm; + /* change the margins as you want them to be. */ } - .page { - width:100%; - grid-column: span 3 / span 3; - height: 100dvh !important; - body{ - width: 21cm; - height: 29.7cm; - margin: 30mm 45mm 30mm 45mm; - /* change the margins as you want them to be. */ - } - } - .card { - width: 9cm; - } -} \ No newline at end of file + gap: 0; + } +} diff --git a/src/colors.ts b/src/colors.ts new file mode 100644 index 0000000..2ef0148 --- /dev/null +++ b/src/colors.ts @@ -0,0 +1,32 @@ +export type Preset = Pick +export const presets = { + default: { + bgColor: '#000000', + color: '#ffffff', + textColor: '#ffffff', + nameColor: '#000000', + title: 'Fachschaft 4', + }, + awareness: { + bgColor: '#3e1c59', + color: '#6f309f', + textColor: '#ffffff', + nameColor: '#ffffff', + title: 'Awareness', + }, + // TODO: add new types +} satisfies Record + +export function validPreset(key: string): key is keyof typeof presets { + return key in presets +} + +export type CardT = { + title: string + color: string + bgColor: string + textColor: string + nameColor: string + textSize: number + name: string +} diff --git a/src/components/card.vue b/src/components/card.vue index 198df38..73b9412 100644 --- a/src/components/card.vue +++ b/src/components/card.vue @@ -1,15 +1,38 @@ diff --git a/src/components/logo.vue b/src/components/logo.vue new file mode 100644 index 0000000..b6f92f1 --- /dev/null +++ b/src/components/logo.vue @@ -0,0 +1,541 @@ + + + + + + diff --git a/src/main.ts b/src/main.ts index 0ac3a5f..e2a425e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,5 +2,9 @@ import './assets/main.css' import { createApp } from 'vue' import App from './App.vue' +import { createPinia } from 'pinia' +import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' -createApp(App).mount('#app') +const pinia = createPinia() + +createApp(App).use(pinia.use(piniaPluginPersistedstate)).mount('#app') diff --git a/src/stores/cards.ts b/src/stores/cards.ts new file mode 100644 index 0000000..c544c09 --- /dev/null +++ b/src/stores/cards.ts @@ -0,0 +1,20 @@ +import { defineStore } from 'pinia' +import { ref } from 'vue' +import type { CardT } from '@/colors.ts' +import { presets } from '@/colors.ts' + +export const useCards = defineStore( + 'cards', + () => { + const cards = ref( + new Array(8).fill(0).map((_) => ({ + ...presets.default, + name: 'Name', + textSize: 10, + })), + ) + + return { cards } + }, + { persist: true }, +)