feat: started working on waybar

This commit is contained in:
Pihkaal
2024-02-08 00:40:51 +01:00
parent e778631828
commit 71ab32c53a
18 changed files with 203 additions and 5 deletions

View File

@@ -3,5 +3,15 @@ export const clamp = (v: number, min: number, max: number): number =>
export const clamp01 = (v: number): number => clamp(v, 0, 1);
export const clamp0 = (v: number): number => clamp(v, 0, v);
export const floorAll = (...xs: Array<number>): Array<number> =>
xs.map(Math.floor);
/**
* Random int in [min, max[
*/
export const randomMinMax = (min: number, max: number): number =>
Math.round(Math.random() * (max - min - 1) + min);
export const randomSign = (): number => Math.sign(randomMinMax(0, 2) - 1);

4
src/utils/react.ts Normal file
View File

@@ -0,0 +1,4 @@
import clsx, { type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export const cn = (...values: Array<ClassValue>) => twMerge(clsx(...values));