Compare commits

..

4 Commits

Author SHA1 Message Date
7bdfdc2fb1 feat: Added lpt buzzwords 2024-02-17 19:05:04 +01:00
e1da756b5c feat: Added DieLinke theme 2024-02-17 19:04:51 +01:00
c0e15bccf3 feat: Improved layout on mobile devices 2024-02-17 19:04:31 +01:00
7d9ca6bdd5 feat: Implemented LPT Bingo 2024-02-17 12:45:53 +01:00
7 changed files with 47 additions and 52 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "buzzword-bingo",
"version": "0.4.0",
"version": "0.3.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "buzzword-bingo",
"version": "0.4.0",
"version": "0.3.2",
"dependencies": {
"next": "14.0.1",
"react": "^18",

View File

@ -1,6 +1,6 @@
{
"name": "buzzword-bingo",
"version": "0.4.0",
"version": "0.3.2",
"private": true,
"scripts": {
"dev": "next dev",

View File

@ -14,39 +14,18 @@ function FisherYatesShuffle(array:string[]):string[]{
return array;
}
export default function BingoController({buzzwords} : {buzzwords?: string[]}){
const [orientation, setOrientation] = React.useState("");
React.useEffect(()=>{
function updateOrientation()
{
setOrientation(window.screen.orientation.type);
}
// init
updateOrientation();
window.addEventListener("orientationchange", updateOrientation);
// destructor
return () => {
window.removeEventListener("orientationchange", updateOrientation);
}
});
const [size, setSize] = React.useState(5);
export default function BingoController({buzzwords, maxSize} : {buzzwords?: string[], maxSize?: number}){
if(maxSize == undefined) maxSize = 5;
const [size, setSize] = React.useState(maxSize!);
if(buzzwords == undefined || buzzwords.length < 1) buzzwords = ["Cloud", "Cyber-[Something]", "Distrupt[ive]", "AI", "Meta [Something]", "Gamification", "Web 2.0/3.0", "Industry 4.0", "Internet of Things", "Multiexperience", "Big Data", "Crypto", "[Something] as a service", "Emerging [Something]", "Streamline", "Ecosystem", "Leverage", "Outside the Box", "Pivot", "Strategic", "Agile", "Smart Tech", "Data Warehouse", "Actionable Insights", "Holistic Approach", "Digital Transformation", "Growth Hacking"];
const [items, setItems] = React.useState(buzzwords);
const sizeError = (items.length < size);
return(
<>
<div className="w-full md:w-3/4 flex flex-col m-auto gap-4">
{orientation != "landscape-primary" && <div role="alert" className="alert alert-info">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" className="stroke-current shrink-0 w-6 h-6"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
<span>Please rotate your device</span>
</div>}
<Bingo size={size} items={items}/>
<form className="w-1/3 m-auto">
<input type="range" min={3} max={5} value={size} className="range range-xs sm:range-sm md:range-md range-secondary" step={1} onChange={({target:{value:s}}) => setSize(+s)}/>
<input type="range" min={3} max={maxSize!} value={size} className="range range-xs sm:range-sm md:range-md range-secondary" step={1} onChange={({target:{value:s}}) => setSize(+s)}/>
<div className="w-full flex justify-between text-sm px-2 mb-2">
<span>3x3</span>
<span>4x4</span>

View File

@ -9,7 +9,7 @@ export default function ThemeSwitcher(){
React.useEffect(() => {document.body.setAttribute("data-theme", theme)});
return(
<ul className="p-2 right-0 z-10">
<ul className="p-2 right-0 text-base-content z-10">
<li><a onClick={() => setTheme("light")}>Light</a></li>
<li><a onClick={() => setTheme("cyberpunk")}>Cyberpunk</a></li>
<li><a onClick={() => setTheme("valentine")}>Valentine</a></li>
@ -19,6 +19,7 @@ export default function ThemeSwitcher(){
<li><a onClick={() => setTheme("synthwave")}><DarkIcon/>Synthwave</a></li>
<li><a onClick={() => setTheme("coffee")}><DarkIcon/>Coffee</a></li>
<li><a onClick={() => setTheme("dim")}><DarkIcon/>Dim</a></li>
<li><a onClick={() => setTheme("dielinke")}>Die Linke</a></li>
</ul>
);
}

View File

@ -16,27 +16,22 @@ export default function RootLayout({
<html lang="en" data-theme="dark">
<body className="bg-base-100 base-content flex flex-col h-screen">
<div className="navbar bg-neutral text-neutral-content">
<div className="navbar-start">
<div className="dropdown">
<div tabIndex={0} role="button" className="btn btn-ghost lg:hidden">
<svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 6h16M4 12h8m-8 6h16" /></svg>
</div>
<ul tabIndex={0} className="menu menu-sm dropdown-content bg-neutral text-neutral-content mt-3 z-[1] p-2 shadow rounded-box w-52">
<li><a href="https://git.datalore.sh/datalore/buzzword-bingo.git" target="_blank">Source Code</a></li>
<li><a>Theme</a><ThemeSwitcher/></li>
</ul>
</div>
<span><b className="normal-case text-xl">Buzzword Bingo</b><span className="text-xs ml-1">v{process.env.npm_package_version}</span></span>
</div>
<div className="navbar-end hidden lg:flex">
<ul className="menu menu-horizontal px-1">
<li><a href="https://git.datalore.sh/datalore/buzzword-bingo.git" target="_blank">Source Code</a></li>
<li><details>
<summary>Theme</summary>
<ThemeSwitcher/>
</details></li>
</ul>
</div>
<div className="flex-1">
<span><b className="normal-case text-xl">Buzzword Bingo</b><span className="text-xs ml-1">v{process.env.npm_package_version}</span></span>
</div>
<div className="flex-none">
<ul className="menu menu-horizontal px-1">
<li>
<a href="https://git.datalore.sh/datalore/buzzword-bingo.git" target="_blank">Source Code</a>
</li>
<li>
<details>
<summary>Theme</summary>
<ThemeSwitcher/>
</details>
</li>
</ul>
</div>
</div>
<main className="flex flex-col flex-1">
{children}

8
src/app/lpt/page.tsx Normal file
View File

@ -0,0 +1,8 @@
import BingoController from '../components/bingocontroller'
export default function Home(){
const buzzwords = ["\"Ohne Frieden ist alles nichts\"", "Wahlordnung muss mehrfach erklärt werden", "Pizza ist da", "Stefan pöbelt", "Mareike pöbelt zurück", "Jemand überzieht die Redezeit", "Machentanz knallt die Tür zu", "GO-Antrag zur Pause", "GO-Antrag zum GO-Antrag", "Doppelte Für-/Gegenreden", "Rita Krüger redet zu Wagenknecht", "Ins Mikrofon schreien", "Karl-Marx-Zitate", "Rosa-Luxemburg-Zitate", "\"Es braucht die Linke\"", "\"In der Tradition von Rosa Luxemburg und Karl Liebknecht\"", "KW sagt \"Ruhe im Saal\""];
return(
<BingoController buzzwords={buzzwords} maxSize={4} />
);
}

View File

@ -7,9 +7,21 @@ const config: Config = {
},
plugins: [require("daisyui")],
daisyui: {
themes: ["light", "dark", "synthwave", "cyberpunk", "valentine", "pastel", "aqua", "coffee", "dim"]
themes: [
{
dielinke: {
"primary": "#ff0000",
"accent": "#6f003c",
"secondary": "#004b5b",
"neutral": "#6f003c",
"base-100": "#f8f8f8",
"--rounded-box": "0",
"--rounded-btn": "0.75rem"
}
},"light", "dark", "synthwave", "cyberpunk", "valentine", "pastel", "aqua", "coffee", "dim"
]
}
};
export default config;