Merge branch 'develop' for 0.4
This commit is contained in:
commit
ef8a3fe419
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "buzzword-bingo",
|
||||
"version": "0.3.2",
|
||||
"version": "0.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "buzzword-bingo",
|
||||
"version": "0.3.2",
|
||||
"version": "0.4",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
@ -13,7 +13,7 @@ export default function Bingo({size, items}: Props){
|
||||
rows[i] = activeItems.slice(i * size, (i + 1) * size);
|
||||
}
|
||||
return(
|
||||
<table className='w-1/2 table table-xs sm:table-sm md:table-md bg-primary text-primary-content m-auto'>
|
||||
<table className='table table-xs bg-primary text-primary-content m-auto'>
|
||||
<tbody>
|
||||
{rows.map((item, index) => <BingoRow key={index} items={item}/>)}
|
||||
</tbody>
|
||||
|
@ -15,13 +15,35 @@ function FisherYatesShuffle(array:string[]):string[]{
|
||||
}
|
||||
|
||||
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);
|
||||
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-3/4 flex flex-col m-auto gap-4">
|
||||
<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)}/>
|
||||
|
@ -9,6 +9,6 @@ export default function BingoItem({text}: Props){
|
||||
const [clicked, setClicked] = React.useState(false);
|
||||
|
||||
return(
|
||||
<td><a className={clsx("btn btn-xs sm:btn-sm md:btn-md w-full", {"btn-ghost":(!clicked)}, {"btn-accent":clicked})} onClick={() => setClicked(!clicked)}>{text}</a></td>
|
||||
<td><a className={clsx("btn btn-xs w-full overflow-hidden", {"btn-ghost":(!clicked)}, {"btn-accent":clicked})} onClick={() => setClicked(!clicked)}>{text}</a></td>
|
||||
);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ export default function ThemeSwitcher(){
|
||||
React.useEffect(() => {document.body.setAttribute("data-theme", theme)});
|
||||
|
||||
return(
|
||||
<ul className="p-2 right-0 text-base-content z-10">
|
||||
<ul className="p-2 right-0 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>
|
||||
|
@ -16,22 +16,27 @@ 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="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 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>
|
||||
<main className="flex flex-col flex-1">
|
||||
{children}
|
||||
|
Loading…
Reference in New Issue
Block a user