Compare commits
No commits in common. "38f1e1ca41f164f6ca2a2d0c72e960bb993c8b19" and "f929cb0cd8289cb9ee5483a7e0f4f56cd4ec08cf" have entirely different histories.
38f1e1ca41
...
f929cb0cd8
43 changed files with 259 additions and 1233 deletions
Binary file not shown.
Binary file not shown.
|
|
@ -18,7 +18,6 @@ dependencies = [
|
||||||
"feedparser==6.0.14",
|
"feedparser==6.0.14",
|
||||||
"PyJWT==2.15.0",
|
"PyJWT==2.15.0",
|
||||||
"python-dotenv>=1.0.0",
|
"python-dotenv>=1.0.0",
|
||||||
"validators>=0.35.0",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,8 @@ security = HTTPBearer()
|
||||||
|
|
||||||
def get_token(credentials = Security(security)) -> str:
|
def get_token(credentials = Security(security)) -> str:
|
||||||
parts = credentials.credentials.split()
|
parts = credentials.credentials.split()
|
||||||
if parts[0].lower() == "bearer":
|
if len(parts) == 2 and parts[0].lower() == "bearer":
|
||||||
return parts[1]
|
return parts[1]
|
||||||
else:
|
|
||||||
return parts[0]
|
|
||||||
raise HTTPException(status_code=403, detail="Invalid authorization format")
|
raise HTTPException(status_code=403, detail="Invalid authorization format")
|
||||||
|
|
||||||
def decode_token(token: str)-> str | None:
|
def decode_token(token: str)-> str | None:
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ from backend.internal.rss_reader import check_blog_rss_and_send_admin_mail
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
crons = Crons(app)
|
crons = Crons(app)
|
||||||
|
|
||||||
@crons.cron("0 13 * * *", name="RSS-Check")
|
@crons.cron("0 14 * * *", name="RSS-Check")
|
||||||
async def check_for_new_article():
|
async def check_for_new_article():
|
||||||
check_blog_rss_and_send_admin_mail()
|
check_blog_rss_and_send_admin_mail()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
from starlette.status import HTTP_500_INTERNAL_SERVER_ERROR
|
|
||||||
import validators
|
|
||||||
from starlette.status import HTTP_406_NOT_ACCEPTABLE
|
|
||||||
from mailtrap import Address
|
from mailtrap import Address
|
||||||
from backend.internal.mail_util import send_mail
|
from backend.internal.mail_util import send_mail
|
||||||
from backend.internal.mail_util import create_html_from_template
|
from backend.internal.mail_util import create_html_from_template
|
||||||
|
|
@ -38,12 +35,6 @@ router = APIRouter(
|
||||||
def register_user(new_user: NewUser, session: Session = Depends(get_session)):
|
def register_user(new_user: NewUser, session: Session = Depends(get_session)):
|
||||||
user = User.model_validate(new_user)
|
user = User.model_validate(new_user)
|
||||||
|
|
||||||
if (user.name == ''):
|
|
||||||
raise HTTPException(HTTP_406_NOT_ACCEPTABLE, "Nutzername muss einen Wert enthalten")
|
|
||||||
elif(not validators.email(user.email)):
|
|
||||||
raise HTTPException(HTTP_406_NOT_ACCEPTABLE, "Email nicht valide")
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
session.add(user)
|
session.add(user)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
@ -59,13 +50,6 @@ def register_user(new_user: NewUser, session: Session = Depends(get_session)):
|
||||||
|
|
||||||
except IntegrityError as e:
|
except IntegrityError as e:
|
||||||
session.rollback()
|
session.rollback()
|
||||||
|
|
||||||
if ("UNIQUE" in str(e)):
|
|
||||||
if ("user.name" in str(e) or "user.email" in str(e)):
|
|
||||||
raise HTTPException(HTTP_406_NOT_ACCEPTABLE)
|
|
||||||
if ("user.user_code" in str(e)):
|
|
||||||
raise HTTPException(HTTP_500_INTERNAL_SERVER_ERROR)
|
|
||||||
else:
|
|
||||||
raise HTTPException(HTTP_400_BAD_REQUEST)
|
raise HTTPException(HTTP_400_BAD_REQUEST)
|
||||||
except Exception:
|
except Exception:
|
||||||
session.rollback()
|
session.rollback()
|
||||||
|
|
@ -105,17 +89,15 @@ def delete(current_user: User = Depends(get_current_user), session: Session = De
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
|
|
||||||
@router.put(path="/me/subscription", status_code=201)
|
@router.put(path="/me/subscribe", status_code=201)
|
||||||
def change_subscription(
|
def change_subscription(
|
||||||
subscription: bool = Form(),
|
subscription: bool = Form(),
|
||||||
current_user: User = Depends(get_current_user),
|
current_user: User = Depends(get_current_user),
|
||||||
session: Session = Depends(get_session)
|
session: Session = Depends(get_session)
|
||||||
):
|
):
|
||||||
|
|
||||||
current_user.subscription = subscription
|
current_user.subscription = subscription
|
||||||
session.add(current_user)
|
session.add(current_user)
|
||||||
session.commit()
|
session.commit()
|
||||||
session.refresh(current_user)
|
|
||||||
|
|
||||||
|
|
||||||
# TODO:
|
# TODO:
|
||||||
|
|
|
||||||
11
backend/uv.lock
generated
11
backend/uv.lock
generated
|
|
@ -202,7 +202,6 @@ dependencies = [
|
||||||
{ name = "pytest" },
|
{ name = "pytest" },
|
||||||
{ name = "python-dotenv" },
|
{ name = "python-dotenv" },
|
||||||
{ name = "sqlmodel" },
|
{ name = "sqlmodel" },
|
||||||
{ name = "validators" },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[package.metadata]
|
[package.metadata]
|
||||||
|
|
@ -217,7 +216,6 @@ requires-dist = [
|
||||||
{ name = "pytest", specifier = ">=9.1.1" },
|
{ name = "pytest", specifier = ">=9.1.1" },
|
||||||
{ name = "python-dotenv", specifier = ">=1.0.0" },
|
{ name = "python-dotenv", specifier = ">=1.0.0" },
|
||||||
{ name = "sqlmodel", specifier = ">=0.0.42" },
|
{ name = "sqlmodel", specifier = ">=0.0.42" },
|
||||||
{ name = "validators", specifier = ">=0.35.0" },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -1896,15 +1894,6 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/e4/16/c1fd27e9549f3c4baf1dc9c20c456cd2f822dbf8de9f463824b0c0357e06/uvloop-0.22.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6cde23eeda1a25c75b2e07d39970f3374105d5eafbaab2a4482be82f272d5a5e", size = 4296730, upload-time = "2025-10-16T22:17:00.744Z" },
|
{ url = "https://files.pythonhosted.org/packages/e4/16/c1fd27e9549f3c4baf1dc9c20c456cd2f822dbf8de9f463824b0c0357e06/uvloop-0.22.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6cde23eeda1a25c75b2e07d39970f3374105d5eafbaab2a4482be82f272d5a5e", size = 4296730, upload-time = "2025-10-16T22:17:00.744Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "validators"
|
|
||||||
version = "0.35.0"
|
|
||||||
source = { registry = "https://pypi.org/simple" }
|
|
||||||
sdist = { url = "https://files.pythonhosted.org/packages/53/66/a435d9ae49850b2f071f7ebd8119dd4e84872b01630d6736761e6e7fd847/validators-0.35.0.tar.gz", hash = "sha256:992d6c48a4e77c81f1b4daba10d16c3a9bb0dbb79b3a19ea847ff0928e70497a", size = 73399, upload-time = "2025-05-01T05:42:06.7Z" }
|
|
||||||
wheels = [
|
|
||||||
{ url = "https://files.pythonhosted.org/packages/fa/6e/3e955517e22cbdd565f2f8b2e73d52528b14b8bcfdb04f62466b071de847/validators-0.35.0-py3-none-any.whl", hash = "sha256:e8c947097eae7892cb3d26868d637f79f47b4a0554bc6b80065dfe5aac3705dd", size = 44712, upload-time = "2025-05-01T05:42:04.203Z" },
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "watchfiles"
|
name = "watchfiles"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
// @ts-check
|
// @ts-check
|
||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from 'astro/config';
|
||||||
import mdx from '@astrojs/mdx';
|
import mdx from '@astrojs/mdx';
|
||||||
import preact from '@astrojs/preact';
|
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
|
@ -10,5 +9,5 @@ export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
assets: '_assets',
|
assets: '_assets',
|
||||||
},
|
},
|
||||||
integrations: [mdx(), preact()]
|
integrations: [mdx()]
|
||||||
});
|
});
|
||||||
|
|
|
||||||
95
blog/package-lock.json
generated
95
blog/package-lock.json
generated
|
|
@ -8,14 +8,10 @@
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/mdx": "^7.0.8",
|
"@astrojs/mdx": "^7.0.8",
|
||||||
"@astrojs/preact": "^6.0.5",
|
"@astrojs/preact": "^6.0.2",
|
||||||
"@astrojs/rss": "^4.0.19",
|
"@astrojs/rss": "^4.0.19",
|
||||||
"astro": "^7.2.2",
|
"astro": "^7.2.2",
|
||||||
"jwt-decode": "^4.0.0",
|
"preact": "^10.29.0"
|
||||||
"preact": "^10.29.8"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/jsonwebtoken": "^9.0.10"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22.12.0"
|
"node": ">=22.12.0"
|
||||||
|
|
@ -210,9 +206,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@astrojs/internal-helpers": {
|
"node_modules/@astrojs/internal-helpers": {
|
||||||
"version": "0.11.0",
|
"version": "0.10.2",
|
||||||
"resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.11.0.tgz",
|
"resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.10.2.tgz",
|
||||||
"integrity": "sha512-3rzxJ+xbo0+8YyqOzLziIN32wmsHdCjEVz2sGOpRxJ+Ben/KiLph4ItxBy1abEL+E8fkRzqjg0rfXmaHJGw9JA==",
|
"integrity": "sha512-yt7fMgPYqSM4Tmr+taTW6Per+hjJ8Pk6lA1PAcDyqzOt8HzJ6Kje5WzCxA2Sd+9wsUW7uhkLeoTMK0cXPwH9rQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/hast": "^3.0.4",
|
"@types/hast": "^3.0.4",
|
||||||
|
|
@ -301,12 +297,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@astrojs/preact": {
|
"node_modules/@astrojs/preact": {
|
||||||
"version": "6.0.5",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@astrojs/preact/-/preact-6.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@astrojs/preact/-/preact-6.0.2.tgz",
|
||||||
"integrity": "sha512-ONNVrPUM3PxEGJ0Z1MseRRXn0MCirTxEzH84ZUphD8WoR2WOvgHAf4C/0RVc4dmJigytHG3UFg+hsZd/oFz03w==",
|
"integrity": "sha512-OoV/1KeGpRU8f9a+jBk2q2GK05jqjnRg7H+ZN8i48FBKrLJQj+4nU/Vg+JSsvhZ9PZtku0kS2vyFBJ8SGXoTiQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/internal-helpers": "0.11.0",
|
"@astrojs/internal-helpers": "0.10.2",
|
||||||
"@preact/preset-vite": "^2.10.5",
|
"@preact/preset-vite": "^2.10.5",
|
||||||
"@preact/signals": "^2.8.2",
|
"@preact/signals": "^2.8.2",
|
||||||
"devalue": "^5.8.1",
|
"devalue": "^5.8.1",
|
||||||
|
|
@ -2411,17 +2407,6 @@
|
||||||
"@types/unist": "*"
|
"@types/unist": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/jsonwebtoken": {
|
|
||||||
"version": "9.0.10",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.10.tgz",
|
|
||||||
"integrity": "sha512-asx5hIG9Qmf/1oStypjanR7iKTv0gXQ1Ov/jfrX6kS/EO0OFni8orbmGCn0672NHR3kXHwpAwR+B368ZGN/2rA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@types/ms": "*",
|
|
||||||
"@types/node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@types/mdast": {
|
"node_modules/@types/mdast": {
|
||||||
"version": "4.0.4",
|
"version": "4.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
|
||||||
|
|
@ -2452,16 +2437,6 @@
|
||||||
"@types/unist": "*"
|
"@types/unist": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
|
||||||
"version": "26.6.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.4.tgz",
|
|
||||||
"integrity": "sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg==",
|
|
||||||
"devOptional": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"undici-types": "~8.9.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@types/unist": {
|
"node_modules/@types/unist": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
|
||||||
|
|
@ -2662,6 +2637,22 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/astro/node_modules/@astrojs/internal-helpers": {
|
||||||
|
"version": "0.11.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.11.0.tgz",
|
||||||
|
"integrity": "sha512-3rzxJ+xbo0+8YyqOzLziIN32wmsHdCjEVz2sGOpRxJ+Ben/KiLph4ItxBy1abEL+E8fkRzqjg0rfXmaHJGw9JA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/hast": "^3.0.4",
|
||||||
|
"@types/mdast": "^4.0.4",
|
||||||
|
"js-yaml": "^4.3.0",
|
||||||
|
"picomatch": "^4.0.4",
|
||||||
|
"retext-smartypants": "^6.2.0",
|
||||||
|
"shiki": "^4.0.2",
|
||||||
|
"smol-toml": "^1.6.0",
|
||||||
|
"unified": "^11.0.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/astro/node_modules/@astrojs/markdown-satteri": {
|
"node_modules/astro/node_modules/@astrojs/markdown-satteri": {
|
||||||
"version": "0.4.1",
|
"version": "0.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/@astrojs/markdown-satteri/-/markdown-satteri-0.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@astrojs/markdown-satteri/-/markdown-satteri-0.4.1.tgz",
|
||||||
|
|
@ -4023,9 +4014,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/http-cache-semantics": {
|
"node_modules/http-cache-semantics": {
|
||||||
"version": "4.3.0",
|
"version": "4.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz",
|
||||||
"integrity": "sha512-M5t5LlJpS1UHMjvwRQVdFHvPISGeLAxNcrWuJkeGh0KxsqCHZ1O3NXZU/8x7cD0BDcGW8kapxMKTvwlqrNkHkA==",
|
"integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==",
|
||||||
"license": "BSD-2-Clause"
|
"license": "BSD-2-Clause"
|
||||||
},
|
},
|
||||||
"node_modules/inline-style-parser": {
|
"node_modules/inline-style-parser": {
|
||||||
|
|
@ -4172,15 +4163,6 @@
|
||||||
"integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==",
|
"integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/jwt-decode": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/kolorist": {
|
"node_modules/kolorist": {
|
||||||
"version": "1.8.0",
|
"version": "1.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.8.0.tgz",
|
||||||
|
|
@ -5848,21 +5830,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/preact": {
|
"node_modules/preact": {
|
||||||
"version": "10.29.8",
|
"version": "10.29.2",
|
||||||
"resolved": "https://registry.npmjs.org/preact/-/preact-10.29.8.tgz",
|
"resolved": "https://registry.npmjs.org/preact/-/preact-10.29.2.tgz",
|
||||||
"integrity": "sha512-ej2aVZ+vZ8WO7tvlQWRM9N63A0KzF9q4mWJfDUHgYaIofWY9hu74QdnQrjoPMmZi2/nZ5gN0bJCQF49xQqx09Q==",
|
"integrity": "sha512-7tNmwg/7mzzAoB/8kSg6Hl37JraAZw3Z3A0JSY7VXlZwo82Xn0G7wKbNNs2qoF4ZEEsQGTwDAroNdqKs1ofJxQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
"url": "https://opencollective.com/preact"
|
"url": "https://opencollective.com/preact"
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"preact-render-to-string": ">=5"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"preact-render-to-string": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/preact-render-to-string": {
|
"node_modules/preact-render-to-string": {
|
||||||
|
|
@ -6603,13 +6577,6 @@
|
||||||
"node": ">=22.19.0"
|
"node": ">=22.19.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici-types": {
|
|
||||||
"version": "8.9.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
|
|
||||||
"integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
|
|
||||||
"devOptional": true,
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/unified": {
|
"node_modules/unified": {
|
||||||
"version": "11.0.5",
|
"version": "11.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz",
|
||||||
|
|
|
||||||
|
|
@ -13,13 +13,9 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/mdx": "^7.0.8",
|
"@astrojs/mdx": "^7.0.8",
|
||||||
"@astrojs/preact": "^6.0.5",
|
"@astrojs/preact": "^6.0.2",
|
||||||
"@astrojs/rss": "^4.0.19",
|
"@astrojs/rss": "^4.0.19",
|
||||||
"astro": "^7.2.2",
|
"astro": "^7.2.2",
|
||||||
"jwt-decode": "^4.0.0",
|
"preact": "^10.29.0"
|
||||||
"preact": "^10.29.8"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/jsonwebtoken": "^9.0.10"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
blog/src/components/BackNav.astro
Normal file
14
blog/src/components/BackNav.astro
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
---
|
||||||
|
---
|
||||||
|
|
||||||
|
<a href={Astro.request.headers.get('referer') || '/'}>
|
||||||
|
<button class="rounded">zurück</button>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
button {
|
||||||
|
padding: 12px 24px;
|
||||||
|
margin: 8px 0 16px 0px;
|
||||||
|
border-style: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,20 +1,19 @@
|
||||||
---
|
---
|
||||||
import UserAction from "../islands/UserAction";
|
|
||||||
import Logo from "./Logo.astro";
|
import Logo from "./Logo.astro";
|
||||||
---
|
---
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<div class="only-mobile">
|
|
||||||
<Logo />
|
<Logo />
|
||||||
</div>
|
|
||||||
<nav>
|
<nav>
|
||||||
|
<div class="nav-left">
|
||||||
<Logo />
|
<Logo />
|
||||||
<div id="user-action">
|
<a href="/">Startseite</a>
|
||||||
<UserAction client:load />
|
</div>
|
||||||
|
<div class="nav-right">
|
||||||
|
<a href="/impressum" style="#789">Impressum</a>
|
||||||
|
<a href="/privacy-policy" style="#789">Datenschutz</a>
|
||||||
</div>
|
</div>
|
||||||
<a id="startseite" href="/" class="only-mobile menu-nav">Startseite</a>
|
|
||||||
<a id="impressum" href="/impressum" class="menu-nav">Impressum</a>
|
|
||||||
<a id="datenschutz" href="/privacy-policy" class="menu-nav">Datenschutz</a>
|
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<input type="checkbox" id="menu-toggle" class="menu-icon" />
|
<input type="checkbox" id="menu-toggle" class="menu-icon" />
|
||||||
|
|
@ -31,31 +30,38 @@ import Logo from "./Logo.astro";
|
||||||
color: var(--primary-text);
|
color: var(--primary-text);
|
||||||
}
|
}
|
||||||
|
|
||||||
nav {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#user-action {
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
header {
|
header {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 16px 32px;
|
padding: 32px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nav {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--primary-text);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
#menu-toggle,
|
#menu-toggle,
|
||||||
.menu-icon,
|
.menu-icon,
|
||||||
.menu-backdrop,
|
.menu-backdrop,
|
||||||
.only-mobile {
|
.nav-left {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,30 +70,6 @@ import Logo from "./Logo.astro";
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.only-mobile {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
#startseite {
|
|
||||||
order: 1;
|
|
||||||
margin-top: 32px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
#user-action {
|
|
||||||
margin: 0;
|
|
||||||
order: 2;
|
|
||||||
margin-bottom: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#impressum {
|
|
||||||
order: 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
#datenschutz {
|
|
||||||
order: 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-icon {
|
.menu-icon {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
@ -102,6 +84,10 @@ import Logo from "./Logo.astro";
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mobile-nav {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
nav {
|
nav {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
@ -109,22 +95,35 @@ import Logo from "./Logo.astro";
|
||||||
width: 66vw;
|
width: 66vw;
|
||||||
min-width: 320px;
|
min-width: 320px;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
padding: 32px 0 32px 32px;
|
padding: 32px 0 0 32px;
|
||||||
background: var(--primary-color);
|
background: var(--primary-color);
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
|
|
||||||
transform: translateX(-100%);
|
transform: translateX(-100%);
|
||||||
transition: transform 0.3s ease;
|
transition: transform 0.3s ease;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
|
||||||
* {
|
a {
|
||||||
color: white;
|
color: whitesmoke;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-left,
|
||||||
|
.nav-right {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-left {
|
||||||
|
gap: 32px;
|
||||||
|
margin-bottom: 64px;
|
||||||
|
}
|
||||||
|
|
||||||
nav:has(~ #menu-toggle:checked) {
|
nav:has(~ #menu-toggle:checked) {
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
|
@ -133,7 +132,10 @@ import Logo from "./Logo.astro";
|
||||||
display: block;
|
display: block;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
background: var(--background);
|
background: rgba(0, 0, 0, 0.25);
|
||||||
|
backdrop-filter: blur(6px);
|
||||||
|
-webkit-backdrop-filter: blur(6px);
|
||||||
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
@ -149,4 +151,8 @@ import Logo from "./Logo.astro";
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vertical-line {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,10 @@ const { posts } = Astro.props;
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.post-grid {
|
.post-grid {
|
||||||
display: grid;
|
padding: 24px 24px;
|
||||||
gap: 64px;
|
display: flex;
|
||||||
|
gap: 32px;
|
||||||
|
flex-wrap: wrap;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -11,28 +11,27 @@ interface Props {
|
||||||
const { post } = Astro.props;
|
const { post } = Astro.props;
|
||||||
|
|
||||||
const img = findImageByPath(post.image.path);
|
const img = findImageByPath(post.image.path);
|
||||||
const localeDate = formatLocalizedDateString(post.date);
|
const localeDate = formatLocalizedDateString(post.date)
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="wide-container">
|
<div class="wide-container">
|
||||||
<div class="image-col rounded">
|
<div class="image-col col rounded">
|
||||||
<a href={`/blog/${post.slug}`}>
|
<a href={`/blog/${post.slug}`}>
|
||||||
<Image src={img} alt={post.image.alt} layout="constrained" />
|
<Image src={img} alt={post.image.alt} layout="constrained" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-col">
|
<div class="text-col col">
|
||||||
|
<a href={`/blog/${post.slug}`} class="headline-link">
|
||||||
|
<h2 class="headline">{post.title}</h2>
|
||||||
|
</a>
|
||||||
|
<h7>{post.subtitle}</h7>
|
||||||
<div class="top-info">
|
<div class="top-info">
|
||||||
<span id="new">NEU!</span>
|
|
||||||
<span>{localeDate}</span>
|
<span>{localeDate}</span>
|
||||||
<span> | </span>
|
<span class="vertical-line"></span>
|
||||||
<span>Autor: {post.author}</span>
|
<span>Autor: {post.author}</span>
|
||||||
<span> | </span>
|
<span class="vertical-line"></span>
|
||||||
<span>Lesezeit: {post.time2read} min</span>
|
<span>Lesezeit: {post.time2read} min</span>
|
||||||
</div>
|
</div>
|
||||||
<a href={`/blog/${post.slug}`} class="headline-link">
|
|
||||||
<h1 id="headline">{post.title}</h1>
|
|
||||||
<h2 id="subtitle">{post.subtitle}</h2>
|
|
||||||
</a>
|
|
||||||
<p class="description">{post.description}</p>
|
<p class="description">{post.description}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -41,24 +40,23 @@ const localeDate = formatLocalizedDateString(post.date);
|
||||||
.wide-container {
|
.wide-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 32px;
|
gap: 32px;
|
||||||
padding: 48px 64px;
|
padding: 0 32px;
|
||||||
width: 100%;
|
min-width: 80%;
|
||||||
background-image: linear-gradient(
|
max-width: 90%;
|
||||||
to bottom,
|
margin-bottom: 64px;
|
||||||
var(--primary-dark),
|
|
||||||
var(--primary-color)
|
|
||||||
);
|
|
||||||
|
|
||||||
* {
|
|
||||||
color: white;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.col {
|
||||||
|
width: 50%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
min-width: 0;
|
||||||
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-col {
|
.text-col {
|
||||||
width: 50%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: flex-start;
|
||||||
|
margin: 32px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
|
|
@ -66,32 +64,24 @@ const localeDate = formatLocalizedDateString(post.date);
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-col {
|
.image-col {
|
||||||
width: 50%;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-col img {
|
.image-col img {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
max-height: 300px;
|
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: center;
|
object-position: center;
|
||||||
border: 2px solid white;
|
|
||||||
border-radius: 12px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-info {
|
.top-info {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
color: grey;
|
margin: 16px 0;
|
||||||
padding: 8px 0 0 0;
|
font-size: 1.125rem;
|
||||||
font-size: 1.2rem;
|
color: lightslategray;
|
||||||
}
|
|
||||||
|
|
||||||
#new {
|
|
||||||
color: var(--accent-color);
|
|
||||||
margin-right: 12px;
|
|
||||||
font-weight: bolder;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.vertical-line {
|
.vertical-line {
|
||||||
|
|
@ -100,37 +90,19 @@ const localeDate = formatLocalizedDateString(post.date);
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#headline,
|
|
||||||
#subtitle {
|
|
||||||
font-weight: bold;
|
|
||||||
margin: 8px 0 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.description {
|
|
||||||
font-size: 1.2rem;
|
|
||||||
line-height: 1.4;
|
|
||||||
margin: 8px 0 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 800px) {
|
@media only screen and (max-width: 800px) {
|
||||||
.wide-container {
|
.wide-container {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0;
|
gap: 0;
|
||||||
min-width: auto;
|
min-width: auto;
|
||||||
padding: 32px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-col,
|
.col {
|
||||||
.image-col {
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-col img {
|
.image-col img {
|
||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-info {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -9,57 +9,44 @@ interface Props {
|
||||||
|
|
||||||
const { post } = Astro.props;
|
const { post } = Astro.props;
|
||||||
|
|
||||||
const img = findImageByPath(post.image.path);
|
const img = findImageByPath(post.image.path)
|
||||||
const localeDate = formatLocalizedDateString(post.date);
|
const localeDate = formatLocalizedDateString(post.date)
|
||||||
---
|
---
|
||||||
|
|
||||||
<a href={`/blog/${post.slug}`} class="no-link-link">
|
<a href={`/blog/${post.slug}`} class="no-link-link">
|
||||||
<div class="frame rounded">
|
<div class="frame rounded">
|
||||||
<img src={img.src} alt={post.image.alt} class="rounded" />
|
<img src={img.src} alt={post.image.alt} class="rounded" />
|
||||||
<div id="info">
|
<h2 class="headline">{post.title}</h2>
|
||||||
<span>{localeDate}</span>
|
<h7 class="subtitle">{post.subtitle}</h7>
|
||||||
<span> | </span>
|
<p>Lesezeit: {post.time2read} min</p>
|
||||||
<span>Author: {post.author}</span>
|
|
||||||
<span> | </span>
|
|
||||||
<span>Lesezeit: {post.time2read} min</span>
|
|
||||||
</div>
|
|
||||||
<h1 class="headline">{post.title}</h1>
|
|
||||||
<h2 class="subtitle">{post.subtitle}</h2>
|
|
||||||
<p class="description">{post.description}</p>
|
<p class="description">{post.description}</p>
|
||||||
|
<div class="bottom-info">
|
||||||
|
<span>Author: {post.author}</span>
|
||||||
|
<span>{localeDate}</span>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.frame {
|
.frame {
|
||||||
|
flex: 220px; auto 0 0;
|
||||||
|
padding: 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
border: 1px solid black;
|
||||||
|
width: 240px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
height: 200px;
|
height: 150px;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: center;
|
object-position: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
#info {
|
.bottom-info {
|
||||||
padding: 8px 0 0 0;
|
display: flex;
|
||||||
font-size: 1.2rem;
|
justify-content: space-between;
|
||||||
* {
|
margin-top: auto;
|
||||||
color: grey;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.headline,
|
|
||||||
.subtitle {
|
|
||||||
color: var(--primary-color);
|
|
||||||
font-weight: bold;
|
|
||||||
margin: 8px 0 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
font-size: 1.2rem;
|
|
||||||
line-height: 1.4;
|
|
||||||
margin: 8px 0 0 0;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</a>
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ const postSchema = z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
subtitle: z.string(),
|
subtitle: z.string(),
|
||||||
description: z.string(),
|
description: z.string(),
|
||||||
introduction: z.string(),
|
|
||||||
image: z.object({
|
image: z.object({
|
||||||
path: z.string(),
|
path: z.string(),
|
||||||
alt: z.string()
|
alt: z.string()
|
||||||
|
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
||||||
import { useState } from "preact/hooks";
|
|
||||||
import { api } from "../lib/api";
|
|
||||||
import { logout } from "./Util";
|
|
||||||
import type { JSX } from "preact/jsx-runtime";
|
|
||||||
import { navigate } from "astro/virtual-modules/transitions-router.js";
|
|
||||||
|
|
||||||
export default function DeleteUser() {
|
|
||||||
const [error, setError] = useState('');
|
|
||||||
const [showModal, setShowModal] = useState(false);
|
|
||||||
|
|
||||||
const handleClick = async (e: JSX.TargetedEvent<HTMLButtonElement>) => {
|
|
||||||
e.preventDefault();
|
|
||||||
setError('');
|
|
||||||
let hasError = false
|
|
||||||
|
|
||||||
try {
|
|
||||||
await api.deleteUser()
|
|
||||||
} catch (err) {
|
|
||||||
setError(err instanceof Error ? err.message : 'Löschen hat nicht geklappt');
|
|
||||||
hasError = true
|
|
||||||
} finally {
|
|
||||||
if (!hasError) {
|
|
||||||
logout()
|
|
||||||
navigate("/")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<button onClick={() => setShowModal(true)} className="back-btn">
|
|
||||||
Löschen
|
|
||||||
</button>
|
|
||||||
{error && <p style={{ color: 'red' }}>{error}</p>}
|
|
||||||
|
|
||||||
{showModal && (
|
|
||||||
<div id="modal" style={{
|
|
||||||
position: 'fixed',
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
bottom: 0,
|
|
||||||
width: '100%',
|
|
||||||
height: '100%',
|
|
||||||
backgroundColor: 'var(--background)',
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
zIndex: 1000
|
|
||||||
}}>
|
|
||||||
<div class="rounded" style={{
|
|
||||||
backgroundColor: 'white',
|
|
||||||
padding: '30px',
|
|
||||||
textAlign: 'left',
|
|
||||||
maxWidth: '500px'
|
|
||||||
}}>
|
|
||||||
<h2>Nutzerkonto löschen</h2>
|
|
||||||
<p>Möchtest du dein Nutzerkonto wirklich löschen?</p>
|
|
||||||
{error && <p style={{ color: 'red' }}>{error}</p>}
|
|
||||||
<div style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between'
|
|
||||||
}}>
|
|
||||||
<button class="back-btn" onClick={() => setShowModal(false)}>
|
|
||||||
Abbrechen
|
|
||||||
</button>
|
|
||||||
<button class="submit-btn" onClick={handleClick}>Ja, löschen</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<style>{`
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
#modal {
|
|
||||||
p, h2, .back-btn {
|
|
||||||
color: var(--primary-text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`}</style>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,76 +0,0 @@
|
||||||
import { useEffect, useState } from 'preact/hooks';
|
|
||||||
import { api, AUTH_TOKEN_KEY, USER_KEY, type User } from '../lib/api';
|
|
||||||
import { saveUser } from './Util';
|
|
||||||
|
|
||||||
export default function LoginForm() {
|
|
||||||
const [userCode, setUserCode] = useState('');
|
|
||||||
const [error, setError] = useState('');
|
|
||||||
|
|
||||||
const handleLogin = async () => {
|
|
||||||
setError('');
|
|
||||||
let hasError = false;
|
|
||||||
if (userCode == '') {
|
|
||||||
setError("Musst schon was eingeben!")
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
const jwt = await api.login(userCode);
|
|
||||||
localStorage.setItem(AUTH_TOKEN_KEY, jwt);
|
|
||||||
|
|
||||||
const user = await api.getUserInfo()
|
|
||||||
saveUser(user)
|
|
||||||
} catch (err) {
|
|
||||||
const errorMessage = err instanceof Error ? err.message : 'Unbekannter Fehler';
|
|
||||||
if (errorMessage.includes('Network')) {
|
|
||||||
setError("Backend nicht erreichbar")
|
|
||||||
} else if (errorMessage.includes('401')) {
|
|
||||||
setError("Das war leider nicht richtig")
|
|
||||||
} else if (errorMessage.includes('422')) {
|
|
||||||
setError("Musst schon was eingeben!")
|
|
||||||
} else if (errorMessage.includes('429')) {
|
|
||||||
setError("Timeout! Warte mal ein bisschen")
|
|
||||||
} else {
|
|
||||||
setError(errorMessage)
|
|
||||||
}
|
|
||||||
hasError = true
|
|
||||||
} finally {
|
|
||||||
if (!hasError) navigation.back()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
window.addEventListener('submit-login', handleLogin);
|
|
||||||
return () => window.removeEventListener('submit-login', handleLogin);
|
|
||||||
}, [userCode]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<form onSubmit={(e) => { e.preventDefault(); handleLogin(); }}>
|
|
||||||
<label>Code: </label>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
value={userCode}
|
|
||||||
onChange={(e) => {
|
|
||||||
setError('')
|
|
||||||
setUserCode(e.currentTarget.value)
|
|
||||||
}}
|
|
||||||
required
|
|
||||||
class="user-input"
|
|
||||||
/>
|
|
||||||
{error && <p style={{ color: 'red' }}>{error}</p>}
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<style>{`
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
main * {
|
|
||||||
color: white;
|
|
||||||
|
|
||||||
input {
|
|
||||||
color: var(--primary-text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`}</style>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
export default function NavBack() {
|
|
||||||
|
|
||||||
function take_me_to_the_moon() {
|
|
||||||
navigation.back();
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<button class="back-btn" onClick={take_me_to_the_moon}>Zurück</button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
import { useEffect, useState } from 'preact/hooks';
|
|
||||||
import { api, type User } from '../lib/api';
|
|
||||||
import React from 'preact/compat';
|
|
||||||
import { isEmailValid } from './Util';
|
|
||||||
|
|
||||||
export default function RegisterForm() {
|
|
||||||
const [user, setUser] = React.useState<User>({ 'email': '', 'name': '', 'subscription': true });
|
|
||||||
const [error, setError] = useState('');
|
|
||||||
|
|
||||||
const handleRegistration = async () => {
|
|
||||||
setError('');
|
|
||||||
let hasError = false
|
|
||||||
|
|
||||||
try {
|
|
||||||
await api.register(user);
|
|
||||||
} catch (err) {
|
|
||||||
const errorMessage = err instanceof Error ? err.message : 'Unbekannter Fehler';
|
|
||||||
|
|
||||||
if (errorMessage.includes('Network')) {
|
|
||||||
setError("Backend nicht erreichbar")
|
|
||||||
} else if (errorMessage.includes('406') && user.name == '') {
|
|
||||||
setError("Der Name darf nicht leer sein")
|
|
||||||
} else if (errorMessage.includes('406') && !isEmailValid(user.email)) {
|
|
||||||
setError("Trage eine gültige E-Mail Adresse ein")
|
|
||||||
} else if (errorMessage.includes('406')) {
|
|
||||||
setError("Nutzername oder E-Mail Adresse bereits registriert")
|
|
||||||
} else if (errorMessage.includes('429')) {
|
|
||||||
setError("Timeout! Warte mal ein bisschen")
|
|
||||||
} else {
|
|
||||||
setError(errorMessage)
|
|
||||||
}
|
|
||||||
hasError = true
|
|
||||||
} finally {
|
|
||||||
if (!hasError) navigation.back()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
window.addEventListener('submit-register', handleRegistration);
|
|
||||||
return () => window.removeEventListener('submit-register', handleRegistration);
|
|
||||||
}, [user.name, user.email, user.subscription]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<form onSubmit={(e) => { e.preventDefault(); handleRegistration(); }} style="display: flex; flex-direction: column;" >
|
|
||||||
<div>
|
|
||||||
<label>Nutzername: </label>
|
|
||||||
<input
|
|
||||||
type="name"
|
|
||||||
value={user.name}
|
|
||||||
onChange={e => setUser({ ...user, name: e.currentTarget.value })}
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label>E-Mail Adresse: </label>
|
|
||||||
<input
|
|
||||||
type="email"
|
|
||||||
value={user.email}
|
|
||||||
onChange={e => setUser({ ...user, email: e.currentTarget.value })}
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
checked={user.subscription}
|
|
||||||
onChange={e => setUser({ ...user, subscription: e.currentTarget.checked })}
|
|
||||||
/>
|
|
||||||
<label>E-Mail Benachrichtigung für neue Artikel erhalten</label>
|
|
||||||
</div>
|
|
||||||
<span style="font-size: 0.8rem">Du kannst deine Daten jederzeit löschen oder die E-Mail Benachrichtigung deaktivieren.</span>
|
|
||||||
{error && <p style={{ color: 'red' }}>{error}</p>}
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<style>{`
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
main * {
|
|
||||||
color: white;
|
|
||||||
|
|
||||||
input {
|
|
||||||
color: var(--primary-text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`}</style>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
import { useEffect, useState } from 'preact/hooks';
|
|
||||||
import { api, type User } from '../lib/api';
|
|
||||||
import React from 'preact/compat';
|
|
||||||
import { getUser, saveUser } from './Util';
|
|
||||||
|
|
||||||
export default function ToggleSubscription() {
|
|
||||||
const [subscription, setSubscription] = React.useState<boolean>(false);
|
|
||||||
const [error, setError] = useState('');
|
|
||||||
let user: User | null = null
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
user = getUser()
|
|
||||||
if (!user) navigation.back()
|
|
||||||
else setSubscription(user.subscription)
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleSubscription = async () => {
|
|
||||||
setError('');
|
|
||||||
let hasError = false
|
|
||||||
|
|
||||||
try {
|
|
||||||
api.toggleSubscription(subscription)
|
|
||||||
} catch (err) {
|
|
||||||
setError(err instanceof Error ? err.message : 'Update fehlgeschlagen');
|
|
||||||
hasError = true
|
|
||||||
console.log(hasError);
|
|
||||||
} finally {
|
|
||||||
if (!hasError) {
|
|
||||||
if (user) {
|
|
||||||
user = {...user, subscription: false }
|
|
||||||
saveUser(user)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
window.addEventListener('submit-toggle-subscription', handleSubscription);
|
|
||||||
return () => window.removeEventListener('submit-toggle-subscription', handleSubscription);
|
|
||||||
}, [subscription]);
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div style={{
|
|
||||||
marginBottom: '16px'
|
|
||||||
}}>
|
|
||||||
<form onSubmit={handleSubscription}>
|
|
||||||
<div>
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
checked={subscription}
|
|
||||||
onChange={e => { setSubscription(e.currentTarget.checked) }}
|
|
||||||
/>
|
|
||||||
<label> E-Mail Benachrichtigungen erhalten</label>
|
|
||||||
</div>
|
|
||||||
{error && <p style={{ color: 'red' }}>{error}</p>}
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
import { useEffect } from "preact/hooks"
|
|
||||||
import { checkJWTValidity, getUser } from "./Util"
|
|
||||||
import React from "preact/compat";
|
|
||||||
import type { User } from "../lib/api";
|
|
||||||
|
|
||||||
export default function UserAction() {
|
|
||||||
const [user, setUser] = React.useState<User>();
|
|
||||||
|
|
||||||
let text = "⚓︎ Login"
|
|
||||||
let link = "/login"
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
checkJWTValidity()
|
|
||||||
const user = getUser()
|
|
||||||
if (user) setUser(user)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
if (user) {
|
|
||||||
text = `⚓︎ ${user.name}`
|
|
||||||
link = "/user"
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<a
|
|
||||||
href={link}
|
|
||||||
class="menu-nav"
|
|
||||||
style="font-weight: bolder;">
|
|
||||||
{text}
|
|
||||||
</a>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
import React, { useEffect } from "preact/compat";
|
|
||||||
import { getUser } from "./Util"
|
|
||||||
import type { User } from "../lib/api";
|
|
||||||
|
|
||||||
export default function UserDetails() {
|
|
||||||
const [user, setUser] = React.useState<User>({ 'email': '', 'name': '', 'subscription': true });
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const user = getUser()
|
|
||||||
if (user) setUser(user)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div id="container" style="display: flex; flex-direction: column; gap: 16px">
|
|
||||||
<span >Nutzername: {user?.name}</span>
|
|
||||||
<span style={{
|
|
||||||
margin: '0 0 16px 0'
|
|
||||||
}}>E-Mail Adresse: {user?.email}</span>
|
|
||||||
<style>{`
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
* {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`}</style>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
import { jwtDecode } from "jwt-decode"
|
|
||||||
import { AUTH_TOKEN_KEY, USER_KEY, type User } from "../lib/api"
|
|
||||||
|
|
||||||
export function saveUser(user: User) {
|
|
||||||
localStorage.setItem(USER_KEY, JSON.stringify(user))
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getUser(): User | null {
|
|
||||||
checkJWTValidity()
|
|
||||||
|
|
||||||
const user_string = localStorage.getItem(USER_KEY)
|
|
||||||
if (user_string) return JSON.parse(user_string) as User
|
|
||||||
else logout()
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
export function logout() {
|
|
||||||
localStorage.removeItem(USER_KEY)
|
|
||||||
localStorage.removeItem(AUTH_TOKEN_KEY)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isEmailValid(email: string): boolean {
|
|
||||||
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
||||||
return emailRegex.test(email);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function checkJWTValidity() {
|
|
||||||
const token = localStorage.getItem(AUTH_TOKEN_KEY)
|
|
||||||
if (!token || isTokenExpired(token)) {
|
|
||||||
logout()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isTokenExpired(token: string): boolean {
|
|
||||||
try {
|
|
||||||
const { exp } = jwtDecode<{ exp: number }>(token)
|
|
||||||
const expirationDatetimeInSeconds = exp * 1000
|
|
||||||
return Date.now() >= expirationDatetimeInSeconds
|
|
||||||
} catch {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
import jwt from 'jsonwebtoken';
|
|
||||||
|
|
||||||
const isTokenExpired = (token: string): boolean => {
|
|
||||||
try {
|
|
||||||
const { exp } = jwt.decode(token) as { exp: number };
|
|
||||||
const expirationDatetimeInSeconds = exp * 1000;
|
|
||||||
return Date.now() >= expirationDatetimeInSeconds;
|
|
||||||
} catch {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export { isTokenExpired };
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
---
|
---
|
||||||
import { Image } from "astro:assets";
|
import { Image } from "astro:assets";
|
||||||
|
import BackNav from "../components/BackNav.astro";
|
||||||
import { findImageByPath } from "../lib/findImage";
|
import { findImageByPath } from "../lib/findImage";
|
||||||
import Main from "./Main.astro";
|
import Main from "./Main.astro";
|
||||||
import { formatLocalizedDateString } from "../lib/formatDate";
|
import { formatLocalizedDateString } from "../lib/formatDate";
|
||||||
import type { PostData } from "../content.config";
|
import type { PostData } from "../content.config";
|
||||||
import NavBack from "../islands/NavBack";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
postData: PostData;
|
postData: PostData;
|
||||||
|
|
@ -17,31 +17,26 @@ const localeDate = formatLocalizedDateString(postData.date);
|
||||||
---
|
---
|
||||||
|
|
||||||
<Main>
|
<Main>
|
||||||
<div id="background">
|
|
||||||
<div id="header">
|
|
||||||
<Image id="title-img" src={titleImg} alt={postData.image.alt} />
|
|
||||||
<div class="info">
|
|
||||||
<span>{localeDate} | </span>
|
|
||||||
<span>Autor: {postData.author} | </span>
|
|
||||||
<span>Lesezeit: {postData.time2read} min</span>
|
|
||||||
</div>
|
|
||||||
<h1 id="title">{postData.title}</h1>
|
|
||||||
<h3 id="subtitle">{postData.subtitle}</h3>
|
|
||||||
<span id="introduction">{postData.introduction}</span>
|
|
||||||
</div>
|
|
||||||
<div id="hr-knast">
|
|
||||||
<hr />
|
|
||||||
</div>
|
|
||||||
<article class="markdown-content">
|
<article class="markdown-content">
|
||||||
|
<Image
|
||||||
|
id="titleImg"
|
||||||
|
src={titleImg}
|
||||||
|
alt={postData.image.alt}
|
||||||
|
class="rounded"
|
||||||
|
/>
|
||||||
|
<h1 class="headline">{postData.title}</h1>
|
||||||
|
<div class="bottom-info">
|
||||||
|
<span>Autor: {postData.author}</span>
|
||||||
|
<span>{localeDate}</span>
|
||||||
|
</div>
|
||||||
<slot />
|
<slot />
|
||||||
<NavBack client:visible />
|
<BackNav />
|
||||||
<p class="disclaimer">
|
<p class="disclaimer">
|
||||||
Disclaimer: Dieser Artikel ist ausschließlich privat und wird nicht
|
Disclaimer: Dieser Artikel ist ausschließlich privat und wird nicht durch
|
||||||
durch Produktplatzierung, Affiliate-Links oder ähnliches Unterstützt.
|
Produktplatzierung, Affiliate-Links oder ähnliches Unterstützt. Links
|
||||||
Links dienen allein dem Zweck der Information.
|
dienen allein dem Zweck der Information.
|
||||||
</p>
|
</p>
|
||||||
</article>
|
</article>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="image-backdrop" hidden>
|
<div id="image-backdrop" hidden>
|
||||||
<img id="image-preview" class="rounded" src="" alt="" />
|
<img id="image-preview" class="rounded" src="" alt="" />
|
||||||
|
|
@ -51,89 +46,11 @@ const localeDate = formatLocalizedDateString(postData.date);
|
||||||
<script is:inline src="/scripts/image-modal.js"></script>
|
<script is:inline src="/scripts/image-modal.js"></script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#background {
|
|
||||||
background-image: linear-gradient(
|
|
||||||
to bottom,
|
|
||||||
var(--primary-dark),
|
|
||||||
var(--primary-color)
|
|
||||||
);
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
padding: 0 20%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hr-knast {
|
|
||||||
padding: 16px 64px 0 64px ;
|
|
||||||
background-color: white;
|
|
||||||
max-width: 900px;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
margin: 0;
|
|
||||||
height: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
background-color: white;
|
|
||||||
padding-bottom: 16px;
|
|
||||||
max-width: 900px;
|
|
||||||
}
|
|
||||||
|
|
||||||
article {
|
article {
|
||||||
max-width: 900px;
|
max-width: 900px;
|
||||||
padding: 0 64px;
|
padding: 0 clamp(8px, 32px, 64px);
|
||||||
hyphens: auto;
|
hyphens: auto;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
background-color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
#title-img {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
height: 300px;
|
|
||||||
object-fit: cover;
|
|
||||||
object-position: center;
|
|
||||||
order: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header .info,
|
|
||||||
#header #introduction {
|
|
||||||
font-size: 1.5rem;
|
|
||||||
line-height: 1.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header #title {
|
|
||||||
font-size: 2.5rem;
|
|
||||||
padding: 0 64px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header #subtitle {
|
|
||||||
font-size: 1.8rem;
|
|
||||||
padding: 0 64px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
padding: 32px 64px 0 64px;
|
|
||||||
font-size: medium;
|
|
||||||
order: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
#title {
|
|
||||||
margin-bottom: 0;
|
|
||||||
order: 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
#subtitle {
|
|
||||||
margin-top: 0;
|
|
||||||
font-weight: lighter;
|
|
||||||
order: 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
#introduction {
|
|
||||||
padding: 32px 64px 0 64px;
|
|
||||||
order: 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-content {
|
.markdown-content {
|
||||||
|
|
@ -144,9 +61,22 @@ const localeDate = formatLocalizedDateString(postData.date);
|
||||||
cursor: zoom-in;
|
cursor: zoom-in;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#titleImg {
|
||||||
|
width: 100%;
|
||||||
|
height: 300px;
|
||||||
|
object-fit: cover;
|
||||||
|
object-position: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-info {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.disclaimer {
|
.disclaimer {
|
||||||
padding: 64px 0 16px 0;
|
margin: 32px 0 64px 0;
|
||||||
margin: 0;
|
|
||||||
font-size: smaller;
|
font-size: smaller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,48 +110,6 @@ const localeDate = formatLocalizedDateString(postData.date);
|
||||||
.markdown-content {
|
.markdown-content {
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
background-color: white;
|
|
||||||
border-radius: 48px 48px 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hr-knast {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#background {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header {
|
|
||||||
background-color: transparent;
|
|
||||||
* {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
order: 1;
|
|
||||||
font-size: 1rem !important;
|
|
||||||
padding-top: 16px;
|
|
||||||
padding-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#title-img {
|
|
||||||
order: 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
#title {
|
|
||||||
margin: 0;
|
|
||||||
order: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
#subtitle {
|
|
||||||
order: 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
#introduction {
|
|
||||||
font-size: 1.25rem !important;
|
|
||||||
order: 5;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
||||||
---
|
|
||||||
import NavBack from "../islands/NavBack";
|
|
||||||
import Main from "../layouts/Main.astro";
|
|
||||||
|
|
||||||
const { title, subtitle, text, buttonText, eventString } = Astro.props;
|
|
||||||
---
|
|
||||||
|
|
||||||
<Main>
|
|
||||||
<div id="background">
|
|
||||||
<div id="content">
|
|
||||||
<img src="../..//blog_img/england/titelbild_england.webp" />
|
|
||||||
<div id="form">
|
|
||||||
<h1>{title}</h1>
|
|
||||||
<span>{subtitle}</span>
|
|
||||||
<p>{text}</p>
|
|
||||||
<slot />
|
|
||||||
<div id="buttons">
|
|
||||||
<NavBack client:load />
|
|
||||||
<button
|
|
||||||
onclick={`window.dispatchEvent(new Event("${eventString}"))`}
|
|
||||||
class="submit-btn"
|
|
||||||
>
|
|
||||||
⚓︎ {buttonText}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Main>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
#background {
|
|
||||||
background-image: linear-gradient(
|
|
||||||
to bottom,
|
|
||||||
var(--primary-dark),
|
|
||||||
var(--primary-color)
|
|
||||||
);
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
padding: 0 20%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content {
|
|
||||||
background-color: white;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
height: 300px;
|
|
||||||
object-fit: cover;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
#form {
|
|
||||||
padding: 32px 64px;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
margin: 0;
|
|
||||||
padding-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
font-size: 1.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#buttons {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: end;
|
|
||||||
padding-top: 64px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 800px) {
|
|
||||||
img {
|
|
||||||
height: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#background {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -28,7 +28,6 @@ import "../styles/global.css";
|
||||||
<style>
|
<style>
|
||||||
main {
|
main {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
width: 100%;
|
margin: 32px auto;
|
||||||
margin: 0;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,97 +0,0 @@
|
||||||
export interface User {
|
|
||||||
email: string;
|
|
||||||
name: string;
|
|
||||||
subscription: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const API_BASE = import.meta.env.PUBLIC_API_URL;
|
|
||||||
export const AUTH_TOKEN_KEY = 'authToken'
|
|
||||||
export const USER_KEY = 'user'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class BlauwasserAPI {
|
|
||||||
private async fetchAPI<T>(
|
|
||||||
endpoint: string,
|
|
||||||
options: RequestInit = {}
|
|
||||||
): Promise<T> {
|
|
||||||
const url = new URL(endpoint, API_BASE);
|
|
||||||
const defaultHeaders: HeadersInit = {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
};
|
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
|
||||||
const jwt = localStorage.getItem(AUTH_TOKEN_KEY);
|
|
||||||
if (jwt) {
|
|
||||||
defaultHeaders['Authorization'] = `Bearer ${jwt}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
...options,
|
|
||||||
headers: { ...defaultHeaders, ...options.headers },
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(`API Error ${response.status}: ${response.statusText}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response.json();
|
|
||||||
}
|
|
||||||
|
|
||||||
async getUserInfo(): Promise<User> {
|
|
||||||
return this.fetchAPI(`/users/me`);
|
|
||||||
}
|
|
||||||
|
|
||||||
async register(user: User): Promise<void> {
|
|
||||||
return this.fetchAPI(`/users`, {
|
|
||||||
method: 'POST',
|
|
||||||
body: JSON.stringify(user)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async login(userCode: string): Promise<string> {
|
|
||||||
const formData = new URLSearchParams();
|
|
||||||
formData.append('user_code', userCode);
|
|
||||||
|
|
||||||
return await this.fetchAPI('/users/login', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
|
||||||
},
|
|
||||||
body: formData,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async toggleSubscription(subscription: boolean): Promise<void> {
|
|
||||||
const formData = new URLSearchParams();
|
|
||||||
formData.append('subscription', JSON.stringify(subscription));
|
|
||||||
|
|
||||||
return await this.fetchAPI('/users/me/subscription', {
|
|
||||||
method: 'PUT',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
|
||||||
},
|
|
||||||
body: formData,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async deleteUser(): Promise<void> {
|
|
||||||
return await this.fetchAPI('/users/me', {
|
|
||||||
method: "DELETE"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async approveNewsletter(secret: string): Promise<void> {
|
|
||||||
const formData = new URLSearchParams();
|
|
||||||
formData.append('secret', JSON.stringify(secret));
|
|
||||||
|
|
||||||
return await this.fetchAPI('/newsletter/approve', {
|
|
||||||
method: 'POST',
|
|
||||||
body: formData
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export const api = new BlauwasserAPI();
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
---
|
|
||||||
import { api } from '../../../lib/api';
|
|
||||||
|
|
||||||
const { secret } = Astro.props;
|
|
||||||
|
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
|
||||||
const response = await api.approveNewsletter(secret);
|
|
||||||
|
|
||||||
return response.map(product => ({
|
|
||||||
params: { id: product.id },
|
|
||||||
props: { product }
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<h1>{product.name}</h1>
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
title: Under Construction
|
title: Under Construction
|
||||||
subtitle: Wir bauen für Sie
|
subtitle: Wir bauen für Sie
|
||||||
description: Bald könnt ihr hier unsere ersten Abenteuer mitverfolgen. Und keine Sorge...an der Webseite wird auch noch gearbeitet!
|
description: Bald könnt ihr hier unsere ersten Abenteuer mitverfolgen. Und keine Sorge...an der Webseite wird auch noch gearbeitet!
|
||||||
introduction: Willkommen willkommen. Treten sie ein!
|
|
||||||
image:
|
image:
|
||||||
path: construction.png
|
path: construction.png
|
||||||
alt: Under Construction
|
alt: Under Construction
|
||||||
|
|
@ -13,9 +12,8 @@ time2read: 1
|
||||||
---
|
---
|
||||||
import BlogLink from '../../components/blog/BlogLink.astro'
|
import BlogLink from '../../components/blog/BlogLink.astro'
|
||||||
|
|
||||||
|
# All Endings Are Beginnings
|
||||||
|
|
||||||
<br />
|
|
||||||
## All Endings Are Beginnings
|
|
||||||
Heute ist mein letzter Arbeitstag.
|
Heute ist mein letzter Arbeitstag.
|
||||||
So richtig real fühlt es sich noch nicht an.
|
So richtig real fühlt es sich noch nicht an.
|
||||||
Erst der nächste Montag wird zeigen, wie das Gefühl dieser Veränderung aussieht.
|
Erst der nächste Montag wird zeigen, wie das Gefühl dieser Veränderung aussieht.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
title: Ostseeurlaub
|
title: Ostseeurlaub
|
||||||
subtitle: Finden wir ein Boot? Suchen wir überhaupt oder faulenzen wir nur?
|
subtitle: Finden wir ein Boot? Suchen wir überhaupt oder faulenzen wir nur?
|
||||||
description: Ostseeurlaub bedeutet für mich ganz viele Kindheitserinnerungen. Besonders diese Woche war vollgepackt davon. Hier meine Reiseempfehlung...
|
description: Ostseeurlaub bedeutet für mich ganz viele Kindheitserinnerungen. Besonders diese Woche war vollgepackt davon. Hier meine Reiseempfehlung...
|
||||||
introduction: Eigentlich soll es hier um unser (zukünftiges) Boot und die Segelreisen gehen. Bis wird avon berichten können dauert es aber noch ein bisschen. Was wir bis dahin machen? Das Leben als Privatière genießen! Und das sieht so aus...
|
|
||||||
image:
|
image:
|
||||||
path: ostsee.webp
|
path: ostsee.webp
|
||||||
alt: Chiara und Tim vor einem Strand
|
alt: Chiara und Tim vor einem Strand
|
||||||
|
|
@ -16,7 +15,11 @@ import BlogLink from '../../components/blog/BlogLink.astro'
|
||||||
import SingleImage from '../../components/blog/SingleImage.astro'
|
import SingleImage from '../../components/blog/SingleImage.astro'
|
||||||
import DoubleImage from '../../components/blog/DoubleImage.astro'
|
import DoubleImage from '../../components/blog/DoubleImage.astro'
|
||||||
|
|
||||||
|
Eigentlich soll es hier um unser (zukünftiges) Boot und die Segelreisen gehen. Bis wir
|
||||||
|
davon berichten können dauert es aber noch ein bisschen. Was wir bis dahin machen? Das
|
||||||
|
Leben als Privatière genießen! Und das sieht so aus...
|
||||||
|
|
||||||
|
---
|
||||||
<br />
|
<br />
|
||||||
## Ostseecamp Rerik
|
## Ostseecamp Rerik
|
||||||
Unser erstes light-Abenteuer führt uns an die Ostsee. Mit meiner Mutter und kleinem Bruder
|
Unser erstes light-Abenteuer führt uns an die Ostsee. Mit meiner Mutter und kleinem Bruder
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
---
|
---
|
||||||
title: Luxusurlaub in den Bergen
|
title: Luxusurlaub in den Bergen - Hike & Bike im Wipptal
|
||||||
subtitle: Hike & Bike im Wipptal
|
subtitle: Das ist jetzt also unser Leben. Luxushotels, 3-Gänge-Menüs und die schönsten Umgebungen.
|
||||||
description: Was könnte ein besser Kontrast zum Zelturlaub an der Ostsee sein, als eine Woche in einem luxuriösen Hotel, mitten in den Alpen? Und wenn ihr jetzt denkt, dass wir unsere Abfindung verschleudern...das ganze hat uns nur 80€ p.P. gekostet ;). Wie das funktioniert erfahrt ihr im Artikel.
|
description: Was könnte ein besser Kontrast zum Zelturlaub an der Ostsee sein, als eine Woche in einem luxuriösen Hotel, mitten in den Alpen? Und wenn ihr jetzt denkt, dass wir unsere Abfindung verschleudern...das ganze hat uns nur 80€ p.P. gekostet ;). Wie das funktioniert erfahrt ihr im Artikel.
|
||||||
introduction: Was könnte ein besser Kontrast zum Zelturlaub an der Ostsee sein, als eine Woche in einem luxuriösen Hotel, mitten in den Alpen? Und wenn ihr jetzt denkt, dass wir unsere Abfindung verschleudern...das ganze hat uns nur 80€ p.P. gekostet ;) Wie das funktioniert erfahrt ihr im Artikel.
|
|
||||||
image:
|
image:
|
||||||
path: titelbild_matrei.webp
|
path: titelbild_matrei.webp
|
||||||
alt: Chiara und Tim in der nähe der Bergeralm mit tollen Bergen im Hintergrund.
|
alt: Chiara und Tim in der nähe der Bergeralm mit tollen Bergen im Hintergrund.
|
||||||
|
|
@ -15,12 +14,16 @@ import BlogLink from '../../components/blog/BlogLink.astro'
|
||||||
import SingleImage from '../../components/blog/SingleImage.astro'
|
import SingleImage from '../../components/blog/SingleImage.astro'
|
||||||
import DoubleImage from '../../components/blog/DoubleImage.astro'
|
import DoubleImage from '../../components/blog/DoubleImage.astro'
|
||||||
|
|
||||||
|
Was könnte ein besser Kontrast zum Zelturlaub an der Ostsee sein, als eine Woche in einem
|
||||||
|
luxuriösen Hotel, mitten in den Alpen?<br /> Und wenn ihr jetzt denkt, dass wir unsere
|
||||||
|
Abfindung verschleudern...das ganze hat uns nur 80€ p.P. gekostet ;)<br /> Wie das
|
||||||
|
funktioniert erfahrt ihr im Artikel. <br />
|
||||||
|
|
||||||
<br />
|
---
|
||||||
**TL;DR (Lesezeit: 10 sek)** <br /> Chiara meint ich soll eine Kurzfassung anbieten, weil
|
|
||||||
|
>**TL;DR (Lesezeit: 10 sek)** <br /> Chiara meint ich soll eine Kurzfassung anbieten, weil
|
||||||
der Artikel so lang ist...<br /> Na bitte: Schöne Woche, jederzeit wieder. <br /> Ciao
|
der Artikel so lang ist...<br /> Na bitte: Schöne Woche, jederzeit wieder. <br /> Ciao
|
||||||
Kakao.
|
Kakao.
|
||||||
<br />
|
|
||||||
|
|
||||||
---
|
---
|
||||||
<br />
|
<br />
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
---
|
---
|
||||||
title: Die Frage der Fragen
|
title: "\"Habt ihr jetzt schon ein Boot?\""
|
||||||
subtitle: "\"Habt ihr jetzt schon ein Boot?\""
|
subtitle: Von uns, vom Boot, von euch
|
||||||
description: "Die titelgebende Frage haben wir in den letzten Tagen unglaublich oft gehört. Deshalb möchten wir euch zeigen, was für uns in nächster Zeit ansteht. Anfangen will ich in der Vergangenheit und Enden in der Zukunft..."
|
description: "Die titelgebende Frage haben wir in den letzten Tagen unglaublich oft gehört. Deshalb möchten wir euch zeigen, was für uns in nächster Zeit ansteht. Anfangen will ich in der Vergangenheit und Enden in der Zukunft..."
|
||||||
introduction: Die titelgebende Frage haben wir in den letzten Tagen unglaublich oft gehört. Deshalb möchten wir euch zeigen, was für uns in nächster Zeit ansteht. Anfangen will ich in der Vergangenheit und enden in der Zukunft. In einem nächsten Artikel kommen wir sicher nochmal 'Zurück in die Zukunft' und beschreiben, was auf den zukünftigen Etappen passiert ist. Jetzt muss ich aber erst mal los. Das Boarding für den Flug nach Sofia beginnt!
|
|
||||||
image:
|
image:
|
||||||
path: titelbild_bruegge.webp
|
path: titelbild_bruegge.webp
|
||||||
alt: "Chiara und Tim vor dem Haupttor des Glockenturms am Marktplatz in Brügge."
|
alt: "Chiara und Tim vor dem Haupttor des Glockenturms am Marktplatz in Brügge."
|
||||||
|
|
@ -15,6 +14,10 @@ import BlogLink from '../../components/blog/BlogLink.astro'
|
||||||
import SingleImage from '../../components/blog/SingleImage.astro'
|
import SingleImage from '../../components/blog/SingleImage.astro'
|
||||||
import DoubleImage from '../../components/blog/DoubleImage.astro'
|
import DoubleImage from '../../components/blog/DoubleImage.astro'
|
||||||
|
|
||||||
|
Die titelgebende Frage haben wir in den letzten Tagen unglaublich oft gehört. Deshalb möchten wir euch zeigen, was für uns in nächster Zeit ansteht. Anfangen will ich in der Vergangenheit und enden in der Zukunft. In einem nächsten Artikel kommen wir sicher nochmal 'Zurück in die Zukunft' und beschreiben, was auf den zukünftigen Etappen passiert ist. <br />
|
||||||
|
Jetzt muss ich aber erst mal los. Das Boarding für den Flug nach Sofia beginnt!
|
||||||
|
|
||||||
|
---
|
||||||
<br />
|
<br />
|
||||||
## Bootssuche
|
## Bootssuche
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
title: Bulgarien
|
title: Bulgarien
|
||||||
subtitle: Harter Stahl im schwarzen Meer
|
subtitle: Harter Stahl im schwarzen Meer
|
||||||
description: Die nächste Etappe der Bootsbesichtigungen startet. Dieses Mal werden wir nicht nur ein Wochenende weg sein, wie in Belgien, sondern ganze 2 Wochen. Das erfordert viel Planung und saubere Unterwäsche. Eine Geschichte von Bulgarien, einem Stahlschiff und langen Reisen.
|
description: Die nächste Etappe der Bootsbesichtigungen startet. Dieses Mal werden wir nicht nur ein Wochenende weg sein, wie in Belgien, sondern ganze 2 Wochen. Das erfordert viel Planung und saubere Unterwäsche. Eine Geschichte von Bulgarien, einem Stahlschiff und langen Reisen.
|
||||||
introduction: Wart ihr schonmal in Bulgarien? Wir nicht. Das schwarze Meer kennen vermutlich die meisten noch. Gerade, durch den russischen Angriffskrieg kommt das immer mal in den Nachrichten. Sonst hört man von Bulgarien nicht viel. Umso gespannter sind wir auf dieses Land...
|
|
||||||
image:
|
image:
|
||||||
path: titelbild_bulgarien.webp
|
path: titelbild_bulgarien.webp
|
||||||
alt: Chiara und Tim haben ihre Beine auf einem Steinwall liegen. Im Hintergrund sieht man das Meer.
|
alt: Chiara und Tim haben ihre Beine auf einem Steinwall liegen. Im Hintergrund sieht man das Meer.
|
||||||
|
|
@ -15,7 +14,11 @@ import BlogLink from '../../components/blog/BlogLink.astro'
|
||||||
import SingleImage from '../../components/blog/SingleImage.astro'
|
import SingleImage from '../../components/blog/SingleImage.astro'
|
||||||
import DoubleImage from '../../components/blog/DoubleImage.astro'
|
import DoubleImage from '../../components/blog/DoubleImage.astro'
|
||||||
|
|
||||||
|
Wart ihr schonmal in Bulgarien? Wir nicht. Das schwarze Meer kennen vermutlich die meisten
|
||||||
|
noch. Gerade, durch den russischen Angriffskrieg kommt das immer mal in den Nachrichten.
|
||||||
|
Sonst hört man von Bulgarien nicht viel. Umso gespannter sind wir auf dieses Land...
|
||||||
|
|
||||||
|
---
|
||||||
<br />
|
<br />
|
||||||
## Erster Eindruck
|
## Erster Eindruck
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
title: England
|
title: England
|
||||||
subtitle: It's gettin' british, my dear!
|
subtitle: It's gettin' british, my dear!
|
||||||
description: Auf geht's nach Milano! Aber Moment mal...der Artikel heißt England?! Da kann irgendwas nicht stimmen. Ich frage mal in der Redaktion nach. Ihr lest währenddessen einfach schonmal weiter.
|
description: Auf geht's nach Milano! Aber Moment mal...der Artikel heißt England?! Da kann irgendwas nicht stimmen. Ich frage mal in der Redaktion nach. Ihr lest währenddessen einfach schonmal weiter.
|
||||||
introduction: Nach einer langen Wartezeit in Bulgarien freuen wir uns auf neue Gefilde. Irgendwann werden solche Reisen auch anstrengend. Da hilft die Ablenkung durch das wechselnde Umfeld. Aber wenn dabei der Schlaf leidet, wird's eklig!
|
|
||||||
image:
|
image:
|
||||||
path: titelbild_england.webp
|
path: titelbild_england.webp
|
||||||
alt: Chiara steht mit ausgebreiteten Armen auf einem Steg, der über eine Meile lang ist. Im Hintergrunde sieht man, weit weg, die Stadt Southend-on-Sea.
|
alt: Chiara steht mit ausgebreiteten Armen auf einem Steg, der über eine Meile lang ist. Im Hintergrunde sieht man, weit weg, die Stadt Southend-on-Sea.
|
||||||
|
|
@ -15,8 +14,11 @@ import BlogLink from '../../components/blog/BlogLink.astro'
|
||||||
import SingleImage from '../../components/blog/SingleImage.astro'
|
import SingleImage from '../../components/blog/SingleImage.astro'
|
||||||
import DoubleImage from '../../components/blog/DoubleImage.astro'
|
import DoubleImage from '../../components/blog/DoubleImage.astro'
|
||||||
|
|
||||||
|
Nach einer langen Wartezeit in Bulgarien freuen wir uns auf neue Gefilde. Irgendwann
|
||||||
|
werden solche Reisen auch anstrengend. Da hilft die Ablenkung durch das wechselnde Umfeld.
|
||||||
|
Aber wenn dabei der Schlaf leidet, wird's eklig!
|
||||||
|
|
||||||
|
---
|
||||||
<br />
|
<br />
|
||||||
## Flucht vor dem Sonnenaufgang
|
## Flucht vor dem Sonnenaufgang
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
title: Spanien
|
title: Spanien
|
||||||
subtitle: ¡Nos encanta España!
|
subtitle: ¡Nos encanta España!
|
||||||
description: Seitdem wir Spanisch lernen haben wir eine besondere Verbindung zu diesem Land. Die Vorfreude ist groß und die Aussicht hier mit einem Boot ins Abenteuer zu starten ist wunderschön.
|
description: Seitdem wir Spanisch lernen haben wir eine besondere Verbindung zu diesem Land. Die Vorfreude ist groß und die Aussicht hier mit einem Boot ins Abenteuer zu starten ist wunderschön.
|
||||||
introduction: England war wie England nun mal ist. Die Städte sind nicht meins und wohnen würde ich da auch nicht gerne. In dörflichen Regionen haben die kleinen Häuser noch einen gewissen Charme. Zusammen gepresst und zubetoniert macht es mich traurig. Umso besser, dass wir gleich etwa 2000km weiter südlich sind.
|
|
||||||
image:
|
image:
|
||||||
path: titelbild_spanien.webp
|
path: titelbild_spanien.webp
|
||||||
alt: Chiara und Tim mit strahlenden Gesichter. Es ist wieder warm!
|
alt: Chiara und Tim mit strahlenden Gesichter. Es ist wieder warm!
|
||||||
|
|
@ -15,7 +14,11 @@ import BlogLink from '../../components/blog/BlogLink.astro'
|
||||||
import SingleImage from '../../components/blog/SingleImage.astro'
|
import SingleImage from '../../components/blog/SingleImage.astro'
|
||||||
import DoubleImage from '../../components/blog/DoubleImage.astro'
|
import DoubleImage from '../../components/blog/DoubleImage.astro'
|
||||||
|
|
||||||
|
England war wie England nun mal ist. Die Städte sind nicht meins und wohnen würde ich da auch nicht gerne.
|
||||||
|
In dörflichen Regionen haben die kleinen Häuser noch einen gewissen Charme. Zusammen gepresst
|
||||||
|
und zubetoniert macht es mich traurig. Umso besser, dass wir gleich etwa 2000km weiter südlich sind.
|
||||||
|
|
||||||
|
---
|
||||||
<br />
|
<br />
|
||||||
## Zurück im warmen
|
## Zurück im warmen
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,46 +4,17 @@ import PostPreviewLarge from "../components/PostPreviewLarge.astro";
|
||||||
import PostGrid from "../components/PostGrid.astro";
|
import PostGrid from "../components/PostGrid.astro";
|
||||||
import { getCollection } from "astro:content";
|
import { getCollection } from "astro:content";
|
||||||
|
|
||||||
const allPostsSorted = (await getCollection("posts")).sort(
|
const allPostsSorted = (await getCollection('posts')).sort(
|
||||||
(postA, postB) => postB.data.date.getTime() - postA.data.date.getTime(),
|
(postA, postB) =>
|
||||||
|
postB.data.date.getTime() - postA.data.date.getTime()
|
||||||
);
|
);
|
||||||
|
|
||||||
const [mostRecentPost, ...sortedPosts] = allPostsSorted;
|
const [mostRecentPost, ...sortedPosts] = allPostsSorted;
|
||||||
---
|
---
|
||||||
|
|
||||||
<Main>
|
<Main title="Startseite">
|
||||||
<PostPreviewLarge post={mostRecentPost.data} />
|
<PostPreviewLarge
|
||||||
<div id="background">
|
post={mostRecentPost.data}
|
||||||
<div id="last-articles">
|
/>
|
||||||
<h2>Letzte Artikel</h2>
|
|
||||||
<PostGrid posts={sortedPosts} />
|
<PostGrid posts={sortedPosts} />
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Main>
|
</Main>
|
||||||
|
|
||||||
<style>
|
|
||||||
#last-articles {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
flex-direction: column;
|
|
||||||
padding: 0 64px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
margin: 24px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 800px) {
|
|
||||||
#last-articles {
|
|
||||||
align-items: center;
|
|
||||||
background-color: white;
|
|
||||||
border-radius: 48px 48px 0 0;
|
|
||||||
padding: 0 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#background {
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
---
|
|
||||||
import LoginForm from "../islands/LoginForm";
|
|
||||||
import Form from "../layouts/Form.astro";
|
|
||||||
---
|
|
||||||
|
|
||||||
<Form
|
|
||||||
title="Login"
|
|
||||||
subtitle="Gib deinen persönlichen Code ein"
|
|
||||||
text="Meld dich an, um deine Daten zu bearbeiten. Gib dafür den
|
|
||||||
Code ein, denn du nach dem registrieren via E-Mail erhalten
|
|
||||||
hast."
|
|
||||||
buttonText="Anmelden"
|
|
||||||
eventString="submit-login"
|
|
||||||
>
|
|
||||||
<LoginForm client:load />
|
|
||||||
<a href="/register">Noch keinen Account? Hier registrieren</a>
|
|
||||||
</Form>
|
|
||||||
|
|
@ -56,7 +56,7 @@ import Main from "../layouts/Main.astro";
|
||||||
<p>Wir verarbeiten folgende Kategorien personenbezogener Daten:</p>
|
<p>Wir verarbeiten folgende Kategorien personenbezogener Daten:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Name</li>
|
<li>Name</li>
|
||||||
<li>E-Mail Adresse</li>
|
<li>E-Mail-Adresse</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<h2>
|
||||||
Folgende Daten werden in den technischen Systemen automatisch zur
|
Folgende Daten werden in den technischen Systemen automatisch zur
|
||||||
|
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
---
|
|
||||||
import RegisterForm from "../islands/RegisterForm";
|
|
||||||
import Form from "../layouts/Form.astro";
|
|
||||||
---
|
|
||||||
|
|
||||||
<Form
|
|
||||||
title="Willkommen!"
|
|
||||||
subtitle="E-Mail Erinnerung für neue Artikel"
|
|
||||||
text="Endlich könnt E-Mail Erinnerungen erhalten, wenn wir neue Artikel veröffentlichen. Für die spätere Kommentarfunktion fragen wir gleich den Namen mit ab."
|
|
||||||
buttonText="Registrieren"
|
|
||||||
eventString="submit-register"
|
|
||||||
>
|
|
||||||
<RegisterForm client:load/>
|
|
||||||
</Form>
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
---
|
|
||||||
import DeleteUser from "../islands/DeleteUser";
|
|
||||||
import ToggleSubscription from "../islands/ToggleSubscription";
|
|
||||||
import UserDetails from "../islands/UserDetails";
|
|
||||||
import Form from "../layouts/Form.astro";
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<Form
|
|
||||||
title="Moin moin!"
|
|
||||||
subtitle="Hier kannst du dein Konto verwalten."
|
|
||||||
text=""
|
|
||||||
buttonText="Speichern"
|
|
||||||
eventString="submit-toggle-subscription"
|
|
||||||
>
|
|
||||||
<UserDetails client:load />
|
|
||||||
<ToggleSubscription client:load />
|
|
||||||
<DeleteUser client:load />
|
|
||||||
</Form>
|
|
||||||
|
|
@ -1,15 +1,11 @@
|
||||||
:root {
|
:root {
|
||||||
--primary-color: #3c6a7b;
|
--primary-color: #416A79;
|
||||||
--primary-dark: #1d3238;
|
|
||||||
--primary-text: #454545;
|
--primary-text: #454545;
|
||||||
--accent-color: #ffff00;
|
|
||||||
--background: #0e222bd0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: var(--primary-text);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
|
|
@ -38,11 +34,6 @@ body {
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-nav {
|
|
||||||
color: var(--primary-text);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-link:hover {
|
.nav-link:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
@ -52,46 +43,6 @@ body {
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-btn {
|
|
||||||
border: none;
|
|
||||||
background-color: transparent;
|
|
||||||
font-weight: bolder;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 1rem;
|
|
||||||
padding: 12px 12px 12px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.back-btn:hover {
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
.submit-btn {
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
border-radius: 8px;
|
|
||||||
padding: 12px;
|
|
||||||
font-weight: bolder;
|
|
||||||
font-size: 1rem;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.submit-btn:hover {
|
|
||||||
background-color: var(--primary-dark);
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
border: none;
|
|
||||||
background-color: #e9e9e9;
|
|
||||||
padding: 4px;
|
|
||||||
border-radius: 2px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type=checkbox] {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headline {
|
.headline {
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
|
|
@ -127,19 +78,3 @@ input[type=checkbox] {
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: center;
|
object-position: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
.submit-btn {
|
|
||||||
background-color: white;
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.submit-btn:hover {
|
|
||||||
color: white;
|
|
||||||
background-color: var(--primary-dark);
|
|
||||||
}
|
|
||||||
|
|
||||||
.back-btn:hover {
|
|
||||||
color: var(--primary-dark);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue