mirror of
https://github.com/Xevion/100prisoners.git
synced 2025-12-17 06:11:10 -06:00
Dynamic box count with useTailwindBreakpoint hook, adjust BoxLoop padding
This commit is contained in:
@@ -39,7 +39,7 @@ const BoxLoop: FunctionComponent<BoxLoopProps> = ({count}: BoxLoopProps) => {
|
||||
return createLoop([1, 100], count)!;
|
||||
}, [count])
|
||||
|
||||
return <div className="grid gap-x-10 pb-0"
|
||||
return <div className="grid gap-x-10"
|
||||
style={{gridTemplateColumns: `repeat(${count}, minmax(0, 1fr))`}}>
|
||||
{list.map((v, index) => {
|
||||
const [sourceKey, destinationKey] = [`x-${v}`, `x-${loop[v]}`];
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import Chance from "chance";
|
||||
import create from "@kodingdotninja/use-tailwind-breakpoint";
|
||||
import resolveConfig from "tailwindcss/resolveConfig";
|
||||
|
||||
import tailwindConfig from "./../../tailwind.config.cjs";
|
||||
|
||||
const colors = [
|
||||
"#EF4444",
|
||||
@@ -34,4 +38,8 @@ export function sum(a: number, b: number): number {
|
||||
export function getColor(seed: number) {
|
||||
const chance = Chance(seed);
|
||||
return chance.pickone(colors);
|
||||
}
|
||||
}
|
||||
|
||||
const config = resolveConfig(tailwindConfig);
|
||||
|
||||
export const {useBreakpoint, useBreakpointValue} = create(config.theme!.screens);
|
||||
Reference in New Issue
Block a user