Main structure.
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
*.local
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
# React + TypeScript + Vite
|
||||||
|
|
||||||
|
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
||||||
|
|
||||||
|
Currently, two official plugins are available:
|
||||||
|
|
||||||
|
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
|
||||||
|
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
|
||||||
|
|
||||||
|
## React Compiler
|
||||||
|
|
||||||
|
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
||||||
|
|
||||||
|
## Expanding the ESLint configuration
|
||||||
|
|
||||||
|
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
||||||
|
|
||||||
|
```js
|
||||||
|
export default defineConfig([
|
||||||
|
globalIgnores(['dist']),
|
||||||
|
{
|
||||||
|
files: ['**/*.{ts,tsx}'],
|
||||||
|
extends: [
|
||||||
|
// Other configs...
|
||||||
|
|
||||||
|
// Remove tseslint.configs.recommended and replace with this
|
||||||
|
tseslint.configs.recommendedTypeChecked,
|
||||||
|
// Alternatively, use this for stricter rules
|
||||||
|
tseslint.configs.strictTypeChecked,
|
||||||
|
// Optionally, add this for stylistic rules
|
||||||
|
tseslint.configs.stylisticTypeChecked,
|
||||||
|
|
||||||
|
// Other configs...
|
||||||
|
],
|
||||||
|
languageOptions: {
|
||||||
|
parserOptions: {
|
||||||
|
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
||||||
|
tsconfigRootDir: import.meta.dirname,
|
||||||
|
},
|
||||||
|
// other options...
|
||||||
|
},
|
||||||
|
},
|
||||||
|
])
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
||||||
|
|
||||||
|
```js
|
||||||
|
// eslint.config.js
|
||||||
|
import reactX from 'eslint-plugin-react-x'
|
||||||
|
import reactDom from 'eslint-plugin-react-dom'
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
globalIgnores(['dist']),
|
||||||
|
{
|
||||||
|
files: ['**/*.{ts,tsx}'],
|
||||||
|
extends: [
|
||||||
|
// Other configs...
|
||||||
|
// Enable lint rules for React
|
||||||
|
reactX.configs['recommended-typescript'],
|
||||||
|
// Enable lint rules for React DOM
|
||||||
|
reactDom.configs.recommended,
|
||||||
|
],
|
||||||
|
languageOptions: {
|
||||||
|
parserOptions: {
|
||||||
|
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
||||||
|
tsconfigRootDir: import.meta.dirname,
|
||||||
|
},
|
||||||
|
// other options...
|
||||||
|
},
|
||||||
|
},
|
||||||
|
])
|
||||||
|
```
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import js from '@eslint/js'
|
||||||
|
import globals from 'globals'
|
||||||
|
import reactHooks from 'eslint-plugin-react-hooks'
|
||||||
|
import reactRefresh from 'eslint-plugin-react-refresh'
|
||||||
|
import tseslint from 'typescript-eslint'
|
||||||
|
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
globalIgnores(['dist']),
|
||||||
|
{
|
||||||
|
files: ['**/*.{ts,tsx}'],
|
||||||
|
extends: [
|
||||||
|
js.configs.recommended,
|
||||||
|
tseslint.configs.recommended,
|
||||||
|
reactHooks.configs.flat.recommended,
|
||||||
|
reactRefresh.configs.vite,
|
||||||
|
],
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 2020,
|
||||||
|
globals: globals.browser,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
])
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>naturvardarna-app</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Generated
+7881
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "naturvardarna-app",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.0.0",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite --host",
|
||||||
|
"build": "tsc -b && vite build",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"preview": "vite preview"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@tailwindcss/vite": "^4.2.1",
|
||||||
|
"lucide-react": "^0.577.0",
|
||||||
|
"react": "^19.2.4",
|
||||||
|
"react-dom": "^19.2.4",
|
||||||
|
"react-router-dom": "^7.13.1",
|
||||||
|
"tailwindcss": "^4.2.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^9.39.4",
|
||||||
|
"@types/node": "^24.12.0",
|
||||||
|
"@types/react": "^19.2.14",
|
||||||
|
"@types/react-dom": "^19.2.3",
|
||||||
|
"@vitejs/plugin-react": "^6.0.0",
|
||||||
|
"eslint": "^9.39.4",
|
||||||
|
"eslint-plugin-react-hooks": "^7.0.1",
|
||||||
|
"eslint-plugin-react-refresh": "^0.5.2",
|
||||||
|
"globals": "^17.4.0",
|
||||||
|
"typescript": "~5.9.3",
|
||||||
|
"typescript-eslint": "^8.56.1",
|
||||||
|
"vite": "^8.0.0",
|
||||||
|
"vite-plugin-pwa": "^1.2.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 9.3 KiB |
@@ -0,0 +1,24 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<symbol id="bluesky-icon" viewBox="0 0 16 17">
|
||||||
|
<g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
|
||||||
|
<defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="discord-icon" viewBox="0 0 20 19">
|
||||||
|
<path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="documentation-icon" viewBox="0 0 21 20">
|
||||||
|
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
|
||||||
|
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
|
||||||
|
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="github-icon" viewBox="0 0 19 19">
|
||||||
|
<path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="social-icon" viewBox="0 0 20 20">
|
||||||
|
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
|
||||||
|
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="x-icon" viewBox="0 0 19 19">
|
||||||
|
<path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
|
||||||
|
</symbol>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 4.9 KiB |
+80
@@ -0,0 +1,80 @@
|
|||||||
|
// src/App.tsx
|
||||||
|
|
||||||
|
import { Calendar, FileText, Home as HomeIcon, Leaf, Map, ShieldAlert } from 'lucide-react';
|
||||||
|
import { Link, Route, BrowserRouter as Router, Routes, useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { Documents } from './pages/Documents';
|
||||||
|
import { FAQ } from './pages/FAQ';
|
||||||
|
import { Home } from './pages/Home';
|
||||||
|
import { JobInfo } from './pages/JobInfo';
|
||||||
|
import { Schedule } from './pages/Schedule';
|
||||||
|
|
||||||
|
const Admin = () => <div className="p-6"><h2>Admin Dashboard (Kräver pinkod)</h2></div>;
|
||||||
|
|
||||||
|
const NavItem = ({ to, icon: Icon, label }: { to: string, icon: any, label: string }) => {
|
||||||
|
const location = useLocation();
|
||||||
|
const isActive = location.pathname === to;
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
to={to}
|
||||||
|
className={`flex items-center px-4 py-3 whitespace-nowrap text-sm font-bold transition-all border-b-[3px] ${isActive
|
||||||
|
? 'border-gold text-gold bg-ebony/30'
|
||||||
|
: 'border-transparent text-eggshell/80 hover:text-eggshell hover:bg-eggshell/5'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<Icon size={18} className="mr-2" strokeWidth={isActive ? 2.5 : 2} />
|
||||||
|
{label}
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
function AppContent() {
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen bg-eggshell font-sans text-ebony selection:bg-gold selection:text-ebony">
|
||||||
|
|
||||||
|
{/* Creative, vibrant header using only your colors */}
|
||||||
|
<header className="sticky top-0 z-50 bg-ebony shadow-md">
|
||||||
|
<div className="max-w-5xl mx-auto">
|
||||||
|
{/* App Title Bar */}
|
||||||
|
<div className="px-4 py-3 flex items-center justify-between">
|
||||||
|
<h1 className="text-xl font-black text-eggshell flex items-center tracking-tight uppercase drop-shadow-sm">
|
||||||
|
<Leaf className="mr-2 text-seafoam" size={20} />
|
||||||
|
Naturvärdarna
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Scrollable Tab Navigation */}
|
||||||
|
<nav className="flex overflow-x-auto scrollbar-hide border-t border-eggshell/10">
|
||||||
|
<NavItem to="/" icon={HomeIcon} label="Hem" />
|
||||||
|
<NavItem to="/faq" icon={Map} label="FAQ" />
|
||||||
|
<NavItem to="/schedule" icon={Calendar} label="Schema" />
|
||||||
|
<NavItem to="/documents" icon={FileText} label="Info & Dok" />
|
||||||
|
<NavItem to="/admin" icon={ShieldAlert} label="Admin" />
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
{/* Main Content Area */}
|
||||||
|
<main className="max-w-5xl mx-auto p-4 py-6 md:py-8">
|
||||||
|
<Routes>
|
||||||
|
<Route path="/" element={<Home />} />
|
||||||
|
<Route path="/info" element={<JobInfo />} />
|
||||||
|
<Route path="/faq" element={<FAQ />} />
|
||||||
|
<Route path="/documents" element={<Documents />} />
|
||||||
|
<Route path="/schedule" element={<Schedule />} />
|
||||||
|
<Route path="/admin" element={<Admin />} />
|
||||||
|
</Routes>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return (
|
||||||
|
<Router>
|
||||||
|
<AppContent />
|
||||||
|
</Router>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"category": "Alla platser",
|
||||||
|
"questions": [
|
||||||
|
{
|
||||||
|
"q": "Är parkeringen gratis?",
|
||||||
|
"a": "JA!"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Var får man ställa husbilen?",
|
||||||
|
"a": "Vid golfparkeringen längst in, Stora parkeringen längst in, Vid Mölle kapell, eller First Camp."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"category": "Stora parkeringen",
|
||||||
|
"questions": [
|
||||||
|
{
|
||||||
|
"q": "Hur långt är det till fyren?",
|
||||||
|
"a": "350m."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Finns det någon bra kort vandringsrunda?",
|
||||||
|
"a": "Facit i form av förbestämda rutter med kända distanser."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Finns det några coola grottor i närheten?",
|
||||||
|
"a": "Silvergrottan, Visitgrottan (efter 15 juli), Lahibiagrottan (störst)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Var ligger Naturum?",
|
||||||
|
"a": "Vid fyren, 350m. Här finns info, broschyrer, personal, akvarier, fågelskådning, tumlarspaning, och Kullabergsguiderna."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Tumalarsafari/Kullabergsguiderna?",
|
||||||
|
"a": "Skicka till Naturum, infodisk på insidan."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Var kan man tälta?",
|
||||||
|
"a": "Tältrutan eller i vindskydden, se karta."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Var får man grilla?",
|
||||||
|
"a": "Bara i fasta grillplatser! INGEN EGEN GRILL! Ingen grillning under eldningsförbud."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Var kan man bada?",
|
||||||
|
"a": "Se broschyrer om badplatser."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Vad kan man göra mer i Höganäs?",
|
||||||
|
"a": "Kolla in destinationskunskaps underlaget."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"category": "Himmelstorp",
|
||||||
|
"questions": [
|
||||||
|
{
|
||||||
|
"q": "Var ligger det här Nimis stället?",
|
||||||
|
"a": "Avråd från att gå dit. Vill de gå ändå så tänk på skor, små barn, väder, ålder = det är brant. Vi vill inte behöva ringa räddningstjänsten."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Finns det någon bra vandringsrunda?",
|
||||||
|
"a": "Facit i form av förbestämda rutter med kända distanser."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Var ligger himmelstorpsgården?",
|
||||||
|
"a": "Bara upp för backen och till vänster längs med stigen."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Var parkerar man om det är fullt?",
|
||||||
|
"a": "Nedre parkeringen eller på björkerrödsparkering, lätt guidning dit."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Vart är islandshästridningen?",
|
||||||
|
"a": "Precis ovanför backen."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"category": "Josefinelust",
|
||||||
|
"questions": [
|
||||||
|
{
|
||||||
|
"q": "Finns det någon bra vandringsrunda?",
|
||||||
|
"a": "Facit i form av förbestämda rutter med kända distanser."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Var ligger Ransvik?",
|
||||||
|
"a": "Följ vägen utå mot fyren och ta första vänster där det står skyltat mot Ransvik."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"q": "Var parkerar man om det är fullt?",
|
||||||
|
"a": "Ransviks övre parkering."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"day": "Måndag",
|
||||||
|
"pilgrimsfalkarna": {
|
||||||
|
"time": "08:00 - 12:00",
|
||||||
|
"title": "Pilgrimsfalkarna",
|
||||||
|
"notes": "Morgonpass"
|
||||||
|
},
|
||||||
|
"tumlarna": {
|
||||||
|
"time": "12:00 - 16:00",
|
||||||
|
"title": "Tumlarna",
|
||||||
|
"notes": "Eftermiddagspass"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"day": "Tisdag",
|
||||||
|
"pilgrimsfalkarna": {
|
||||||
|
"time": "08:00 - 12:00",
|
||||||
|
"title": "Pilgrimsfalkarna",
|
||||||
|
"notes": "Morgonpass"
|
||||||
|
},
|
||||||
|
"tumlarna": {
|
||||||
|
"time": "12:00 - 16:00",
|
||||||
|
"title": "Tumlarna",
|
||||||
|
"notes": "Eftermiddagspass"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"day": "Onsdag",
|
||||||
|
"pilgrimsfalkarna": {
|
||||||
|
"time": "12:00 - 16:00",
|
||||||
|
"title": "Pilgrimsfalkarna",
|
||||||
|
"notes": "Eftermiddagspass"
|
||||||
|
},
|
||||||
|
"tumlarna": {
|
||||||
|
"time": "08:00 - 12:00",
|
||||||
|
"title": "Tumlarna",
|
||||||
|
"notes": "Morgonpass"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"day": "Torsdag",
|
||||||
|
"pilgrimsfalkarna": {
|
||||||
|
"time": "12:00 - 16:00",
|
||||||
|
"title": "Pilgrimsfalkarna",
|
||||||
|
"notes": "Eftermiddagspass"
|
||||||
|
},
|
||||||
|
"tumlarna": {
|
||||||
|
"time": "08:00 - 12:00",
|
||||||
|
"title": "Tumlarna",
|
||||||
|
"notes": "Morgonpass"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"day": "Fredag",
|
||||||
|
"pilgrimsfalkarna": {
|
||||||
|
"time": "08:00 - 12:00",
|
||||||
|
"title": "Pilgrimsfalkarna",
|
||||||
|
"notes": "Morgonpass"
|
||||||
|
},
|
||||||
|
"tumlarna": {
|
||||||
|
"time": "12:00 - 16:00",
|
||||||
|
"title": "Tumlarna",
|
||||||
|
"notes": "Eftermiddagspass"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"day": "Lördag",
|
||||||
|
"pilgrimsfalkarna": {
|
||||||
|
"time": "08:00 - 15:10",
|
||||||
|
"title": "Pilgrimsfalkarna",
|
||||||
|
"notes": "Heldagspass"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"day": "Söndag",
|
||||||
|
"tumlarna": {
|
||||||
|
"time": "08:00 - 15:10",
|
||||||
|
"title": "Tumlarna",
|
||||||
|
"notes": "Heldagspass"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/* src/index.css */
|
||||||
|
|
||||||
|
@import "tailwindcss";
|
||||||
|
|
||||||
|
@theme {
|
||||||
|
--color-ebony: #5e6545;
|
||||||
|
--color-moss: #878b5a;
|
||||||
|
--color-eggshell: #e7e4cf;
|
||||||
|
--color-gold: #d6b456;
|
||||||
|
--color-goldenrod: #c48d2e;
|
||||||
|
|
||||||
|
--color-slate-teal: #456466;
|
||||||
|
--color-seafoam: #5B8C8A;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: var(--color-eggshell);
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
// src/main.tsx
|
||||||
|
|
||||||
|
import { StrictMode } from 'react'
|
||||||
|
import { createRoot } from 'react-dom/client'
|
||||||
|
import App from './App.tsx'
|
||||||
|
import './index.css'
|
||||||
|
import { registerSW } from 'virtual:pwa-register'
|
||||||
|
|
||||||
|
registerSW({ immediate: true })
|
||||||
|
|
||||||
|
createRoot(document.getElementById('root')!).render(
|
||||||
|
<StrictMode>
|
||||||
|
<App />
|
||||||
|
</StrictMode>,
|
||||||
|
)
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
// src/pages/Documents.tsx
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { Map, Droplets, ShieldAlert, Download, ExternalLink, Folder } from 'lucide-react';
|
||||||
|
|
||||||
|
export const Documents: React.FC = () => {
|
||||||
|
const docs = [
|
||||||
|
{ title: 'Turistkarta Kullaberg', icon: <Map size={24} />, file: '/Turistkarta - Kullaberg.pdf' },
|
||||||
|
{ title: 'Badplatser att besöka', icon: <Droplets size={24} />, file: '/Badplatser att besöka.pdf' },
|
||||||
|
{ title: 'Checklista Nödsituationer', icon: <ShieldAlert size={24} />, file: '/2025 Checklista vid nödsituationer Kullabergs naturreservat.docx' }
|
||||||
|
];
|
||||||
|
|
||||||
|
const links = [
|
||||||
|
{ title: 'Kullabergs Naturreservat', url: 'https://www.kullabergsnatur.se/' },
|
||||||
|
{ title: 'Väderprognos Mölle', url: 'https://www.smhi.se' }
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="space-y-8 animate-fade-in w-full">
|
||||||
|
<div>
|
||||||
|
<h1 className="text-3xl font-black text-slate-teal tracking-tight flex items-center">
|
||||||
|
<Folder className="mr-3 text-seafoam" size={32} />
|
||||||
|
Info & Dokument
|
||||||
|
</h1>
|
||||||
|
<p className="text-moss font-medium mt-2 ml-11">Allt du behöver för att guida besökarna.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2 className="text-sm font-black text-ebony/50 uppercase tracking-widest mb-4">Nedladdningar</h2>
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||||
|
{docs.map((doc, idx) => (
|
||||||
|
<a key={idx} href={doc.file} target="_blank" rel="noopener noreferrer"
|
||||||
|
className="group flex items-center justify-between bg-white/60 backdrop-blur-sm p-5 rounded-2xl border border-white hover:-translate-y-1 hover:shadow-xl hover:shadow-moss/10 transition-all duration-300"
|
||||||
|
>
|
||||||
|
<div className="flex items-center text-slate-teal">
|
||||||
|
<div className="bg-gradient-to-br from-seafoam to-slate-teal p-3 rounded-xl mr-4 text-eggshell shadow-inner">{doc.icon}</div>
|
||||||
|
<span className="font-bold text-sm">{doc.title}</span>
|
||||||
|
</div>
|
||||||
|
<Download size={20} className="text-moss group-hover:text-slate-teal transition-colors" />
|
||||||
|
</a>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2 className="text-sm font-black text-ebony/50 uppercase tracking-widest mb-4">Användbara Länkar</h2>
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||||
|
{links.map((link, idx) => (
|
||||||
|
<a key={idx} href={link.url} target="_blank" rel="noopener noreferrer"
|
||||||
|
className="group flex items-center justify-between bg-white/60 backdrop-blur-sm p-5 rounded-2xl border border-white hover:-translate-y-1 hover:shadow-xl hover:shadow-moss/10 transition-all duration-300"
|
||||||
|
>
|
||||||
|
<span className="font-bold text-slate-teal text-sm">{link.title}</span>
|
||||||
|
<div className="bg-eggshell rounded-full p-2 group-hover:bg-seafoam group-hover:text-eggshell transition-colors">
|
||||||
|
<ExternalLink size={16} className="text-slate-teal group-hover:text-eggshell" />
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
// src/pages/FAQ.tsx
|
||||||
|
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import faqData from '../data/faq.json';
|
||||||
|
import { ChevronDown, ChevronUp, MessageCircleQuestionMark } from 'lucide-react';
|
||||||
|
|
||||||
|
export const FAQ: React.FC = () => {
|
||||||
|
const [openIndex, setOpenIndex] = useState<string | null>(null);
|
||||||
|
|
||||||
|
const toggleQuestion = (index: string) => {
|
||||||
|
setOpenIndex(openIndex === index ? null : index);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full animate-fade-in">
|
||||||
|
<div className="mb-8">
|
||||||
|
<h1 className="text-3xl font-black text-slate-teal tracking-tight flex items-center">
|
||||||
|
<MessageCircleQuestionMark className="mr-3 text-seafoam" size={32} />
|
||||||
|
Veckoschema
|
||||||
|
</h1>
|
||||||
|
<p className="text-moss font-medium mt-2 ml-11">Här hittar du när vi bemannar Kullaberg.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="columns-1 lg:columns-2 gap-6 space-y-6">
|
||||||
|
{faqData.map((section, sIndex) => (
|
||||||
|
<div key={sIndex} className="break-inside-avoid bg-white/40 backdrop-blur-md border border-white p-6 rounded-3xl shadow-lg shadow-ebony/5">
|
||||||
|
<h2 className="text-lg font-black text-ebony/70 uppercase tracking-widest mb-4">
|
||||||
|
{section.category}
|
||||||
|
</h2>
|
||||||
|
<div className="space-y-3">
|
||||||
|
{section.questions.map((item, qIndex) => {
|
||||||
|
const id = `${sIndex}-${qIndex}`;
|
||||||
|
const isOpen = openIndex === id;
|
||||||
|
return (
|
||||||
|
<div key={id} className={`rounded-2xl overflow-hidden transition-all duration-300 ${isOpen ? 'bg-white shadow-md shadow-seafoam/10' : 'bg-eggshell/50 hover:bg-white'}`}>
|
||||||
|
<button
|
||||||
|
className="w-full text-left p-4 flex justify-between items-center focus:outline-none"
|
||||||
|
onClick={() => toggleQuestion(id)}
|
||||||
|
>
|
||||||
|
<span className="font-bold text-slate-teal text-sm pr-4 leading-snug">{item.q}</span>
|
||||||
|
<div className={`p-1 rounded-full transition-colors ${isOpen ? 'bg-seafoam text-eggshell' : 'bg-transparent text-seafoam'}`}>
|
||||||
|
{isOpen ? <ChevronUp size={16} /> : <ChevronDown size={16} />}
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
<div className={`transition-all duration-300 ease-in-out ${isOpen ? 'max-h-[500px] opacity-100' : 'max-h-0 opacity-0 overflow-hidden'}`}>
|
||||||
|
<div className="p-4 pt-0 text-ebony font-medium text-sm leading-relaxed border-t border-ebony/5 mx-4 mt-2">
|
||||||
|
{item.a}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
// src/pages/Home.tsx
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { AlertTriangle, PhoneCall, ArrowRight } from 'lucide-react';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
export const Home: React.FC = () => {
|
||||||
|
return (
|
||||||
|
<div className="space-y-6 animate-fade-in">
|
||||||
|
|
||||||
|
{/* Welcome Banner */}
|
||||||
|
<div className="bg-slate-teal rounded-2xl p-6 md:p-8 shadow-lg shadow-slate-teal/10 text-eggshell">
|
||||||
|
<h1 className="text-3xl md:text-4xl font-black tracking-tight mb-2 drop-shadow-sm">Välkommen!</h1>
|
||||||
|
<p className="text-eggshell/90 font-bold text-lg">Naturvärdarna på Kullaberg — Sommar {new Date().getFullYear()}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Daily Notice Card */}
|
||||||
|
<div className="bg-gold rounded-2xl p-5 flex items-start shadow-md shadow-goldenrod/20 text-ebony">
|
||||||
|
<div className="bg-eggshell/40 p-2 rounded-xl mr-4 shrink-0">
|
||||||
|
<AlertTriangle className="text-ebony" size={24} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3 className="font-black uppercase tracking-widest text-sm mb-1">Dagens Påminnelse</h3>
|
||||||
|
<p className="text-sm font-medium leading-relaxed">
|
||||||
|
Glöm inte minst 1 liter vatten, solkräm och myggmedel. Det förväntas bli mycket varmt idag!
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Quick Action Cards */}
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
|
<Link to="/schedule" className="group bg-eggshell/50 border-2 border-moss/30 rounded-2xl p-6 hover:-translate-y-1 hover:bg-moss/10 hover:border-moss/60 hover:shadow-lg transition-all duration-300">
|
||||||
|
<div className="bg-seafoam/20 w-12 h-12 rounded-xl flex items-center justify-center mb-4 text-slate-teal group-hover:bg-seafoam group-hover:text-eggshell transition-colors">
|
||||||
|
<ArrowRight size={24} className="group-hover:rotate-45 transition-transform" />
|
||||||
|
</div>
|
||||||
|
<h3 className="font-black text-ebony text-xl mb-2 uppercase tracking-wide">Ditt Schema</h3>
|
||||||
|
<p className="text-sm text-ebony/70 font-medium">Kolla dina arbetspass och dagliga rundor snabbt.</p>
|
||||||
|
</Link>
|
||||||
|
|
||||||
|
<Link to="/faq" className="group bg-eggshell/50 border-2 border-moss/30 rounded-2xl p-6 hover:-translate-y-1 hover:bg-moss/10 hover:border-moss/60 hover:shadow-lg transition-all duration-300">
|
||||||
|
<div className="bg-seafoam/20 w-12 h-12 rounded-xl flex items-center justify-center mb-4 text-slate-teal group-hover:bg-seafoam group-hover:text-eggshell transition-colors">
|
||||||
|
<ArrowRight size={24} className="group-hover:rotate-45 transition-transform" />
|
||||||
|
</div>
|
||||||
|
<h3 className="font-black text-ebony text-xl mb-2 uppercase tracking-wide">Vanliga Frågor</h3>
|
||||||
|
<p className="text-sm text-ebony/70 font-medium">Snabba svar på turisternas vanligaste funderingar.</p>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Contact Card */}
|
||||||
|
<div className="bg-eggshell/50 border-2 border-moss/30 rounded-2xl overflow-hidden shadow-sm">
|
||||||
|
<div className="bg-moss/20 px-6 py-4 flex items-center border-b-2 border-moss/30">
|
||||||
|
<PhoneCall size={20} className="text-ebony mr-3" />
|
||||||
|
<h3 className="font-black text-ebony uppercase tracking-widest text-sm">Snabbkontakt</h3>
|
||||||
|
</div>
|
||||||
|
<div className="p-6 space-y-4">
|
||||||
|
<div className="flex justify-between items-center pb-4 border-b border-moss/20">
|
||||||
|
<span className="text-base font-bold text-ebony">William Söderberg</span>
|
||||||
|
<div className='flex gap-2 flex-wrap justify-end'>
|
||||||
|
<a href="tel:0722470291" className="text-sm text-slate-teal font-mono font-bold bg-seafoam/20 hover:bg-seafoam/40 px-3 py-1.5 rounded-lg transition-colors">072-247 02 91</a>
|
||||||
|
<a href="tel:078389355810604" className="text-sm text-slate-teal font-mono font-bold bg-seafoam/20 hover:bg-seafoam/40 px-3 py-1.5 rounded-lg transition-colors">078-389 35 58 10 604</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between items-center">
|
||||||
|
<span className="text-base font-bold text-ebony">Oliver Nilsson</span>
|
||||||
|
<div className='flex gap-2 flex-wrap justify-end'>
|
||||||
|
<a href="tel:0727177440" className="text-sm text-slate-teal font-mono font-bold bg-seafoam/20 hover:bg-seafoam/40 px-3 py-1.5 rounded-lg transition-colors">072-717 74 40</a>
|
||||||
|
<a href="tel:078389355810605" className="text-sm text-slate-teal font-mono font-bold bg-seafoam/20 hover:bg-seafoam/40 px-3 py-1.5 rounded-lg transition-colors">078-389 35 58 10 605</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
// src/pages/Info.tsx
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
export const JobInfo: React.FC = () => {
|
||||||
|
return (
|
||||||
|
<div className="p-4 max-w-md mx-auto space-y-6">
|
||||||
|
<h1 className="text-2xl font-bold text-green-800">Jobbinfo & Regler</h1>
|
||||||
|
|
||||||
|
<section className="bg-white p-4 rounded-xl shadow-sm border border-gray-100">
|
||||||
|
<h2 className="text-lg font-bold text-gray-800 mb-2">Förväntningar</h2>
|
||||||
|
<p className="text-sm text-gray-600 mb-2">
|
||||||
|
Vi förväntar oss att du tar ansvar, visar respekt för både natur och varandra, samt gör ditt bästa med dina arbetsuppgifter.
|
||||||
|
</p>
|
||||||
|
<ul className="list-disc pl-5 text-sm text-gray-600 space-y-1">
|
||||||
|
<li><strong>Period 1:</strong> Start 23 juni kl 08:10 (Buss station Mölle)</li>
|
||||||
|
<li><strong>Period 2:</strong> Start 7 juli kl 08:10</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section className="bg-white p-4 rounded-xl shadow-sm border border-gray-100">
|
||||||
|
<h2 className="text-lg font-bold text-gray-800 mb-2">Daglig Utrustning</h2>
|
||||||
|
<ul className="list-disc pl-5 text-sm text-gray-600 space-y-2">
|
||||||
|
<li>Bra promenadskor (du kommer gå mycket!)</li>
|
||||||
|
<li>Oömma och väderanpassade kläder</li>
|
||||||
|
<li>En bekväm ryggsäck</li>
|
||||||
|
<li>Egen lunch (ingen tillgång till kyl/mikro)</li>
|
||||||
|
<li>Minst 1 liter vatten</li>
|
||||||
|
<li>Myggmedel & Solkräm</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section className="bg-white p-4 rounded-xl shadow-sm border border-gray-100">
|
||||||
|
<h2 className="text-lg font-bold text-gray-800 mb-2">Exempel på uppgifter</h2>
|
||||||
|
<ul className="list-disc pl-5 text-sm text-gray-600 space-y-1">
|
||||||
|
<li>Parkeringsguide</li>
|
||||||
|
<li>Naturvägledare för besökare</li>
|
||||||
|
<li>Plocka skräp & ta bort invasiva växter</li>
|
||||||
|
<li>Städa anläggningar</li>
|
||||||
|
<li>Allmänt underhåll (olja skyltar, fixa staket)</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,205 @@
|
|||||||
|
// src/pages/Schedule.tsx
|
||||||
|
|
||||||
|
import React, { useRef } from 'react';
|
||||||
|
import scheduleData from '../data/schedule.json';
|
||||||
|
import { Clock, CalendarRange } from 'lucide-react';
|
||||||
|
|
||||||
|
// --- Helper Functions ---
|
||||||
|
|
||||||
|
// Bulletproof parser: Finds the times regardless of spaces or dashes!
|
||||||
|
const parseTimeBlock = (timeStr: string) => {
|
||||||
|
if (!timeStr || timeStr === 'Ledig') return null;
|
||||||
|
|
||||||
|
// Scans the string and extracts any "HH:MM" patterns
|
||||||
|
const matches = timeStr.match(/(\d{1,2}):(\d{2})/g);
|
||||||
|
if (!matches || matches.length < 2) return null;
|
||||||
|
|
||||||
|
const parse = (t: string) => {
|
||||||
|
const [h, m] = t.split(':').map(Number);
|
||||||
|
return h + (m / 60);
|
||||||
|
};
|
||||||
|
|
||||||
|
return { start: parse(matches[0]), end: parse(matches[1]) };
|
||||||
|
};
|
||||||
|
|
||||||
|
// Checks if the two time blocks actually collide
|
||||||
|
const checkOverlap = (time1?: string, time2?: string) => {
|
||||||
|
const t1 = time1 ? parseTimeBlock(time1) : null;
|
||||||
|
const t2 = time2 ? parseTimeBlock(time2) : null;
|
||||||
|
if (!t1 || !t2) return false;
|
||||||
|
|
||||||
|
return t1.start < t2.end && t1.end > t2.start;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// --- Types & Components ---
|
||||||
|
|
||||||
|
interface ShiftData {
|
||||||
|
time: string;
|
||||||
|
title?: string;
|
||||||
|
notes?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ShiftBlockProps {
|
||||||
|
team: 'PF' | 'TU';
|
||||||
|
data: ShiftData;
|
||||||
|
pos: { top: number; height: number };
|
||||||
|
isOverlapping: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reusable Component for the Event Cards
|
||||||
|
const ShiftBlock: React.FC<ShiftBlockProps> = ({ team, data, pos, isOverlapping }) => {
|
||||||
|
const isPF = team === 'PF';
|
||||||
|
|
||||||
|
// Calculate layout based on overlap
|
||||||
|
const widthClasses = isOverlapping
|
||||||
|
? isPF ? "left-1 right-1/2 mr-0.5" : "left-1/2 right-1 ml-0.5"
|
||||||
|
: "left-1 right-1";
|
||||||
|
|
||||||
|
// Team-specific styling
|
||||||
|
const bgClasses = isPF
|
||||||
|
? "bg-gradient-to-br from-ebony to-moss border-moss"
|
||||||
|
: "bg-gradient-to-br from-seafoam to-slate-teal border-slate-teal";
|
||||||
|
|
||||||
|
const textMain = isPF ? "text-eggshell" : "text-eggshell";
|
||||||
|
const textMuted = isPF ? "text-eggshell/80" : "text-eggshell/90";
|
||||||
|
const notesBg = isPF ? "bg-eggshell/30 border-seafoam/5" : "bg-ebony/20 border-eggshell/10";
|
||||||
|
const fallbackTitle = isPF ? "PF" : "TU";
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
// Removed scale on hover! Added brightness-105 for a safe, non-clipping hover effect.
|
||||||
|
className={`absolute ${widthClasses} ${bgClasses} rounded-lg p-1.5 flex flex-col overflow-hidden shadow-sm border cursor-pointer transition-all hover:brightness-105 hover:shadow-md`}
|
||||||
|
style={{ top: `${pos.top}px`, height: `${pos.height}px` }}
|
||||||
|
>
|
||||||
|
<p className={`text-[10px] font-black ${textMain} uppercase tracking-wide leading-tight truncate`}>
|
||||||
|
{data.title || fallbackTitle}
|
||||||
|
</p>
|
||||||
|
<p className={`text-[9px] font-bold ${textMuted} flex items-center mt-0.5 whitespace-nowrap`}>
|
||||||
|
<Clock size={8} className="mr-0.5 shrink-0" />
|
||||||
|
<span className="truncate">{data.time}</span>
|
||||||
|
</p>
|
||||||
|
{data.notes && pos.height > 50 && (
|
||||||
|
<div className={`mt-1 ${notesBg} p-1 rounded-md border`}>
|
||||||
|
<p className={`text-[9px] font-medium ${textMain} leading-tight truncate`}>
|
||||||
|
{data.notes}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// --- Main Schedule View ---
|
||||||
|
|
||||||
|
export const Schedule: React.FC = () => {
|
||||||
|
const startHour = 7;
|
||||||
|
const endHour = 17;
|
||||||
|
const hours = Array.from({ length: endHour - startHour + 1 }, (_, i) => startHour + i);
|
||||||
|
const PIXELS_PER_HOUR = 60;
|
||||||
|
|
||||||
|
const GRID_PADDING_TOP = 24;
|
||||||
|
const TOTAL_GRID_HEIGHT = (hours.length * PIXELS_PER_HOUR) + GRID_PADDING_TOP;
|
||||||
|
|
||||||
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
|
const calculatePosition = (timeStr: string) => {
|
||||||
|
const t = parseTimeBlock(timeStr);
|
||||||
|
if (!t) return null;
|
||||||
|
|
||||||
|
const topOffset = (t.start - startHour) * PIXELS_PER_HOUR;
|
||||||
|
const duration = (t.end - t.start) * PIXELS_PER_HOUR;
|
||||||
|
|
||||||
|
return { top: topOffset + GRID_PADDING_TOP + 1, height: duration - 2 };
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="space-y-4 animate-fade-in w-full">
|
||||||
|
<div>
|
||||||
|
<h1 className="text-3xl font-black text-slate-teal tracking-tight flex items-center">
|
||||||
|
<CalendarRange className="mr-3 text-seafoam" size={32} />
|
||||||
|
Veckoschema
|
||||||
|
</h1>
|
||||||
|
<p className="text-moss font-medium mt-2 ml-11">Här hittar du när vi bemannar Kullaberg.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-eggshell border-2 border-slate-teal/20 rounded-2xl shadow-sm overflow-hidden flex flex-col max-h-[65vh] h-max min-h-125">
|
||||||
|
<div className="flex-1 overflow-auto scrollbar-hide" ref={containerRef}>
|
||||||
|
<div className="flex min-w-200 w-full">
|
||||||
|
|
||||||
|
{/* Sticky Time Column */}
|
||||||
|
<div className="sticky left-0 z-20 w-18 flex-none bg-eggshell border-r-2 border-slate-teal/10 shadow-[2px_0_5px_rgba(0,0,0,0.02)]">
|
||||||
|
<div className="sticky top-0 z-30 h-12 border-b-2 border-slate-teal/10 bg-eggshell"></div>
|
||||||
|
<div className="relative w-full" style={{ height: `${TOTAL_GRID_HEIGHT}px` }}>
|
||||||
|
{hours.map((hour, i) => (
|
||||||
|
<div key={hour} className="absolute w-full flex justify-end pr-3" style={{ top: `${i * PIXELS_PER_HOUR + GRID_PADDING_TOP}px` }}>
|
||||||
|
<span className="text-[11px] font-bold text-slate-teal -mt-2 bg-eggshell px-1">
|
||||||
|
{hour.toString().padStart(2, '0')}:00
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Grid Area */}
|
||||||
|
<div className="flex-auto relative">
|
||||||
|
{/* Sticky Day Headers */}
|
||||||
|
<div className="sticky top-0 z-10 flex h-12 border-b-2 border-slate-teal/10 bg-eggshell">
|
||||||
|
{scheduleData.map((d) => (
|
||||||
|
<div key={d.day} className="flex-1 flex items-center justify-center border-l-2 border-slate-teal/5 first:border-l-0 min-w-25">
|
||||||
|
<span className="text-xs font-black text-ebony uppercase tracking-widest">{d.day.substring(0, 3)}</span>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Main Grid Canvas */}
|
||||||
|
<div className="relative w-full" style={{ height: `${TOTAL_GRID_HEIGHT}px` }}>
|
||||||
|
<div className="absolute inset-0 z-0">
|
||||||
|
{hours.map((hour, i) => (
|
||||||
|
<div key={hour} className="absolute w-full border-t border-slate-teal/10" style={{ top: `${i * PIXELS_PER_HOUR + GRID_PADDING_TOP}px`, height: `${PIXELS_PER_HOUR}px` }} />
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Vertical Columns & Blocks */}
|
||||||
|
<div className="absolute inset-0 flex z-0">
|
||||||
|
{scheduleData.map((d, colIndex) => {
|
||||||
|
// Type casting here assumes scheduleData is typed loosely.
|
||||||
|
const pfData = d.pilgrimsfalkarna as ShiftData | undefined;
|
||||||
|
const tuData = d.tumlarna as ShiftData | undefined;
|
||||||
|
|
||||||
|
const hasPF = !!(pfData && pfData.time && pfData.time !== 'Ledig');
|
||||||
|
const hasTU = !!(tuData && tuData.time && tuData.time !== 'Ledig');
|
||||||
|
const isOverlapping = hasPF && hasTU && checkOverlap(pfData.time, tuData.time);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div key={colIndex} className="flex-1 border-l border-slate-teal/10 relative min-w-25">
|
||||||
|
{/* Pilgrimsfalkarna Component */}
|
||||||
|
{hasPF && (() => {
|
||||||
|
const pos = calculatePosition(pfData.time);
|
||||||
|
return pos ? <ShiftBlock team="PF" data={pfData} pos={pos} isOverlapping={isOverlapping} /> : null;
|
||||||
|
})()}
|
||||||
|
|
||||||
|
{/* Tumlarna Component */}
|
||||||
|
{hasTU && (() => {
|
||||||
|
const pos = calculatePosition(tuData.time);
|
||||||
|
return pos ? <ShiftBlock team="TU" data={tuData} pos={pos} isOverlapping={isOverlapping} /> : null;
|
||||||
|
})()}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Legend */}
|
||||||
|
<div className="flex items-center justify-center space-x-6 py-2 text-xs font-bold text-slate-teal">
|
||||||
|
<span className="flex items-center"><div className="w-3 h-3 bg-linear-to-br from-ebony to-moss rounded-full mr-2 shadow-sm"></div> Pilgrimsfalkarna</span>
|
||||||
|
<span className="flex items-center"><div className="w-3 h-3 bg-linear-to-br from-seafoam to-slate-teal rounded-full mr-2 shadow-sm"></div> Tumlarna</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
// src/vite-env.d.ts
|
||||||
|
|
||||||
|
/// <reference types="vite-plugin-pwa/client" />
|
||||||
|
/// <reference types="vite/client" />
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||||
|
"target": "ES2023",
|
||||||
|
"useDefineForClassFields": true,
|
||||||
|
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
||||||
|
"module": "ESNext",
|
||||||
|
"types": ["vite/client"],
|
||||||
|
"skipLibCheck": true,
|
||||||
|
|
||||||
|
/* Bundler mode */
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"moduleDetection": "force",
|
||||||
|
"noEmit": true,
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
|
||||||
|
/* Linting */
|
||||||
|
"strict": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"erasableSyntaxOnly": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noUncheckedSideEffectImports": true
|
||||||
|
},
|
||||||
|
"include": ["src"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"files": [],
|
||||||
|
"references": [
|
||||||
|
{ "path": "./tsconfig.app.json" },
|
||||||
|
{ "path": "./tsconfig.node.json" }
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||||
|
"target": "ES2023",
|
||||||
|
"lib": ["ES2023"],
|
||||||
|
"module": "ESNext",
|
||||||
|
"types": ["node"],
|
||||||
|
"skipLibCheck": true,
|
||||||
|
|
||||||
|
/* Bundler mode */
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"moduleDetection": "force",
|
||||||
|
"noEmit": true,
|
||||||
|
|
||||||
|
/* Linting */
|
||||||
|
"strict": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"erasableSyntaxOnly": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noUncheckedSideEffectImports": true
|
||||||
|
},
|
||||||
|
"include": ["vite.config.ts"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
// vite.config.ts
|
||||||
|
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
import react from '@vitejs/plugin-react';
|
||||||
|
import tailwindcss from '@tailwindcss/vite'
|
||||||
|
import { VitePWA } from 'vite-plugin-pwa';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
react(),
|
||||||
|
tailwindcss(),
|
||||||
|
VitePWA({
|
||||||
|
registerType: 'autoUpdate',
|
||||||
|
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'mask-icon.svg'],
|
||||||
|
workbox: {
|
||||||
|
globPatterns: ['**/*.{js,css,html,ico,png,svg,json}']
|
||||||
|
},
|
||||||
|
manifest: {
|
||||||
|
name: 'Kullaberg Sommarjobb 2025',
|
||||||
|
short_name: 'Kullaberg',
|
||||||
|
description: 'Info, schema och dokument för naturvägledare på Kullaberg.',
|
||||||
|
theme_color: '#15803d',
|
||||||
|
background_color: '#f9fafb',
|
||||||
|
display: 'standalone',
|
||||||
|
icons: [
|
||||||
|
{
|
||||||
|
src: 'pwa-192x192.png',
|
||||||
|
sizes: '192x192',
|
||||||
|
type: 'image/png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: 'pwa-512x512.png',
|
||||||
|
sizes: '512x512',
|
||||||
|
type: 'image/png',
|
||||||
|
purpose: 'any maskable'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
]
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user