feat(projects): migrate haumdaucherde website into monorepo and document in AGENTS.md

This commit is contained in:
Moritz Graf
2026-10-12 10:42:30 +02:00
parent f225d4fe4e
commit 3b190988be
76 changed files with 16748 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
import { describe, it, expect, vi } from 'vitest'
import { mount } from '@vue/test-utils'
import App from './App.vue'
vi.mock('./firebase', () => ({
auth: {},
db: {}
}))
vi.mock('./composables/useAuth', () => {
const { ref } = require('vue')
return {
useAuth: () => ({
isAllowed: true,
user: ref(null),
login: vi.fn(),
logout: vi.fn(),
error: null
})
}
})
describe('Smoke Test', () => {
it('mounts properly', () => {
const wrapper = mount(App)
expect(wrapper.exists()).toBe(true)
})
it('renders header text', () => {
const wrapper = mount(App)
expect(wrapper.text()).toContain('HAUMDAUCHER')
})
})
+227
View File
@@ -0,0 +1,227 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import Header from './components/layout/Header.vue'
import Hero from './components/sections/Hero.vue'
import ClubSpirit from './components/sections/ClubSpirit.vue'
import Impressum from './components/sections/Legal/Impressum.vue'
import Datenschutz from './components/sections/Legal/Datenschutz.vue'
import HaumdaucherGame from './components/layout/HaumdaucherGame.vue'
import { messages } from './locales/i18n'
import { useAuth } from './composables/useAuth'
import PasswordReset from './components/auth/PasswordReset.vue'
const { isAllowed } = useAuth()
const theme = ref('classic')
const showGame = ref(false)
const isNatUnlocked = ref(false)
const boars = ref<{id: number, top: number}[]>([])
const isPasswordResetMode = ref(false)
const resetOobCode = ref('')
const toggleTheme = (newTheme: string) => {
theme.value = newTheme
document.documentElement.setAttribute('data-theme', newTheme)
localStorage.setItem('haumdaucher-theme', newTheme)
if (newTheme === 'nat') {
startBoarRun()
}
}
const unlockNat = () => {
isNatUnlocked.value = true
localStorage.setItem('haumdaucher-nat-unlocked', 'true')
}
const handleBackdoor = () => {
const secret = prompt('Bitte Geheimcode eingeben (Unlock NAT):')
if (secret?.toLowerCase() === 'nat mode') {
unlockNat()
alert('🐗 NAT-Modus freigschaltet! Wiedaschaun, reinghaun!')
}
}
const startBoarRun = () => {
setInterval(() => {
if (theme.value === 'nat') {
const id = Date.now()
boars.value.push({ id, top: Math.random() * 80 + 10 })
setTimeout(() => {
boars.value = boars.value.filter(b => b.id !== id)
}, 5000)
}
}, 8000)
}
onMounted(() => {
const urlParams = new URLSearchParams(window.location.search)
if (urlParams.get('mode') === 'resetPassword') {
isPasswordResetMode.value = true
resetOobCode.value = urlParams.get('oobCode') || ''
}
const savedTheme = localStorage.getItem('haumdaucher-theme')
if (savedTheme) toggleTheme(savedTheme)
const savedNat = localStorage.getItem('haumdaucher-nat-unlocked')
if (savedNat === 'true') isNatUnlocked.value = true
})
// Simplified translation: German only
const t = (key: string) => {
const keys = key.split('.')
let result: any = messages.de
for (const k of keys) {
if (result[k]) result = result[k]
else return key
}
return result
}
</script>
<template>
<div v-if="isPasswordResetMode">
<PasswordReset
:oobCode="resetOobCode"
:t="t"
@close="isPasswordResetMode = false; window.history.replaceState({}, document.title, window.location.pathname)"
/>
</div>
<div v-else>
<Header
:currentTheme="theme"
:isNatUnlocked="isNatUnlocked"
@update:theme="toggleTheme"
@open:game="showGame = true"
:t="t"
/>
<main>
<Hero :theme="theme" :t="t" />
<ClubSpirit :t="t" id="spirit" />
<div class="legal-separator"></div>
<section id="impressum" class="legal-section">
<Impressum :t="t" />
</section>
<section id="datenschutz" class="legal-section">
<Datenschutz :t="t" />
</section>
<div class="backdoor" @click.stop="handleBackdoor"></div>
</main>
<HaumdaucherGame
v-if="showGame"
:t="t"
:theme="theme"
@close="showGame = false"
@unlock-nat="unlockNat"
/>
<div v-for="boar in boars" :key="boar.id" class="running-boar" :style="{ top: boar.top + '%' }">🐗💨</div>
<footer class="site-footer">
<div class="container footer-content">
<div class="footer-info">
© {{ new Date().getFullYear() }} HAUMDAUCHER Wurst und Spezialitäten n.e.V.
</div>
<nav class="footer-links">
<a href="#impressum">Impressum</a>
<span class="sep">•</span>
<a href="#datenschutz">Datenschutz</a>
</nav>
</div>
</footer>
</div>
</template>
<style>
@import './assets/styles/global.css';
.running-boar {
position: fixed;
left: -100px;
font-size: 3rem;
z-index: 1500;
animation: run-across 5s linear forwards;
}
@keyframes run-across {
0% { left: -100px; }
100% { left: 100vw; }
}
.backdoor {
position: fixed;
bottom: 0;
left: 0;
width: 10px;
height: 10px;
cursor: pointer;
z-index: 9999;
opacity: 0;
}
.legal-section {
min-height: auto !important;
padding: 60px 20px !important;
opacity: 0.8;
}
.legal-separator {
height: 1px;
background: var(--glass-border);
margin: 40px 10% 0;
opacity: 0.3;
}
.site-footer {
padding: 60px 0 100px; /* Extra bottom padding for mobile drawer */
border-top: 1px solid var(--glass-border);
background: var(--bg-color);
opacity: 0.8;
font-size: 0.85rem;
}
.footer-content {
display: flex;
flex-direction: column;
align-items: center;
gap: 15px;
}
.footer-links {
display: flex;
gap: 15px;
align-items: center;
}
.footer-links a {
color: inherit;
text-decoration: none;
font-weight: 500;
transition: opacity 0.2s;
}
.footer-links a:hover {
opacity: 1;
text-decoration: underline;
}
.sep {
opacity: 0.3;
}
@media (min-width: 768px) {
.site-footer {
padding: 60px 0;
}
.footer-content {
flex-direction: row;
justify-content: space-between;
}
}
</style>
Binary file not shown.

After

Width:  |  Height:  |  Size: 616 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 KiB

@@ -0,0 +1,126 @@
:root {
--bg-color: #ffffff;
--text-color: #000000;
--primary-color: #000000;
--accent-color: #333333;
--header-bg: rgba(255, 255, 255, 0.85);
--glass-border: rgba(0, 0, 0, 0.1);
--font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
--transition-speed: 0.3s;
--safe-area-bottom: env(safe-area-inset-bottom);
}
/* Mobile-first: Base styles are for mobile */
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
max-width: 100vw;
margin: 0;
padding: 0;
overflow-x: hidden !important;
-webkit-tap-highlight-color: transparent;
position: relative;
}
#app {
width: 100%;
max-width: 100vw;
overflow-x: hidden;
}
body {
background-color: var(--bg-color);
color: var(--text-color);
font-family: var(--font-family);
transition: background-color var(--transition-speed), color var(--transition-speed);
overscroll-behavior-y: none;
}
.container {
width: 100%;
max-width: 1000px; /* Centered content on desktop */
margin: 0 auto;
padding: 0 20px;
box-sizing: border-box;
}
/* App-like Sections */
section {
width: 100%;
min-height: 100dvh;
/* Dynamic viewport height for mobile */
padding: 80px 0 calc(80px + var(--safe-area-bottom));
overflow-x: hidden;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
}
.fancy-glass {
background: var(--header-bg);
backdrop-filter: blur(15px);
-webkit-backdrop-filter: blur(15px);
border: 1px solid var(--glass-border);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.alternate-bg {
padding: 30px 10px;
margin: 0 10px;
border-radius: 20px;
width: calc(100% - 20px);
}
h1,
h2,
h3 {
font-weight: 700;
letter-spacing: -0.02em;
overflow-wrap: break-word;
word-wrap: break-word;
}
p {
line-height: 1.6;
opacity: 0.9;
overflow-wrap: break-word;
max-width: 100%;
}
/* Theme Overrides */
[data-theme='dark'] {
--bg-color: #0f0f0f;
--text-color: #f0f0f0;
--primary-color: #d4af37;
--accent-color: #ffffff;
--header-bg: rgba(15, 15, 15, 0.85);
--glass-border: rgba(212, 175, 55, 0.2);
}
[data-theme='nat'] {
--bg-color: #1a2f1a;
--text-color: #d4c4a8;
--primary-color: #4a3728;
--accent-color: #8b5a2b;
--header-bg: rgba(26, 47, 26, 0.9);
--glass-border: #2e4d2e;
--font-family: 'Courier New', monospace;
}
[data-theme='nat'] .fancy-glass {
border: 3px solid #4a3728;
background-image: url('https://www.transparenttextures.com/patterns/dark-matter.png');
}
/* Desktop Polish */
@media (min-width: 768px) {
section {
padding: 100px 40px;
}
}
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>

After

Width:  |  Height:  |  Size: 496 B

@@ -0,0 +1,46 @@
<template>
<div class="gatekeeper">
<div v-if="isLoading">
<p class="animate-pulse">Loading permissions...</p>
</div>
<div v-else-if="!user" class="text-center p-8 glass-panel rounded-xl">
<h2 class="text-2xl font-bold mb-4">🔐 Locked Area</h2>
<p class="mb-6">Sign in with your Google account to access this content.</p>
<button @click="login" class="btn btn-primary">
Sign in with Google
</button>
</div>
<div v-else-if="!isAllowed" class="text-center p-8 glass-panel rounded-xl border border-red-500/30">
<h2 class="text-2xl font-bold mb-4 text-red-400">🚫 Access Pending</h2>
<p class="mb-6">
Hi <strong>{{ user.displayName }}</strong>. Your account ({{ user.email }}) is not yet on the guest list.
</p>
<p class="text-sm opacity-70">
Please ask the admin to add "<strong>{{ user.email }}</strong>" to the allowlist.
</p>
<button @click="logout" class="btn btn-sm btn-ghost mt-4">
Sign Out
</button>
</div>
<div v-else>
<slot></slot>
</div>
</div>
</template>
<script setup lang="ts">
import { useAuth } from '../composables/useAuth'
const { user, isAllowed, isLoading, login, logout } = useAuth()
</script>
<style scoped>
.glass-panel {
background: rgba(255, 255, 255, 0.05);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
</style>
@@ -0,0 +1,41 @@
<script setup lang="ts">
import { ref } from 'vue'
defineProps<{ msg: string }>()
const count = ref(0)
</script>
<template>
<h1>{{ msg }}</h1>
<div class="card">
<button type="button" @click="count++">count is {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test HMR
</p>
</div>
<p>
Check out
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
>create-vue</a
>, the official Vue + Vite starter
</p>
<p>
Learn more about IDE Support for Vue in the
<a
href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
target="_blank"
>Vue Docs Scaling up Guide</a
>.
</p>
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>
<style scoped>
.read-the-docs {
color: #888;
}
</style>
@@ -0,0 +1,202 @@
<script setup lang="ts">
import { ref } from 'vue'
import { confirmPasswordReset, verifyPasswordResetCode } from 'firebase/auth'
import { auth } from '../../firebase'
const props = defineProps<{
oobCode: string
t: (key: string) => any
}>()
const emit = defineEmits(['close'])
const newPassword = ref('')
const confirmPassword = ref('')
const error = ref('')
const success = ref(false)
const isLoading = ref(false)
const handleReset = async () => {
error.value = ''
if (newPassword.value !== confirmPassword.value) {
error.value = 'Die Passwörter stimmen nicht überein.'
return
}
if (newPassword.value.length < 6) {
error.value = 'Das Passwort muss mindestens 6 Zeichen lang sein.'
return
}
isLoading.value = true
try {
// Optional: First verify the code is valid
const email = await verifyPasswordResetCode(auth, props.oobCode)
// Then confirm the reset
await confirmPasswordReset(auth, props.oobCode, newPassword.value)
success.value = true
} catch (err: any) {
console.error('Password reset error:', err)
if (err.code === 'auth/invalid-action-code') {
error.value = 'Der Link ist ungültig oder abgelaufen. Bitte fordere einen neuen an.'
} else {
error.value = 'Ein Fehler ist aufgetreten: ' + err.message
}
} finally {
isLoading.value = false
}
}
</script>
<template>
<div class="reset-container">
<div class="glass-panel auth-card">
<h2 class="section-title">Neues Passwort 🌭</h2>
<div v-if="success" class="success-message">
<h3>Sauber!</h3>
<p>Dein Passwort wurde erfolgreich geändert.</p>
<button class="club-btn" @click="emit('close')">Zurück zur Startseite</button>
</div>
<form v-else @submit.prevent="handleReset" class="auth-form">
<p class="description">Bitte gib dein neues geheimes Haumdaucher-Passwort ein.</p>
<div class="input-group">
<label>Neues Passwort</label>
<input
type="password"
v-model="newPassword"
placeholder="Mindestens 6 Zeichen"
required
class="club-input"
/>
</div>
<div class="input-group">
<label>Passwort bestätigen</label>
<input
type="password"
v-model="confirmPassword"
placeholder="Nochmal zur Sicherheit"
required
class="club-input"
/>
</div>
<div v-if="error" class="error-alert">{{ error }}</div>
<div class="actions">
<button type="button" class="club-btn text-btn" @click="emit('close')">Abbrechen</button>
<button type="submit" class="club-btn" :disabled="isLoading">
{{ isLoading ? 'Speichern...' : 'Passwort ändern' }}
</button>
</div>
</form>
</div>
</div>
</template>
<style scoped>
.reset-container {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
background: var(--bg-color);
}
.auth-card {
width: 100%;
max-width: 400px;
padding: 40px;
text-align: center;
}
.description {
margin-bottom: 30px;
opacity: 0.8;
line-height: 1.5;
}
.auth-form {
display: flex;
flex-direction: column;
gap: 20px;
}
.input-group {
display: flex;
flex-direction: column;
gap: 8px;
text-align: left;
}
.input-group label {
font-size: 0.9rem;
font-weight: 600;
opacity: 0.9;
}
.club-input {
padding: 12px 15px;
border-radius: 8px;
border: 1px solid var(--glass-border);
background: rgba(255, 255, 255, 0.05);
color: var(--text-color);
font-size: 1rem;
font-family: inherit;
transition: all 0.3s ease;
}
.club-input:focus {
outline: none;
border-color: var(--primary-color);
background: rgba(255, 255, 255, 0.1);
}
.actions {
display: flex;
gap: 15px;
margin-top: 10px;
}
.actions .club-btn {
flex: 1;
}
.text-btn {
background: transparent !important;
border: 1px solid var(--glass-border) !important;
}
.text-btn:hover {
background: rgba(255, 255, 255, 0.05) !important;
}
.error-alert {
background: rgba(255, 75, 75, 0.1);
color: #ff4b4b;
padding: 10px;
border-radius: 8px;
font-size: 0.9rem;
border: 1px solid rgba(255, 75, 75, 0.3);
}
.success-message {
display: flex;
flex-direction: column;
gap: 20px;
align-items: center;
padding: 20px 0;
}
.success-message h3 {
color: #4caf50;
font-size: 1.5rem;
}
</style>
@@ -0,0 +1,397 @@
<script setup lang="ts">
import { ref, onMounted, onUnmounted, computed } from 'vue'
const props = defineProps<{
t: (key: string) => string
theme: string
}>()
const emit = defineEmits(['close', 'unlock-nat'])
const canvas = ref<HTMLCanvasElement | null>(null)
const gameState = ref<'start' | 'playing' | 'gameOver' | 'win'>('start')
const score = ref(0)
const level = ref(1)
const TOTAL_LEVELS = 10
let ctx: CanvasRenderingContext2D | null = null
let animationId: number
let playerX = 180
const playerY = 500
const playerWidth = 40
const playerHeight = 40
// Theme-based configurations
const themeConfig = computed(() => {
switch (props.theme) {
case 'unicorn':
return {
bg: '#fff0fb',
player: '🦄',
obstacles: { trash: '🍬', boat: '🍭', boar: '🧁' },
waves: 'rgba(255, 105, 180, 0.3)'
}
case 'luxury':
return {
bg: '#0a0a0a',
player: '👑',
obstacles: { trash: '💎', boat: '💍', boar: '💰' },
waves: 'rgba(212, 175, 55, 0.4)'
}
case 'win95':
return {
bg: '#c0c0c0',
player: '🖱️',
obstacles: { trash: '🗑️', boat: '📁', boar: '💣' },
waves: 'rgba(0,0,0,0.1)'
}
case 'nat':
return {
bg: '#1a2f1a',
player: '🐗',
obstacles: { trash: '🪵', boat: '🛶', boar: '🦢' },
waves: 'rgba(255,255,255,0.1)'
}
default:
return {
bg: '#1e3a8a',
player: '🦢',
obstacles: { trash: '🗑️', boat: '🚤', boar: '🐗' },
waves: 'rgba(255,255,255,0.2)'
}
}
})
interface Obstacle {
x: number
y: number
type: 'trash' | 'boat' | 'boar'
speed: number
}
const obstacles = ref<Obstacle[]>([])
const keys = ref<Record<string, boolean>>({})
// Touch handling
const handleTouchMove = (e: TouchEvent) => {
if (gameState.value !== 'playing') return
const touchX = e.touches[0].clientX
const canvasRect = canvas.value?.getBoundingClientRect()
if (canvasRect) {
playerX = Math.max(0, Math.min(360, (touchX - canvasRect.left) * (400 / canvasRect.width) - (playerWidth / 2)))
}
}
const initGame = () => {
gameState.value = 'playing'
score.value = 0
level.value = 1
obstacles.value = []
playerX = 180
gameLoop()
}
const gameLoop = () => {
if (gameState.value !== 'playing') return
update()
draw()
animationId = requestAnimationFrame(gameLoop)
}
const update = () => {
// Move player (Keyboard)
const speed = 7 // Made slightly faster for easier control
if (keys.value['ArrowLeft'] && playerX > 0) playerX -= speed
if (keys.value['ArrowRight'] && playerX < 360) playerX += speed
// Spawn obstacles - Adjusted frequency for better balance
const spawnChance = 0.01 + level.value * 0.002
if (Math.random() < spawnChance) {
const type = level.value === TOTAL_LEVELS ? 'boar' : (Math.random() > 0.6 ? 'trash' : 'boat')
obstacles.value.push({
x: Math.random() * 370,
y: -50,
type: type,
speed: 1.5 + level.value * 0.45 // Slightly slower for level 1 but scales up
})
}
// Move and filter obstacles
obstacles.value.forEach(obs => {
obs.y += obs.speed
// Collision detection (with a bit of buffer for better feel)
const buffer = 10
if (
playerX + buffer < obs.x + 30 &&
playerX + playerWidth - buffer > obs.x &&
playerY + buffer < obs.y + 30 &&
playerY + playerHeight - buffer > obs.y
) {
gameState.value = 'gameOver'
}
})
obstacles.value = obstacles.value.filter(obs => obs.y < 650)
// Score and level up
score.value += 1
if (score.value % 500 === 0 && level.value < TOTAL_LEVELS) {
level.value += 1
}
// Win condition
if (score.value >= TOTAL_LEVELS * 500 + 500) {
gameState.value = 'win'
emit('unlock-nat')
}
}
const draw = () => {
if (!ctx) return
ctx.clearRect(0, 0, 400, 600)
// Draw Background
ctx.fillStyle = themeConfig.value.bg
ctx.fillRect(0, 0, 400, 600)
// Draw Waves
ctx.strokeStyle = themeConfig.value.waves
ctx.lineWidth = 2
for (let i = 0; i < 5; i++) {
const y = (Date.now() / 20 + i * 120) % 650
ctx.beginPath()
ctx.moveTo(0, y)
ctx.bezierCurveTo(100, y - 10, 300, y + 10, 400, y)
ctx.stroke()
}
// Draw Player
ctx.font = '40px Arial'
ctx.textAlign = 'left'
ctx.textBaseline = 'top'
ctx.fillText(themeConfig.value.player, playerX, playerY)
// Draw Obstacles
obstacles.value.forEach(obs => {
const emoji = themeConfig.value.obstacles[obs.type]
ctx.fillText(emoji, obs.x, obs.y)
})
}
const handleKeydown = (e: KeyboardEvent) => keys.value[e.key] = true
const handleKeyup = (e: KeyboardEvent) => keys.value[e.key] = false
onMounted(() => {
if (canvas.value) {
ctx = canvas.value.getContext('2d')
window.addEventListener('keydown', handleKeydown)
window.addEventListener('keyup', handleKeyup)
}
})
onUnmounted(() => {
cancelAnimationFrame(animationId)
window.removeEventListener('keydown', handleKeydown)
window.removeEventListener('keyup', handleKeyup)
})
</script>
<template>
<div class="game-overlay fancy-glass">
<div class="game-window">
<div class="game-header">
<span>{{ t('game.title') }}</span>
<button @click="emit('close')">X</button>
</div>
<div class="canvas-container">
<canvas
ref="canvas"
width="400"
height="600"
@touchmove.prevent="handleTouchMove"
></canvas>
<div v-if="gameState === 'start'" class="overlay-content">
<h2>{{ t('game.title') }}</h2>
<p>Weich am Schmarrn in da Donau aus!</p>
<p style="font-size: 0.8rem; margin-top: 10px; opacity: 0.8;">Desktop: Pfeile | Mobile: Wischen</p>
<button @click="initGame">{{ t('game.start') }}</button>
</div>
<div v-if="gameState === 'gameOver'" class="overlay-content">
<h2 style="color: #ff4444; margin-bottom: 5px;">{{ t('game.gameOver') }}</h2>
<p>Level: {{ level }} / {{ TOTAL_LEVELS }}</p>
<p>Score: {{ score }}</p>
<button @click="initGame">No amoi!</button>
</div>
<div v-if="gameState === 'win'" class="overlay-content">
<h2 style="color: #44ff44; margin-bottom: 10px;">🏆 {{ t('game.win') }}</h2>
<p>Du hosd an NATinator bsiegt!</p>
<p style="color: #ffd700; font-weight: bold; margin-top: 10px;">🐗 NAT-Modus freigschaltet!</p>
<button @click="emit('close')">Zruck zur Website</button>
</div>
<div v-if="gameState === 'playing'" class="game-stats">
<div class="stats-left">
<span class="level-badge">{{ t('game.level') }} {{ level }}/{{ TOTAL_LEVELS }}</span>
<span v-if="level === TOTAL_LEVELS" class="boar-alert">🐗 BOAR RAIN! 🐗</span>
</div>
<span class="score-display">Score: {{ score }}</span>
</div>
<!-- Progress Bar -->
<div v-if="gameState === 'playing'" class="progress-container">
<div class="progress-bar" :style="{ width: (score / (TOTAL_LEVELS * 500 + 500)) * 100 + '%' }"></div>
</div>
</div>
</div>
</div>
</template>
<style scoped>
.game-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2000;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0,0,0,0.8);
}
.game-window {
background: #c0c0c0;
border: 3px solid;
border-color: #ffffff #808080 #808080 #ffffff;
padding: 4px;
width: 420px;
}
.game-header {
background: #000080;
color: white;
padding: 4px 8px;
display: flex;
justify-content: space-between;
align-items: center;
font-weight: bold;
margin-bottom: 4px;
}
.game-header button {
background: #c0c0c0;
border: 2px solid;
border-color: #ffffff #808080 #808080 #ffffff;
padding: 0 6px;
cursor: pointer;
color: black;
}
.canvas-container {
position: relative;
border: 2px solid #000;
}
canvas {
display: block;
background: #1e3a8a;
}
.overlay-content {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.7);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: white;
text-align: center;
padding: 20px;
}
.overlay-content h2 { margin-bottom: 20px; }
.overlay-content button {
background: #c0c0c0;
border: 3px solid;
border-color: #ffffff #808080 #808080 #ffffff;
padding: 10px 20px;
font-weight: bold;
cursor: pointer;
margin-top: 20px;
}
.game-stats {
position: absolute;
top: 10px;
left: 10px;
right: 10px;
display: flex;
justify-content: space-between;
align-items: center;
color: white;
font-weight: bold;
background: rgba(0,0,0,0.6);
padding: 8px 12px;
pointer-events: none;
font-size: 0.9rem;
}
.stats-left {
display: flex;
flex-direction: column;
gap: 4px;
}
.level-badge {
color: #fbbf24;
}
.boar-alert {
color: #ff4444;
font-size: 0.7rem;
animation: blink 0.5s infinite;
}
@keyframes blink {
50% { opacity: 0; }
}
.progress-container {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 4px;
background: rgba(0,0,0,0.3);
}
.progress-bar {
height: 100%;
background: #4ade80;
transition: width 0.3s;
}
@media (max-width: 450px) {
.game-window {
width: 95vw;
}
.canvas-container {
width: 100%;
}
canvas {
width: 100%;
height: auto;
}
}
</style>
@@ -0,0 +1,338 @@
<script setup lang="ts">
import { useAuth } from '../../composables/useAuth'
import { watch, ref } from 'vue'
const props = defineProps<{
currentTheme: string
isNatUnlocked: boolean
t: (key: string) => string
}>()
const emit = defineEmits(['update:theme', 'open:game'])
const themes = ['classic', 'dark', 'nat']
const { user, login, logout, error } = useAuth()
const showSettings = ref(false)
watch(user, (u) => {
console.log("👤 Header: User changed:", u ? u.email : "null")
})
</script>
<template>
<header class="fancy-glass header-top">
<div class="container top-content">
<!-- Logo & Status Area -->
<div class="branding-area">
<div class="logo-text">HAUMDAUCHER</div>
<div v-if="user" class="status-message">
<span class="desktop-msg">{{ isNatUnlocked ? 'Du bist a Haumdaucher 🫵 🍻' : 'Vielleicht... bist du a Haumdaucher' }}</span>
<span class="mobile-msg">{{ isNatUnlocked ? 'Haumdaucher! 🫵' : 'Vielleicht... 🤔' }}</span>
</div>
</div>
<div class="controls">
<!-- Mobile Settings Toggle -->
<button class="settings-toggle" @click="showSettings = !showSettings">
⚙️
</button>
<!-- Auth Control (Always Visible) -->
<div class="auth-control">
<div v-if="error" class="auth-error" :title="error">⚠️</div>
<button v-if="!user" @click="login" class="login-btn">
Login
</button>
<div v-else class="user-menu">
<button @click="logout" class="logout-btn">Exit</button>
<img :src="user.photoURL || ''" class="avatar" :title="user.displayName || ''" />
</div>
</div>
<!-- Theme switch -->
<div class="control-wrapper" :class="{ 'show-mobile': showSettings }">
<div class="switch-group">
<template v-for="th in themes">
<button
v-if="th !== 'nat' || isNatUnlocked"
:key="th"
:class="{ active: currentTheme === th }"
@click="emit('update:theme', th)"
class="theme-btn"
:title="t('themes.' + th)"
>
<span v-if="th === 'classic'">☀️</span>
<span v-if="th === 'dark'">🌙</span>
<span v-if="th === 'nat'">🐗</span>
</button>
</template>
</div>
</div>
</div>
</div>
</header>
<!-- Mobile Bottom Nav -->
<nav class="fancy-glass mobile-nav">
<a href="#home" class="nav-item">🏠<span>{{ t('nav.home') }}</span></a>
<a href="#spirit" class="nav-item">✨<span>{{ t('nav.spirit') }}</span></a>
<button class="nav-item game-btn" @click="emit('open:game')">🕹️<span>{{ t('nav.game') }}</span></button>
<a href="#impressum" class="nav-item">⚖️<span>Impressum</span></a>
</nav>
<!-- Desktop Side Nav / Links -->
<nav class="desktop-links">
<div class="container">
<a href="#spirit">{{ t('nav.spirit') }}</a>
<a href="#impressum">Impressum</a>
<a href="#datenschutz">Datenschutz</a>
<button class="game-nav-btn" @click="emit('open:game')">{{ t('nav.game') }}</button>
</div>
</nav>
</template>
<style scoped>
.header-top {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
padding: 10px 0;
}
.top-content {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 10px;
}
.logo-text {
font-weight: 900;
letter-spacing: 1px;
font-size: 0.9rem;
white-space: nowrap;
}
/* Base Layout */
.branding-area {
display: flex;
align-items: center;
}
.controls {
display: flex;
align-items: center;
justify-content: flex-end;
flex: 1;
}
.control-wrapper {
display: flex;
gap: 8px;
align-items: center;
}
.status-message {
font-size: 0.8rem;
font-weight: bold;
margin-left: 15px;
color: #555;
white-space: nowrap;
}
.mobile-msg { display: none; }
.settings-toggle { display: none; } /* Hidden on desktop */
/* Mobile adjustments */
@media (max-width: 480px) {
.branding-area {
flex-direction: column;
align-items: flex-start;
}
.status-message {
margin-left: 0;
margin-top: 2px;
}
.desktop-msg { display: none; }
.mobile-msg { display: inline; }
/* Settings Toggle Logic */
.control-wrapper {
display: none; /* Hidden by default on mobile */
position: absolute;
top: 60px;
right: 10px;
background: var(--header-bg);
padding: 10px;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
flex-direction: column;
align-items: flex-end;
border: 1px solid var(--glass-border);
backdrop-filter: blur(10px);
}
.control-wrapper.show-mobile {
display: flex;
}
.settings-toggle {
display: block;
font-size: 1.2rem;
padding: 5px;
margin-left: 5px;
}
}
.switch-group {
display: flex;
background: rgba(0,0,0,0.05);
padding: 2px;
border-radius: 8px;
}
button {
background: none;
border: none;
padding: 4px 8px;
border-radius: 6px;
cursor: pointer;
font-weight: bold;
font-size: 0.7rem;
color: inherit;
opacity: 0.5;
transition: all 0.2s;
}
button.active {
background: var(--primary-color);
color: #fff;
opacity: 1;
}
/* Mobile Nav Styles */
.mobile-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 65px;
z-index: 1000;
display: flex;
justify-content: space-around;
align-items: center;
padding-bottom: var(--safe-area-bottom);
border-radius: 20px 20px 0 0;
}
.nav-item {
text-decoration: none;
color: inherit;
font-size: 1.2rem;
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
background: none;
border: none;
}
.nav-item span {
font-size: 0.6rem;
font-weight: 500;
opacity: 0.7;
}
.desktop-links {
display: none;
}
/* Desktop Overrides */
@media (min-width: 768px) {
.logo-text { font-size: 1.2rem; }
.mobile-nav { display: none; }
.desktop-links {
display: block;
position: fixed;
top: 60px;
left: 0;
right: 0;
z-index: 999;
background: transparent;
padding: 10px 0;
text-align: center;
}
.desktop-links div {
display: flex;
justify-content: center;
gap: 30px;
align-items: center;
}
.desktop-links a {
text-decoration: none;
color: inherit;
font-weight: 500;
opacity: 0.8;
}
.desktop-links a:hover { opacity: 1; }
}
.game-nav-btn {
background: var(--primary-color);
color: white;
border: none;
padding: 8px 16px;
border-radius: 20px;
cursor: pointer;
font-weight: bold;
transition: transform 0.2s;
}
.auth-control {
margin-right: 15px;
display: flex;
align-items: center;
}
.login-btn {
background: rgba(255, 255, 255, 0.2);
color: inherit;
font-weight: bold;
padding: 6px 12px;
border-radius: 20px;
border: 1px solid rgba(255,255,255,0.1);
}
.user-menu {
display: flex;
align-items: center;
gap: 8px;
}
.avatar {
width: 28px;
height: 28px;
border-radius: 50%;
border: 2px solid var(--primary-color);
}
.logout-btn {
font-size: 0.7rem;
opacity: 0.7;
}
.auth-error {
color: #ff4444;
margin-right: 8px;
cursor: help;
font-size: 1.2rem;
}
</style>
@@ -0,0 +1,55 @@
<script setup lang="ts">
const props = defineProps<{
t: (key: string) => string
}>()
</script>
<template>
<section id="spirit" class="glass-section container">
<h2>{{ t('spirit.title') }}</h2>
<div class="content-text">
<p>{{ t('spirit.content') }}</p>
</div>
</section>
</template>
<style scoped>
.glass-section {
background: var(--glass-bg);
border: var(--glass-border);
box-shadow: var(--glass-shadow);
backdrop-filter: var(--glass-blur);
-webkit-backdrop-filter: var(--glass-blur);
border-radius: 20px;
padding: 40px;
margin-bottom: 40px;
color: var(--text-color);
transition: all 0.3s ease;
}
h2 {
font-size: 2.5rem;
margin-bottom: 20px;
color: var(--primary-color);
text-transform: uppercase;
letter-spacing: 2px;
}
.content-text {
font-size: 1.2rem;
line-height: 1.8;
white-space: pre-line;
}
@media (max-width: 480px) {
.glass-section {
padding: 20px;
}
h2 {
font-size: 2rem;
}
.content-text {
font-size: 1.1rem;
}
}
</style>
@@ -0,0 +1,100 @@
<script setup lang="ts">
import { computed } from 'vue'
const props = defineProps<{
theme: string
t: (key: string) => string
}>()
const logoSrc = computed(() => {
if (props.theme === 'unicorn') return '/images/logo_unicorn.png'
if (props.theme === 'luxury') return '/images/logo_luxury.png'
if (props.theme === 'win95') return '/images/logo_win95.png'
if (props.theme === 'nat') return '/images/logo_nat.png'
return '/images/logo_classic.png'
})
</script>
<template>
<section id="home" class="hero">
<div class="container hero-content">
<div class="logo-container">
<img :src="logoSrc" :key="theme" alt="Haumdaucher Logo" class="hero-logo" />
</div>
<h1 class="hero-title">{{ t('hero.title') }}</h1>
<p class="hero-subtitle">{{ t('hero.subtitle') }}</p>
<div class="scroll-indicator">↓</div>
</div>
</section>
</template>
<style scoped>
.hero {
position: relative;
overflow: hidden;
}
.hero-content {
display: flex;
flex-direction: column;
align-items: center;
}
.logo-container {
margin-bottom: 40px;
perspective: 1000px;
}
.hero-logo {
width: 300px;
height: auto;
animation: logo-entry 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes logo-entry {
0% { transform: scale(0.5) rotateY(90deg); opacity: 0; }
100% { transform: scale(1) rotateY(0); opacity: 1; }
}
.hero-title {
font-size: clamp(1.8rem, 8vw, 4rem); /* Reduced base from 2rem to 1.8rem */
margin-bottom: 10px;
text-transform: uppercase;
line-height: 1.1;
width: 100%;
max-width: 100vw;
overflow-wrap: break-word;
}
.hero-subtitle {
font-size: clamp(1rem, 5vw, 1.5rem);
font-style: italic;
width: 100%;
padding: 0 20px;
}
.scroll-indicator {
margin-top: 60px;
font-size: 2rem;
animation: bounce 2s infinite;
}
@keyframes bounce {
0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
40% {transform: translateY(-10px);}
60% {transform: translateY(-5px);}
}
[data-theme='luxury'] .hero-title {
background: linear-gradient(45deg, #d4af37, #f7ef8a, #d4af37);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
[data-theme='unicorn'] .hero-title {
background: linear-gradient(45deg, #f06292, #ba68c8, #64b5f6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
</style>
@@ -0,0 +1,39 @@
<script setup lang="ts">
const props = defineProps<{
t: (key: string) => string
}>()
</script>
<template>
<section id="datenschutz" class="glass-section container legal-section">
<h2>{{ t('datenschutz.title') }}</h2>
<div class="content-text">
<p>{{ t('datenschutz.content') }}</p>
</div>
</section>
</template>
<style scoped>
.legal-section {
background: rgba(0, 0, 0, 0.02);
border: var(--glass-border);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border-radius: 12px;
padding: 30px;
margin-bottom: 20px;
}
h2 {
font-size: 1.5rem;
margin-bottom: 15px;
text-transform: uppercase;
}
.content-text {
font-size: 1rem;
line-height: 1.6;
white-space: pre-line;
opacity: 0.8;
}
</style>
@@ -0,0 +1,40 @@
<script setup lang="ts">
const props = defineProps<{
t: (key: string) => string
}>()
</script>
<template>
<section id="impressum" class="glass-section container legal-section">
<h2>{{ t('impressum.title') }}</h2>
<div class="content-text">
<p>{{ t('impressum.content') }}</p>
</div>
</section>
</template>
<style scoped>
.legal-section {
margin-top: 60px;
background: rgba(0, 0, 0, 0.02);
border: var(--glass-border);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border-radius: 12px;
padding: 30px;
margin-bottom: 20px;
}
h2 {
font-size: 1.5rem;
margin-bottom: 15px;
text-transform: uppercase;
}
.content-text {
font-size: 1rem;
line-height: 1.6;
white-space: pre-line;
opacity: 0.8;
}
</style>
@@ -0,0 +1,88 @@
import { ref, watchEffect, computed } from 'vue'
import { auth, db } from '../firebase'
import { GoogleAuthProvider, signInWithPopup, signOut, type User } from 'firebase/auth'
import { doc, onSnapshot } from 'firebase/firestore'
// Global state
const user = ref<User | null>(null)
const isAllowed = ref(false)
const isLoading = ref(true)
const error = ref<string | null>(null)
// Watch auth state
if (auth) {
auth.onAuthStateChanged((u) => {
console.log("🔥 Auth State Changed:", u ? u.email : "Logged Out")
user.value = u
if (!u) {
isAllowed.value = false
isLoading.value = false
}
})
} else {
isLoading.value = false
}
// Check allowlist
watchEffect((onCleanup) => {
if (!user.value || !db) return
// Subscribe to the config/allowlist document
const allowlistRef = doc(db, 'config', 'allowlist')
const unsubscribe = onSnapshot(allowlistRef, (docSnap) => {
isLoading.value = false
if (docSnap.exists()) {
const data = docSnap.data()
const emails = data.emails || []
isAllowed.value = emails.includes(user.value?.email)
} else {
isAllowed.value = false // Config doc missing -> deny all
}
}, (err) => {
console.error("Failed to check allowlist", err)
error.value = "Failed to check allowlist: " + err.message
isLoading.value = false
})
onCleanup(() => unsubscribe())
})
export function useAuth() {
const login = async () => {
error.value = null
if (!auth) {
error.value = "Firebase is not configured!"
return
}
try {
const provider = new GoogleAuthProvider()
await signInWithPopup(auth, provider)
} catch (e: any) {
console.error("Login failed", e)
error.value = e.message
throw e
}
}
const logout = async () => {
error.value = null
if (!auth) return
try {
await signOut(auth)
user.value = null
isAllowed.value = false
} catch (e: any) {
console.error("Logout failed", e)
error.value = e.message
}
}
return {
user,
isAllowed: computed(() => isAllowed.value),
isLoading: computed(() => isLoading.value),
error: computed(() => error.value),
login,
logout
}
}
+26
View File
@@ -0,0 +1,26 @@
import { initializeApp } from 'firebase/app'
import { getAuth } from 'firebase/auth'
import { getFirestore } from 'firebase/firestore'
// Use environment variables or fallback for dev (though env variables are preferred)
// In a real setup, these should be injected via VITE_FIREBASE_CONFIG or individual keys.
const firebaseConfig = {
apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET,
messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
appId: import.meta.env.VITE_FIREBASE_APP_ID
}
// Initialize Firebase safely
export let auth: ReturnType<typeof getAuth> | null = null;
export let db: ReturnType<typeof getFirestore> | null = null;
if (firebaseConfig.apiKey) {
const app = initializeApp(firebaseConfig)
auth = getAuth(app)
db = getFirestore(app)
} else {
console.warn("⚠️ Firebase API Key missing. Firebase features are disabled.")
}
@@ -0,0 +1,37 @@
export const messages = {
de: {
nav: {
home: 'Start',
spirit: 'Spirit',
game: 'Haumdaucher Game'
},
hero: {
title: 'Haumdaucher',
subtitle: 'Wurst und Spezialitäten n.e.V. – in Gründung'
},
spirit: {
title: 'Unser Spirit',
content: 'Wir pflegen die Kultur der Kulinarik. Es liegt in unserer DNA, andere Menschen mit Spezialitäten zu bewirten und uns gegenseitig mit Köstlichkeiten zu verwöhnen. Der Fokus liegt bei uns auf – aber nicht exklusiv bei – echtem Wurst-Handwerk.'
},
impressum: {
title: 'Impressum',
content: 'HAUMDAUCHER Wurst und Spezialitäten n.e.V. (in Gründung)\n\nVertreten durch:\nMoritz Graf (1. Vorstand)\nGrabengasse 7\n93059 Regensburg\n\nKontakt:\nTelefon: 094183065717\nE-Mail: info@haumdaucher.de'
},
datenschutz: {
title: 'Datenschutzerklärung',
content: 'Wir nehmen den Schutz Ihrer persönlichen Daten sehr ernst. Als reine Repräsentationsseite erheben wir keine personenbezogenen Daten von Besuchern, es sei denn, dies ist technisch notwendig.\n\n**Google Firebase Authentication**\nZur Bereitstellung unseres Mitglieder-Logins nutzen wir Firebase Authentication (Google Ireland Limited). Dabei werden Daten (z.B. E-Mail) verarbeitet. Dies erfolgt auf Grundlage von Art. 6 Abs. 1 lit. b DSGVO. Daten können in die USA übertragen werden, abgesichert durch das EU-U.S. Data Privacy Framework und Standardvertragsklauseln.'
},
themes: {
classic: 'Klassisch',
dark: 'Dunkel',
nat: 'NAT-Mode'
},
game: {
title: 'Haumdaucher Scroller',
start: 'Spiel starten',
gameOver: 'Aus’gmacht! Game Over.',
level: 'Level',
win: 'NATinator bezwungen! Du bist a echter Haumdaucher.'
}
}
}
+5
View File
@@ -0,0 +1,5 @@
import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
createApp(App).mount('#app')
+79
View File
@@ -0,0 +1,79 @@
:root {
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}
h1 {
font-size: 3.2em;
line-height: 1.1;
}
button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}
.card {
padding: 2em;
}
#app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}