Merge Konflict
Ist jetzt auf stand von main
This commit is contained in:
commit
f026db0b68
21 files changed
+1044
-5601
No files matched your search
@@ -1,3 +1,5 @@
|
||||
// @wikiCategory: Liederbücher
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
import { getSongBooks, searchSongBooksByTitle, createSongBook } from "@/lib/db/songbook";
|
||||
|
||||
@@ -13,6 +15,8 @@ import { getSongBooks, searchSongBooksByTitle, createSongBook } from "@/lib/db/s
|
||||
* description: List of songbooks
|
||||
* 500:
|
||||
* description: Internal Server Error
|
||||
*
|
||||
* @wikiDescription: Liste aller Liederbücher abrufen
|
||||
*/
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
@@ -100,6 +104,8 @@ export async function GET(request: Request) {
|
||||
* description: Conflict (title already exists)
|
||||
* 500:
|
||||
* description: Internal Server Error
|
||||
*
|
||||
* @wikiDescription: Neues Liederbuch erstellen
|
||||
*/
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
// @wikiCategory: Lieder
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
import { getSongs, searchSongsByTitle, createSong, } from "@/lib/db/song";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @openapi
|
||||
* /api/songs:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// @wikiCategory: Stream
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
import { getSong } from "@/lib/db/managing";
|
||||
|
||||
@@ -8,10 +10,12 @@ let currentSong = {
|
||||
title: ""
|
||||
};
|
||||
|
||||
// @wikiDescription: Akutell gestreamtes Lied abrufen
|
||||
export async function GET() {
|
||||
return NextResponse.json(currentSong)
|
||||
}
|
||||
|
||||
// @wikiDescription: Lied zum Streamen festlegen
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
const data = await request.json();
|
||||
|
||||
+127
@@ -29,3 +29,130 @@ section {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
/* Shiki Code-Blöcke stylen */
|
||||
pre {
|
||||
padding: 1rem;
|
||||
border-radius: 0.75rem;
|
||||
border: 1px solid #27272a; /* Tailwind zinc-800 */
|
||||
overflow-x: auto;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
pre code {
|
||||
background-color: transparent !important;
|
||||
padding: 0 !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
/* Shiki / Rehype Pretty Code Block Container */
|
||||
figure[data-rehype-pretty-code-figure] {
|
||||
margin-top: 1.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
border-radius: 0.75rem;
|
||||
overflow: hidden;
|
||||
border: 1px solid #27272a; /* Tailwind zinc-800 */
|
||||
background-color: #0d1117; /* Dunkler VS-Code Hintergrund */
|
||||
}
|
||||
|
||||
/* Der Titel/Dateiname (falls im MDX angegeben) */
|
||||
div[data-rehype-pretty-code-title] {
|
||||
background-color: #161b22;
|
||||
border-bottom: 1px solid #27272a;
|
||||
padding: 0.5rem 1rem;
|
||||
font-family: monospace;
|
||||
font-size: 0.75rem;
|
||||
color: #8b949e;
|
||||
}
|
||||
|
||||
/* Der eigentliche Code-Bereich */
|
||||
figure[data-rehype-pretty-code-figure] pre {
|
||||
margin: 0 !important;
|
||||
padding: 1rem !important;
|
||||
background-color: transparent !important;
|
||||
overflow-x: auto;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
figure[data-rehype-pretty-code-figure] code {
|
||||
font-family: var(--font-mono, monospace);
|
||||
}
|
||||
|
||||
/* Container für den Code-Block */
|
||||
/* Container für den Code-Block */
|
||||
figure[data-rehype-pretty-code-figure] {
|
||||
position: relative;
|
||||
margin-top: 1.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
border-radius: 0.75rem;
|
||||
overflow: hidden;
|
||||
border: 1px solid #27272a;
|
||||
background-color: #0d1117;
|
||||
}
|
||||
|
||||
/* Leeres Pseudo-Element der Figure deaktivieren */
|
||||
figure[data-rehype-pretty-code-figure]::before {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Sprach-Badge links oben */
|
||||
figure[data-rehype-pretty-code-figure] pre[data-language]::before {
|
||||
content: attr(data-language);
|
||||
display: block !important;
|
||||
position: absolute;
|
||||
top: 0.6rem;
|
||||
left: 0.5rem;
|
||||
font-family: var(--font-mono, ui-monospace, monospace);
|
||||
font-size: 0.68rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
color: #a1a1aa;
|
||||
background-color: #18181b;
|
||||
border: 1px solid #27272a;
|
||||
padding: 0.15rem 0.5rem;
|
||||
border-radius: 0.375rem;
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* Platz oben im Code-Block */
|
||||
figure[data-rehype-pretty-code-figure] pre {
|
||||
margin: 0 !important;
|
||||
padding: 1rem !important;
|
||||
padding-top: 2.6rem !important; /* Platz für Badge & Button */
|
||||
background-color: transparent !important;
|
||||
overflow-x: auto;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
scroll-margin-top: 5rem; /* <-- Höhe deines Headers + etwas Abstand */
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
/* Anchor-Link Styling */
|
||||
.heading-anchor {
|
||||
opacity: 0;
|
||||
margin-right: 1em; /* Abstand zum nachfolgenden Text */
|
||||
color: #3b82f6; /* Tailwind blue-500 */
|
||||
text-decoration: none;
|
||||
font-weight: 800;
|
||||
transition: opacity 0.15s ease-in-out;
|
||||
}
|
||||
|
||||
h1:hover .heading-anchor,
|
||||
h2:hover .heading-anchor,
|
||||
h3:hover .heading-anchor,
|
||||
h4:hover .heading-anchor,
|
||||
.heading-anchor:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
+111
-16
@@ -3,11 +3,65 @@
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
export default function SenderPage() {
|
||||
const [isFullscreen, setIsFullscreen] = useState(false);
|
||||
|
||||
const [songID, setSongID] = useState("");
|
||||
const [songbook, setSongbook] = useState("");
|
||||
const [number, setNumber] = useState("");
|
||||
const [title, setTitle] = useState("");
|
||||
|
||||
// --- Screen Wake Lock API Integration ---
|
||||
useEffect(() => {
|
||||
let wakeLock: WakeLockSentinel | null = null;
|
||||
|
||||
const requestWakeLock = async () => {
|
||||
try {
|
||||
if ("wakeLock" in navigator) {
|
||||
wakeLock = await navigator.wakeLock.request("screen");
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Wake Lock Fehler:", err);
|
||||
}
|
||||
};
|
||||
|
||||
requestWakeLock();
|
||||
|
||||
// Erneutes Anfordern, falls der Tab/die App gewechselt wurde
|
||||
const handleVisibilityChange = () => {
|
||||
if (document.visibilityState === "visible") {
|
||||
requestWakeLock();
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener("visibilitychange", handleVisibilityChange);
|
||||
|
||||
return () => {
|
||||
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
||||
if (wakeLock) {
|
||||
wakeLock.release();
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
// --- Fullscreen Steuerung ---
|
||||
const toggleFullscreen = () => {
|
||||
if (!document.fullscreenElement) {
|
||||
document.documentElement
|
||||
.requestFullscreen()
|
||||
.then(() => {
|
||||
setIsFullscreen(true);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("Vollbild fehlgeschlagen:", err);
|
||||
});
|
||||
} else {
|
||||
document.exitFullscreen().then(() => {
|
||||
setIsFullscreen(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// --- Daten abrufen ---
|
||||
const getID = async () => {
|
||||
try {
|
||||
const res = await fetch("/api/stream/currentID");
|
||||
@@ -28,22 +82,63 @@ export default function SenderPage() {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="flex h-screen w-screen flex-col items-center justify-between bg-black text-white font-sans select-none overflow-hidden">
|
||||
<div className="w-full text-center py-2">
|
||||
<span className="text-[7rem] md:text-[11rem] font-black uppercase block leading-none">
|
||||
{songbook}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex-1 flex items-center justify-center w-full">
|
||||
<h1 className="text-[14rem] md:text-[20rem] font-black leading-none tracking-tighter text-white">
|
||||
{number}
|
||||
</h1>
|
||||
</div>
|
||||
<div className="w-full text-center pb-2 px-4">
|
||||
<p className="text-3xl md:text-6xl font-medium text-neutral-400 truncate">
|
||||
{title}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
className={`absolute top-0 left-0 z-50 flex h-screen w-screen flex-col items-center justify-between bg-black text-white select-none overflow-hidden p-2`}
|
||||
>
|
||||
{/* 1. Liederbuch */}
|
||||
<header className="w-full flex-[1.5] flex items-center justify-center overflow-hidden py-1">
|
||||
<svg viewBox="0 0 1000 200" className="w-full h-full max-h-full">
|
||||
<text
|
||||
x="50%"
|
||||
y="50%"
|
||||
dominantBaseline="central"
|
||||
textAnchor="middle"
|
||||
className="fill-amber-300 font-black uppercase"
|
||||
fontSize="220"
|
||||
>
|
||||
{songbook}
|
||||
</text>
|
||||
</svg>
|
||||
</header>
|
||||
|
||||
{/* 2. Nummer */}
|
||||
<main className="w-full flex-[5] flex items-center justify-center overflow-hidden py-1">
|
||||
<svg viewBox="0 0 1000 500" className="w-full h-full max-h-full">
|
||||
<text
|
||||
x="50%"
|
||||
y="50%"
|
||||
dominantBaseline="central"
|
||||
textAnchor="middle"
|
||||
className="fill-white font-black"
|
||||
fontSize="520"
|
||||
>
|
||||
{number}
|
||||
</text>
|
||||
</svg>
|
||||
</main>
|
||||
|
||||
{/* 3. Titel */}
|
||||
<footer className="w-full flex-[1] flex items-center justify-center overflow-hidden py-1">
|
||||
<svg viewBox="0 0 1000 120" className="w-full h-full max-h-full">
|
||||
<text
|
||||
x="50%"
|
||||
y="50%"
|
||||
dominantBaseline="central"
|
||||
textAnchor="middle"
|
||||
className="fill-zinc-200 font-semibold"
|
||||
fontSize="90"
|
||||
>
|
||||
{title}
|
||||
</text>
|
||||
</svg>
|
||||
</footer>
|
||||
|
||||
<button
|
||||
onClick={toggleFullscreen}
|
||||
className="fixed top-4 right-4 z-50 bg-neutral-800 hover:bg-neutral-700 text-white px-4 py-2 rounded-lg opacity-40 hover:opacity-100 transition-opacity"
|
||||
>
|
||||
{isFullscreen ? "Vollbild beenden" : "Vollbild starten"}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
import { getWikiPageBySlug } from '@/lib/wiki';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { MDXRemote } from 'next-mdx-remote/rsc';
|
||||
import rehypePrettyCode from 'rehype-pretty-code';
|
||||
import rehypeSlug from 'rehype-slug';
|
||||
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
|
||||
import { Callout, Grid, Card, Steps, Step, InlineCode, CodeBlockContainer, API } from '@/components/mdx-components';
|
||||
import Article from '@/components/wiki/Article';
|
||||
|
||||
const mdxOptions = {
|
||||
mdxOptions: {
|
||||
rehypePlugins: [
|
||||
rehypeSlug, // creates heading-ids automaticly
|
||||
[
|
||||
rehypeAutolinkHeadings,
|
||||
{
|
||||
behavior: 'prepend', // symbol is PRE header
|
||||
properties: {
|
||||
className: ['heading-anchor'],
|
||||
ariaHidden: 'true',
|
||||
tabIndex: -1,
|
||||
},
|
||||
content: {
|
||||
type: 'text',
|
||||
value: ' #', // symbol
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
rehypePrettyCode,
|
||||
{
|
||||
theme: 'github-dark',
|
||||
keepBackground: true,
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
const mdxComponents = {
|
||||
// Eigene UI-Komponenten
|
||||
Callout,
|
||||
Grid,
|
||||
Card,
|
||||
Steps,
|
||||
Step,
|
||||
API,
|
||||
// Custom Typography Überschreibungen
|
||||
code: InlineCode,
|
||||
pre: CodeBlockContainer,
|
||||
h1: (props: any) => <h1 className="text-3xl font-bold text-white mt-8 mb-4 border-b border-zinc-800 pb-3" {...props} />,
|
||||
h2: (props: any) => <h2 className="text-2xl font-bold text-white mt-10 mb-4" {...props} />,
|
||||
h3: (props: any) => <h3 className="text-xl font-semibold text-white mt-6 mb-3" {...props} />,
|
||||
};
|
||||
|
||||
type PageProps = {
|
||||
params: Promise<{
|
||||
slug: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
export default async function Page({ params }: PageProps) {
|
||||
const { slug } = await params;
|
||||
const article = await getWikiPageBySlug(slug);
|
||||
|
||||
if (!article) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
return (
|
||||
// <article className="prose prose-invert prose-blue max-w-4xl mx-auto p-6 md:p-12 min-h-screen">
|
||||
// <header className="mb-8 border-b border-zinc-800 pb-6">
|
||||
// <h1 className="text-4xl font-extrabold text-white mb-2 m-0">{article.title}</h1>
|
||||
// {article.updatedAt && (
|
||||
// <p className="text-zinc-500 text-sm m-0">Zuletzt aktualisiert: {article.updatedAt}</p>
|
||||
// )}
|
||||
// </header>
|
||||
|
||||
// <MDXRemote
|
||||
// source={article.rawContent}
|
||||
// components={mdxComponents}
|
||||
// options={mdxOptions as any}
|
||||
// />
|
||||
// </article>
|
||||
<Article title={article.title} updatedAt={article.updatedAt}>
|
||||
<MDXRemote
|
||||
source={article.rawContent}
|
||||
components={mdxComponents}
|
||||
options={mdxOptions as any}
|
||||
/>
|
||||
</Article>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { getAllApis } from "@/lib/wiki";
|
||||
import Article from '@/components/wiki/Article';
|
||||
import { API } from '@/components/mdx-components';
|
||||
|
||||
export default async function Page() {
|
||||
const allApis = await getAllApis();
|
||||
|
||||
// Gruppiert die APIs nach ihrer Kategorie
|
||||
const groupedApis = Object.groupBy(allApis, (api) => api.category);
|
||||
|
||||
return (
|
||||
<Article title="API-Endpunkte">
|
||||
{Object.entries(groupedApis).map(([category, apis]) => (
|
||||
<div key={category} className="mb-10">
|
||||
{/* Kategorie-Überschrift wird nur EINMAL pro Kategorie gerendert */}
|
||||
<h2 className="text-2xl font-bold text-white mt-10 mb-4 border-b border-zinc-800 pb-2">
|
||||
{category}
|
||||
</h2>
|
||||
|
||||
{/* Routen innerhalb dieser Kategorie durchgehen */}
|
||||
{apis?.map((api, index) => (
|
||||
<div key={index} className="my-4">
|
||||
{api.methods.map((method, mIndex) => (
|
||||
<API route={api.route} method={method.method} key={mIndex}>
|
||||
{method.description}
|
||||
</API>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</Article>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import Article from "@/components/wiki/Article";
|
||||
import { getAllWikiPages } from "@/lib/wiki";
|
||||
|
||||
export default async function WikiIndexPage() {
|
||||
const allPages = await getAllWikiPages();
|
||||
return (
|
||||
<Article title="Wiki">
|
||||
<div className="flex flex-col gap-2">
|
||||
{allPages.map(({ title, path }) => (
|
||||
<a key={path} href={`/wiki/${path}`} className="hover:underline">
|
||||
{title}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</Article>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user