"use client";
import { cn } from "@/lib/utils";
import { ButtonHTMLAttributes, useEffect, useRef } from "react";
const PIXEL_SIZE = 4;
const MIN_PIXEL_SIZE = 1;
const MAX_PIXEL_SIZE = 32;
const BAYER: ReadonlyArray<ReadonlyArray<number>> = [
[16, 8, 14, 6],
[5, 12, 2, 10],
[13, 4, 15, 7],
[1, 9, 3, 11],
];
function parseRgb(input: string): [number, number, number] {
const match = input.match(/\d+(?:\.\d+)?/g);
if (!match || match.length < 3) return [0, 0, 0];
return [Number(match[0]), Number(match[1]), Number(match[2])];
}
function parseHex(input: string): [number, number, number] | null {
const hex = input.trim().replace(/^#/, "");
if (hex.length === 3) {
const r = parseInt(hex[0] + hex[0], 16);
const g = parseInt(hex[1] + hex[1], 16);
const b = parseInt(hex[2] + hex[2], 16);
if ([r, g, b].some(Number.isNaN)) return null;
return [r, g, b];
}
if (hex.length === 6) {
const r = parseInt(hex.slice(0, 2), 16);
const g = parseInt(hex.slice(2, 4), 16);
const b = parseInt(hex.slice(4, 6), 16);
if ([r, g, b].some(Number.isNaN)) return null;
return [r, g, b];
}
return null;
}
export type DitherButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
children: React.ReactNode;
ditherColor?: string;
ditherOpacity?: number;
ditherSize?: number;
};
function DitherButton({
children,
className,
ditherColor = "#999999",
ditherOpacity = 1,
ditherSize = PIXEL_SIZE,
...props
}: DitherButtonProps) {
const canvasRef = useRef<HTMLCanvasElement>(null);
const colorOverrideRef = useRef<[number, number, number] | null>(null);
const pixelSizeRef = useRef<number>(PIXEL_SIZE);
useEffect(() => {
colorOverrideRef.current = ditherColor ? parseHex(ditherColor) : null;
}, [ditherColor]);
useEffect(() => {
const clamped = Math.max(
MIN_PIXEL_SIZE,
Math.min(MAX_PIXEL_SIZE, Math.round(ditherSize)),
);
pixelSizeRef.current = clamped;
const canvas = canvasRef.current;
if (!canvas) return;
const rect = canvas.getBoundingClientRect();
const w = Math.max(1, Math.floor(rect.width / clamped));
const h = Math.max(1, Math.floor(rect.height / clamped));
if (canvas.width !== w) canvas.width = w;
if (canvas.height !== h) canvas.height = h;
}, [ditherSize]);
useEffect(() => {
const canvas = canvasRef.current;
if (!canvas) return;
const ctx = canvas.getContext("2d");
if (!ctx) return;
const reduceMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)",
).matches;
let rafId = 0;
const start = performance.now();
const resize = () => {
const rect = canvas.getBoundingClientRect();
const ps = pixelSizeRef.current;
const w = Math.max(1, Math.floor(rect.width / ps));
const h = Math.max(1, Math.floor(rect.height / ps));
if (canvas.width !== w) canvas.width = w;
if (canvas.height !== h) canvas.height = h;
};
resize();
const ro = new ResizeObserver(resize);
ro.observe(canvas);
const draw = (timeSec: number) => {
const w = canvas.width;
const h = canvas.height;
const computed = getComputedStyle(canvas);
const override = colorOverrideRef.current;
const [fr, fg, fb] = override ?? parseRgb(computed.color);
const [br, bg, bb] = parseRgb(
computed.getPropertyValue("background-color") || "rgb(255,255,255)",
);
const angle = Math.sin(timeSec * 0.4545) * 0.112;
const dx = -Math.sin(angle);
const dy = Math.cos(angle);
const img = ctx.createImageData(w, h);
const data = img.data;
const cx = w / 2;
const cy = h / 2;
for (let py = 0; py < h; py++) {
for (let px = 0; px < w; px++) {
const ps = pixelSizeRef.current;
const posX = (px - cx) * ps;
const posY = (py - cy) * ps;
const value =
Math.sin((posX * dx + posY * dy) * 0.048 - timeSec * 1.412) * 0.5 +
0.5;
const threshold = BAYER[py & 3][px & 3] / 17;
const on = value < threshold;
const i = (py * w + px) * 4;
if (on) {
data[i] = fr;
data[i + 1] = fg;
data[i + 2] = fb;
data[i + 3] = 255;
} else {
data[i] = br;
data[i + 1] = bg;
data[i + 2] = bb;
data[i + 3] = 255;
}
}
}
ctx.putImageData(img, 0, 0);
};
if (reduceMotion) {
draw(0);
return () => ro.disconnect();
}
const loop = (now: number) => {
draw((now - start) / 1000);
rafId = requestAnimationFrame(loop);
};
rafId = requestAnimationFrame(loop);
return () => {
cancelAnimationFrame(rafId);
ro.disconnect();
};
}, []);
return (
<button
{...props}
className={cn(
"group relative inline-flex items-center justify-center overflow-hidden rounded-md border-2 border-foreground bg-background px-7 py-3 font-mono text-sm font-bold uppercase tracking-wider text-foreground transition-transform active:translate-y-0.5 active:scale-[0.99]",
className,
)}
>
<canvas
ref={canvasRef}
aria-hidden
style={{ opacity: ditherOpacity }}
className="pointer-events-none absolute inset-0 size-full text-foreground [image-rendering:pixelated]"
/>
<span className="relative z-10 [text-shadow:1px_1px_0_var(--color-background),-1px_1px_0_var(--color-background),1px_-1px_0_var(--color-background),-1px_-1px_0_var(--color-background),0_2px_0_var(--color-background),0_-2px_0_var(--color-background),2px_0_0_var(--color-background),-2px_0_0_var(--color-background)]">
{children}
</span>
</button>
);
}
export default DitherButton;
DitherButton
By jay sharma
Try the interaction, copy the React source files, or download the complete example.
About DitherButton
DitherButton is an animated React and Tailwind CSS button by jay sharma. Try the interaction, copy the React source, or download the example with creator credit.
- Effects and categories
- Hover effects, Animated
- Using this example
- Copy a TSX file or download the original source and standalone demo. Test keyboard focus, motion and contrast in your own project.
Usage, Tailwind and licensing questions
Read the source files
import-examples/dither-button.tsx
import DitherButton from "@/components/evil-buttons/dither-button";
export function ButtonDemo() {
return <DitherButton>Launch</DitherButton>;
}
components/evil-buttons/dither-button.tsx
"use client";
import { cn } from "@/lib/utils";
import { ButtonHTMLAttributes, useEffect, useRef } from "react";
const PIXEL_SIZE = 4;
const MIN_PIXEL_SIZE = 1;
const MAX_PIXEL_SIZE = 32;
const BAYER: ReadonlyArray<ReadonlyArray<number>> = [
[16, 8, 14, 6],
[5, 12, 2, 10],
[13, 4, 15, 7],
[1, 9, 3, 11],
];
function parseRgb(input: string): [number, number, number] {
const match = input.match(/\d+(?:\.\d+)?/g);
if (!match || match.length < 3) return [0, 0, 0];
return [Number(match[0]), Number(match[1]), Number(match[2])];
}
function parseHex(input: string): [number, number, number] | null {
const hex = input.trim().replace(/^#/, "");
if (hex.length === 3) {
const r = parseInt(hex[0] + hex[0], 16);
const g = parseInt(hex[1] + hex[1], 16);
const b = parseInt(hex[2] + hex[2], 16);
if ([r, g, b].some(Number.isNaN)) return null;
return [r, g, b];
}
if (hex.length === 6) {
const r = parseInt(hex.slice(0, 2), 16);
const g = parseInt(hex.slice(2, 4), 16);
const b = parseInt(hex.slice(4, 6), 16);
if ([r, g, b].some(Number.isNaN)) return null;
return [r, g, b];
}
return null;
}
export type DitherButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
children: React.ReactNode;
ditherColor?: string;
ditherOpacity?: number;
ditherSize?: number;
};
function DitherButton({
children,
className,
ditherColor = "#999999",
ditherOpacity = 1,
ditherSize = PIXEL_SIZE,
...props
}: DitherButtonProps) {
const canvasRef = useRef<HTMLCanvasElement>(null);
const colorOverrideRef = useRef<[number, number, number] | null>(null);
const pixelSizeRef = useRef<number>(PIXEL_SIZE);
useEffect(() => {
colorOverrideRef.current = ditherColor ? parseHex(ditherColor) : null;
}, [ditherColor]);
useEffect(() => {
const clamped = Math.max(
MIN_PIXEL_SIZE,
Math.min(MAX_PIXEL_SIZE, Math.round(ditherSize)),
);
pixelSizeRef.current = clamped;
const canvas = canvasRef.current;
if (!canvas) return;
const rect = canvas.getBoundingClientRect();
const w = Math.max(1, Math.floor(rect.width / clamped));
const h = Math.max(1, Math.floor(rect.height / clamped));
if (canvas.width !== w) canvas.width = w;
if (canvas.height !== h) canvas.height = h;
}, [ditherSize]);
useEffect(() => {
const canvas = canvasRef.current;
if (!canvas) return;
const ctx = canvas.getContext("2d");
if (!ctx) return;
const reduceMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)",
).matches;
let rafId = 0;
const start = performance.now();
const resize = () => {
const rect = canvas.getBoundingClientRect();
const ps = pixelSizeRef.current;
const w = Math.max(1, Math.floor(rect.width / ps));
const h = Math.max(1, Math.floor(rect.height / ps));
if (canvas.width !== w) canvas.width = w;
if (canvas.height !== h) canvas.height = h;
};
resize();
const ro = new ResizeObserver(resize);
ro.observe(canvas);
const draw = (timeSec: number) => {
const w = canvas.width;
const h = canvas.height;
const computed = getComputedStyle(canvas);
const override = colorOverrideRef.current;
const [fr, fg, fb] = override ?? parseRgb(computed.color);
const [br, bg, bb] = parseRgb(
computed.getPropertyValue("background-color") || "rgb(255,255,255)",
);
const angle = Math.sin(timeSec * 0.4545) * 0.112;
const dx = -Math.sin(angle);
const dy = Math.cos(angle);
const img = ctx.createImageData(w, h);
const data = img.data;
const cx = w / 2;
const cy = h / 2;
for (let py = 0; py < h; py++) {
for (let px = 0; px < w; px++) {
const ps = pixelSizeRef.current;
const posX = (px - cx) * ps;
const posY = (py - cy) * ps;
const value =
Math.sin((posX * dx + posY * dy) * 0.048 - timeSec * 1.412) * 0.5 +
0.5;
const threshold = BAYER[py & 3][px & 3] / 17;
const on = value < threshold;
const i = (py * w + px) * 4;
if (on) {
data[i] = fr;
data[i + 1] = fg;
data[i + 2] = fb;
data[i + 3] = 255;
} else {
data[i] = br;
data[i + 1] = bg;
data[i + 2] = bb;
data[i + 3] = 255;
}
}
}
ctx.putImageData(img, 0, 0);
};
if (reduceMotion) {
draw(0);
return () => ro.disconnect();
}
const loop = (now: number) => {
draw((now - start) / 1000);
rafId = requestAnimationFrame(loop);
};
rafId = requestAnimationFrame(loop);
return () => {
cancelAnimationFrame(rafId);
ro.disconnect();
};
}, []);
return (
<button
{...props}
className={cn(
"group relative inline-flex items-center justify-center overflow-hidden rounded-md border-2 border-foreground bg-background px-7 py-3 font-mono text-sm font-bold uppercase tracking-wider text-foreground transition-transform active:translate-y-0.5 active:scale-[0.99]",
className,
)}
>
<canvas
ref={canvasRef}
aria-hidden
style={{ opacity: ditherOpacity }}
className="pointer-events-none absolute inset-0 size-full text-foreground [image-rendering:pixelated]"
/>
<span className="relative z-10 [text-shadow:1px_1px_0_var(--color-background),-1px_1px_0_var(--color-background),1px_-1px_0_var(--color-background),-1px_-1px_0_var(--color-background),0_2px_0_var(--color-background),0_-2px_0_var(--color-background),2px_0_0_var(--color-background),-2px_0_0_var(--color-background)]">
{children}
</span>
</button>
);
}
export default DitherButton;
lib/utils.ts
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
demo.tsx
export { ButtonDemo as default } from "@/import-examples/dither-button";CSS
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
@layer properties;
@layer theme, base, components, utilities;
@layer theme {
:root, :host {
--spacing: 0.25rem;
--text-sm: 0.875rem;
--text-sm--line-height: calc(1.25 / 0.875);
--font-weight-bold: 700;
--tracking-wider: 0.05em;
--default-transition-duration: 150ms;
--default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
--default-font-family: var(--font-geist-sans), ui-sans-serif, system-ui, sans-serif;
--default-mono-font-family: var(--font-geist-mono);
--color-background: var(--background);
}
}
@layer base {
*, ::after, ::before, ::backdrop, ::file-selector-button {
box-sizing: border-box;
margin: 0;
padding: 0;
border: 0 solid;
}
html, :host {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
tab-size: 4;
font-family: var(--default-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
font-feature-settings: var(--default-font-feature-settings, normal);
font-variation-settings: var(--default-font-variation-settings, normal);
-webkit-tap-highlight-color: transparent;
}
hr {
height: 0;
color: inherit;
border-top-width: 1px;
}
abbr:where([title]) {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
h1, h2, h3, h4, h5, h6 {
font-size: inherit;
font-weight: inherit;
}
a {
color: inherit;
-webkit-text-decoration: inherit;
text-decoration: inherit;
}
b, strong {
font-weight: bolder;
}
code, kbd, samp, pre {
font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
font-feature-settings: var(--default-mono-font-feature-settings, normal);
font-variation-settings: var(--default-mono-font-variation-settings, normal);
font-size: 1em;
}
small {
font-size: 80%;
}
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
table {
text-indent: 0;
border-color: inherit;
border-collapse: collapse;
}
:-moz-focusring:where(:not(iframe)) {
outline: auto;
}
progress {
vertical-align: baseline;
}
summary {
display: list-item;
}
ol, ul, menu {
list-style: none;
}
img, svg, video, canvas, audio, iframe, embed, object {
display: block;
vertical-align: middle;
}
img, video {
max-width: 100%;
height: auto;
}
button, input, select, optgroup, textarea, ::file-selector-button {
font: inherit;
font-feature-settings: inherit;
font-variation-settings: inherit;
letter-spacing: inherit;
color: inherit;
border-radius: 0;
background-color: transparent;
opacity: 1;
}
:where(select:is([multiple], [size])) optgroup {
font-weight: bolder;
}
:where(select:is([multiple], [size])) optgroup option {
padding-inline-start: 20px;
}
::file-selector-button {
margin-inline-end: 4px;
}
::placeholder {
opacity: 1;
}
@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
::placeholder {
color: currentcolor;
@supports (color: color-mix(in lab, red, red)) {
color: color-mix(in oklab, currentcolor 50%, transparent);
}
}
}
textarea {
resize: vertical;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-date-and-time-value {
min-height: 1lh;
text-align: inherit;
}
::-webkit-datetime-edit {
display: inline-flex;
}
::-webkit-datetime-edit-fields-wrapper {
padding: 0;
}
::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
padding-block: 0;
}
::-webkit-calendar-picker-indicator {
line-height: 1;
}
:-moz-ui-invalid {
box-shadow: none;
}
button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
appearance: button;
}
::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
height: auto;
}
[hidden]:where(:not([hidden="until-found"])) {
display: none !important;
}
}
@layer utilities {
.pointer-events-none {
pointer-events: none;
}
.absolute {
position: absolute;
}
.relative {
position: relative;
}
.inset-0 {
inset: 0px;
}
.z-10 {
z-index: 10;
}
.inline-flex {
display: inline-flex;
}
.size-full {
width: 100%;
height: 100%;
}
.resize {
resize: both;
}
.items-center {
align-items: center;
}
.justify-center {
justify-content: center;
}
.overflow-hidden {
overflow: hidden;
}
.rounded-md {
border-radius: calc(var(--radius) * 0.8);
}
.border-2 {
border-style: var(--tw-border-style);
border-width: 2px;
}
.border-foreground {
border-color: var(--foreground);
}
.bg-background {
background-color: var(--background);
}
.px-7 {
padding-inline: calc(var(--spacing) * 7);
}
.py-3 {
padding-block: calc(var(--spacing) * 3);
}
.font-mono {
font-family: var(--font-geist-mono);
}
.text-sm {
font-size: var(--text-sm);
line-height: var(--tw-leading, var(--text-sm--line-height));
}
.font-bold {
--tw-font-weight: var(--font-weight-bold);
font-weight: var(--font-weight-bold);
}
.tracking-wider {
--tw-tracking: var(--tracking-wider);
letter-spacing: var(--tracking-wider);
}
.text-foreground {
color: var(--foreground);
}
.uppercase {
text-transform: uppercase;
}
.transition-transform {
transition-property: transform, translate, scale, rotate;
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
transition-duration: var(--tw-duration, var(--default-transition-duration));
}
.\[image-rendering\:pixelated\] {
image-rendering: pixelated;
}
.\[text-shadow\:1px_1px_0_var\(--color-background\)\,-1px_1px_0_var\(--color-background\)\,1px_-1px_0_var\(--color-background\)\,-1px_-1px_0_var\(--color-background\)\,0_2px_0_var\(--color-background\)\,0_-2px_0_var\(--color-background\)\,2px_0_0_var\(--color-background\)\,-2px_0_0_var\(--color-background\)\] {
text-shadow: 1px 1px 0 var(--color-background),-1px 1px 0 var(--color-background),1px -1px 0 var(--color-background),-1px -1px 0 var(--color-background),0 2px 0 var(--color-background),0 -2px 0 var(--color-background),2px 0 0 var(--color-background),-2px 0 0 var(--color-background);
}
.active\:translate-y-0\.5:active {
--tw-translate-y: calc(var(--spacing) * 0.5);
translate: var(--tw-translate-x) var(--tw-translate-y);
}
.active\:scale-\[0\.99\]:active {
scale: 0.99;
}
}
:root {
--background: #fff;
--foreground: #111;
--primary: #171717;
--primary-foreground: #fff;
--secondary: #eee;
--secondary-foreground: #171717;
--muted: #eee;
--muted-foreground: #666;
--accent: #eee;
--accent-foreground: #171717;
--border: #ddd;
--input: #ddd;
--ring: #777;
--destructive: #dc2626;
--destructive-foreground: #fff;
--popover: #fff;
--popover-foreground: #111;
--success: #15803d;
--success-foreground: #fff;
--radius: .625rem;
--hairline: 1px;
}
.dark {
--background: #090909;
--foreground: #fafafa;
--primary: #fafafa;
--primary-foreground: #171717;
--secondary: #262626;
--secondary-foreground: #fafafa;
--muted: #262626;
--muted-foreground: #a3a3a3;
--accent: #262626;
--accent-foreground: #fafafa;
--border: #333;
--input: #333;
--popover: #171717;
--popover-foreground: #fafafa;
}
:root {
--card: oklch(1 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--border: oklch(0.922 0 0);
--primary: oklch(0.205 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--radius: 0.625rem;
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--chrome: oklch(0.967 0 0);
--brand: oklch(0.6 0.23 29);
--chart-background: oklch(1 0 0);
--chart-foreground: oklch(0.145 0.004 285);
--chart-foreground-muted: oklch(0.55 0.014 260);
--chart-line-primary: var(--chart-1);
--chart-line-secondary: var(--chart-2);
--chart-crosshair: oklch(0.4 0.1828 274.34);
--chart-grid: oklch(0.9 0 0);
--chart-brush-border: var(--chart-grid);
--chart-tooltip-background: oklch(0.21 0.006 285 / 0.8);
--chart-tooltip-foreground: oklch(0.985 0 0);
--chart-tooltip-muted: oklch(0.65 0.01 260);
--chart-marker-background: oklch(0.97 0.005 260);
--chart-marker-border: oklch(0.85 0.01 260);
--chart-marker-foreground: oklch(0.3 0.01 260);
--chart-label: oklch(0.45 0.01 260);
--chart-scale-01: oklch(0.98 0.003 106);
--chart-scale-02: oklch(0.92 0.008 106);
--chart-scale-03: oklch(0.82 0.015 106);
--chart-scale-04: oklch(0.68 0.02 106);
--chart-scale-05: oklch(0.55 0.025 106);
--chart-scale-pattern-color: oklch(0.96 0.005 106);
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--chrome: oklch(0.18 0 0);
--card: oklch(0.205 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--border: oklch(1 0 0 / 10%);
--primary: oklch(0.922 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.922 0 0);
--sidebar-primary-foreground: oklch(0.205 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
--brand: oklch(0.66 0.23 32);
--chart-background: oklch(0.145 0 0);
--chart-foreground: oklch(0.45 0 0);
--chart-foreground-muted: oklch(0.65 0.01 260);
--chart-crosshair: oklch(0.45 0 0);
--chart-grid: oklch(0.25 0 0);
--chart-brush-border: var(--chart-grid);
--chart-marker-background: oklch(0.25 0.01 260);
--chart-marker-border: oklch(0.4 0.01 260);
--chart-marker-foreground: oklch(0.9 0 0);
--chart-label: oklch(0.75 0.01 260);
--chart-scale-01: oklch(0.28 0.03 270);
--chart-scale-02: oklch(0.38 0.04 270);
--chart-scale-03: oklch(0.48 0.05 270);
--chart-scale-04: oklch(0.58 0.06 270);
--chart-scale-05: oklch(0.68 0.07 270);
--chart-scale-pattern-color: oklch(0.145 0 0);
}
@keyframes docs-dot-swing {
0%, 100% {
transform: translateX(0) scale(1);
}
45% {
transform: translateX(-6px) scale(0.7);
}
}
@keyframes hell-flicker {
0%, 100% {
opacity: 1;
}
41% {
opacity: 0.7;
}
43% {
opacity: 1;
}
77% {
opacity: 0.85;
}
78% {
opacity: 1;
}
}
@keyframes lights-off {
0% {
opacity: 0;
}
15% {
opacity: 1;
}
30% {
opacity: 0.2;
}
45% {
opacity: 1;
}
60% {
opacity: 0.5;
}
70%, 100% {
opacity: 1;
}
}
@keyframes lights-on {
0% {
opacity: 1;
}
20% {
opacity: 0;
}
32% {
opacity: 1;
}
50% {
opacity: 0.1;
}
60% {
opacity: 0.9;
}
75%, 100% {
opacity: 0;
}
}
@keyframes lights-fade {
to {
opacity: 0;
}
}
@keyframes eyes-dim {
from {
opacity: 0;
}
}
@keyframes eyes-open {
from {
opacity: 0;
transform: scaleY(0.05);
}
}
@keyframes eyes-blink {
0%, 92%, 100% {
transform: none;
}
95% {
transform: scaleY(0.08);
}
}
@keyframes crack-life {
0% {
opacity: 0;
transform: scale(0.92);
}
4% {
opacity: 1;
transform: none;
}
80% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes egg-wobble {
0%, 84%, 100% {
transform: none;
}
87% {
transform: rotate(-14deg);
}
90% {
transform: rotate(10deg);
}
93% {
transform: rotate(-6deg);
}
96% {
transform: rotate(3deg);
}
}
@keyframes page-glitch {
0% {
transform: none;
filter: none;
clip-path: none;
}
12% {
transform: translate(-6px, 2px) skewX(-2deg);
filter: hue-rotate(90deg) saturate(3);
}
24% {
transform: translate(5px, -1px);
filter: invert(1) hue-rotate(180deg);
clip-path: inset(18% 0 52% 0);
}
36% {
transform: none;
filter: contrast(2.2) saturate(0);
clip-path: none;
}
48% {
transform: translate(9px, 0) skewX(4deg);
filter: hue-rotate(-60deg);
clip-path: inset(0 0 70% 0);
}
60% {
transform: translate(-3px, 3px);
filter: none;
clip-path: inset(40% 0 20% 0);
}
72% {
transform: translate(2px, -4px) scaleY(1.02);
filter: saturate(4) contrast(1.4);
clip-path: none;
}
86% {
transform: translate(-8px, 0);
filter: invert(1);
clip-path: inset(62% 0 8% 0);
}
}
@keyframes glitch-label {
0% {
transform: translate(0, 0);
opacity: 1;
}
33% {
transform: translate(-4px, 2px);
opacity: 0.6;
}
66% {
transform: translate(5px, -2px);
opacity: 1;
}
}
@keyframes deleted-progress {
from {
width: 0;
}
to {
width: 100%;
}
}
@keyframes deleted-restore {
0%, 70% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes creeper-swell {
0% {
transform: scale(0.3) translateY(40px);
opacity: 0;
filter: none;
}
20% {
transform: scale(1);
opacity: 1;
}
45%, 65%, 85% {
filter: brightness(3) saturate(0);
}
55%, 75% {
filter: none;
}
100% {
transform: scale(1.35);
filter: brightness(4) saturate(0);
}
}
@keyframes creeper-flash {
from {
opacity: 0.85;
}
to {
opacity: 0;
}
}
@property --tw-border-style {
syntax: "*";
inherits: false;
initial-value: solid;
}
@property --tw-font-weight {
syntax: "*";
inherits: false;
}
@property --tw-tracking {
syntax: "*";
inherits: false;
}
@property --tw-translate-x {
syntax: "*";
inherits: false;
initial-value: 0;
}
@property --tw-translate-y {
syntax: "*";
inherits: false;
initial-value: 0;
}
@property --tw-translate-z {
syntax: "*";
inherits: false;
initial-value: 0;
}
@layer properties {
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
*, ::before, ::after, ::backdrop {
--tw-border-style: solid;
--tw-font-weight: initial;
--tw-tracking: initial;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-translate-z: 0;
}
}
}