feat: started working on waybar
This commit is contained in:
@@ -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
4
src/utils/react.ts
Normal 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));
|
||||
Reference in New Issue
Block a user