feat: integrate Tailwind CSS with custom theme and animations
Added Tailwind CSS and tw-animate-css imports to globals.css. Introduced a custom dark variant and an extensive @theme inline block with CSS variables for colors, radii, and animations. Included keyframes for shimmer-slide, spin-around, gradient, shine, and background-position-spin to enable consistent theming and dynamic UI effects across the application.
This commit is contained in:
1 parent
55c169bd6e
commit
5c1ccbc69a
67 files changed
+8984
-160
No files matched your search
@@ -0,0 +1,90 @@
|
||||
import { Currency } from "@/types/currency";
|
||||
|
||||
export function formatPrice(value: number, currency: Currency = "gp"): string {
|
||||
if (value >= 1000000) {
|
||||
const millions = value / 1000000;
|
||||
return `${millions.toFixed(1)}kk ${currency}`;
|
||||
}
|
||||
|
||||
if (value >= 1000) {
|
||||
const thousands = value / 1000;
|
||||
return `${thousands.toFixed(0)}k ${currency}`;
|
||||
}
|
||||
|
||||
return `${value.toLocaleString("pt-BR")} ${currency}`;
|
||||
}
|
||||
|
||||
export function convertGpToTc(gp: number): number {
|
||||
return Math.round(gp / 35000); // 1 TC ≈ 35.000 gp
|
||||
}
|
||||
|
||||
export function formatLargeNumber(value: number): string {
|
||||
if (value >= 1000000) {
|
||||
const millions = value / 1000000;
|
||||
return `${millions.toFixed(1)}kk`;
|
||||
}
|
||||
|
||||
if (value >= 1000) {
|
||||
const thousands = value / 1000;
|
||||
return `${thousands.toFixed(0)}k`;
|
||||
}
|
||||
|
||||
return value.toLocaleString("pt-BR");
|
||||
}
|
||||
|
||||
export function formatPriceWithTc(gp: number): string {
|
||||
const tc = convertGpToTc(gp);
|
||||
if (tc >= 1) {
|
||||
return `${formatPrice(gp)} (${tc} TC)`;
|
||||
}
|
||||
return formatPrice(gp);
|
||||
}
|
||||
|
||||
export function getRarityColor(rarity: string): string {
|
||||
switch (rarity) {
|
||||
case "legendary":
|
||||
return "text-orange-500";
|
||||
case "epic":
|
||||
return "text-purple-500";
|
||||
case "rare":
|
||||
return "text-blue-500";
|
||||
case "uncommon":
|
||||
return "text-green-500";
|
||||
case "common":
|
||||
return "text-gray-500";
|
||||
default:
|
||||
return "text-gray-500";
|
||||
}
|
||||
}
|
||||
|
||||
export function getRarityBgColor(rarity: string): string {
|
||||
switch (rarity) {
|
||||
case "legendary":
|
||||
return "bg-orange-500/10";
|
||||
case "epic":
|
||||
return "bg-purple-500/10";
|
||||
case "rare":
|
||||
return "bg-blue-500/10";
|
||||
case "uncommon":
|
||||
return "bg-green-500/10";
|
||||
case "common":
|
||||
return "bg-gray-500/10";
|
||||
default:
|
||||
return "bg-gray-500/10";
|
||||
}
|
||||
}
|
||||
|
||||
export function getRarityGlow(rarity: string): string {
|
||||
switch (rarity) {
|
||||
case "legendary":
|
||||
return "shadow-[0_0_15px_rgba(255,140,0,0.5)]";
|
||||
case "epic":
|
||||
return "shadow-[0_0_15px_rgba(155,89,182,0.5)]";
|
||||
case "rare":
|
||||
return "shadow-[0_0_15px_rgba(52,152,219,0.5)]";
|
||||
case "uncommon":
|
||||
return "shadow-[0_0_15px_rgba(46,204,113,0.5)]";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user