-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtailwind.config.ts
More file actions
205 lines (197 loc) · 6.93 KB
/
tailwind.config.ts
File metadata and controls
205 lines (197 loc) · 6.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
import type { Config } from "tailwindcss";
import fs from "fs";
import path from "path";
// Minecraft image directories
const BLOCK_DIR = "imgs/blocks";
const ITEM_DIR = "imgs/items";
const PAINTING_DIR = "imgs/paintings";
const BLOCK_SPACING_MAX = 99;
const background_obj: Record<string, string> = {};
const spacing_obj: Record<string, string> = {};
// Helper to safely read directories
const safeReadDir = (dirPath: string): string[] => {
try {
return fs.readdirSync(path.join(process.cwd(), "public", dirPath));
} catch (e) {
console.warn(`Could not read directory: public/${dirPath}`);
return [];
}
};
// 1. Generate Block Backgrounds (e.g., 'bg-block-stone')
safeReadDir(BLOCK_DIR).forEach((file) => {
if (file.startsWith(".")) return;
const name = `block-${file.split(".")[0]}`;
background_obj[name] = `url('/${BLOCK_DIR}/${file}')`;
});
// 2. Generate Item Backgrounds (e.g., 'bg-item-diamond')
safeReadDir(ITEM_DIR).forEach((file) => {
if (file.startsWith(".")) return;
const name = `item-${file.split(".")[0]}`;
background_obj[name] = `url('/${ITEM_DIR}/${file}')`;
});
// 3. Generate Painting Backgrounds
safeReadDir(PAINTING_DIR).forEach((file) => {
if (file.startsWith(".")) return;
const name = `painting-${file.split(".")[0]}`;
background_obj[name] = `url('/${PAINTING_DIR}/${file}')`;
});
// 4. Generate Spacings (e.g., 'h-1-block', 'w-4-block')
Array.from({ length: BLOCK_SPACING_MAX }, (_, i) => i + 1).forEach((i) => {
spacing_obj[`${i}-block`] = `calc(var(--block-size) * ${i})`;
});
export default {
darkMode: ["class"],
content: ["./pages/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}", "./app/**/*.{ts,tsx}", "./src/**/*.{ts,tsx}"],
prefix: "",
theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px",
},
},
extend: {
fontFamily: {
pixel: ['"Press Start 2P"', 'cursive'],
retro: ['VT323', 'monospace'],
body: ['"Silkscreen"', 'cursive'],
minecraft: ['Minecraft', 'Arial', 'sans-serif'],
minecrafter: ['Minecrafter', 'Minecraft', 'Arial', 'sans-serif'],
mono: ['Monocraft', 'monospace'],
},
colors: {
border: "hsl(var(--border))",
"border-light": "hsl(var(--border-light))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
glow: "hsl(var(--primary-glow))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
gold: {
DEFAULT: "hsl(var(--gold))",
foreground: "hsl(var(--gold-foreground))",
},
creeper: "hsl(var(--creeper))",
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
sidebar: {
DEFAULT: "hsl(var(--sidebar-background))",
foreground: "hsl(var(--sidebar-foreground))",
primary: "hsl(var(--sidebar-primary))",
"primary-foreground": "hsl(var(--sidebar-primary-foreground))",
accent: "hsl(var(--sidebar-accent))",
"accent-foreground": "hsl(var(--sidebar-accent-foreground))",
border: "hsl(var(--sidebar-border))",
ring: "hsl(var(--sidebar-ring))",
},
mc: {
grass: "#4CAF50",
dirt: "#8D6E63",
stone: "#1F1F1F",
diamond: "#4EE6D6",
night: "#0B0E1A",
bg: "#050505",
},
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)",
},
backgroundImage: {
sign: "url('/imgs/ui/sign.png')",
...background_obj, // Injects generated block, item, and painting classes
},
spacing: {
"1/16-block": "calc(var(--block-size) / 16)",
"1/8-block": "calc(var(--block-size) / 8)",
"1/2-block": "calc(var(--block-size) / 2)",
...spacing_obj, // Injects generated block spacing (1-block to 99-block)
},
keyframes: {
"accordion-down": {
from: { height: "0" },
to: { height: "var(--radix-accordion-content-height)" },
},
"accordion-up": {
from: { height: "var(--radix-accordion-content-height)" },
to: { height: "0" },
},
float: {
"0%, 100%": { transform: "translateY(0px) rotate(0deg)" },
"50%": { transform: "translateY(-20px) rotate(5deg)" },
},
"float-delayed": {
"0%, 100%": { transform: "translateY(0px) rotate(0deg)" },
"50%": { transform: "translateY(-15px) rotate(-3deg)" },
},
"block-place": {
"0%": { transform: "scale(0) rotate(-10deg)", opacity: "0" },
"50%": { transform: "scale(1.2) rotate(5deg)" },
"100%": { transform: "scale(1) rotate(0deg)", opacity: "1" },
},
"pixel-fade-in": {
"0%": { opacity: "0", transform: "translateY(20px)" },
"100%": { opacity: "1", transform: "translateY(0)" },
},
shimmer: {
"0%": { backgroundPosition: "-200% 0" },
"100%": { backgroundPosition: "200% 0" },
},
pulse: {
"0%, 100%": { opacity: "1" },
"50%": { opacity: "0.5" },
},
bounce: {
"0%, 100%": { transform: "translateY(0)" },
"50%": { transform: "translateY(-10px)" },
},
},
animation: {
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
float: "float 6s ease-in-out infinite",
"float-delayed": "float-delayed 5s ease-in-out infinite 1s",
"block-place": "block-place 0.4s cubic-bezier(0.34, 1.56, 0.64, 1)",
"pixel-fade-in": "pixel-fade-in 0.5s ease-out forwards",
shimmer: "shimmer 2s linear infinite",
pulse: "pulse 2s ease-in-out infinite",
bounce: "bounce 1s ease-in-out infinite",
},
boxShadow: {
pixel: "4px 4px 0px 0px hsl(0 0% 0% / 0.5)",
"pixel-sm": "2px 2px 0px 0px hsl(0 0% 0% / 0.5)",
glow: "0 0 20px hsl(var(--primary-glow) / 0.4)",
"glow-gold": "0 0 20px hsl(var(--gold) / 0.4)",
},
},
},
plugins: [require("tailwindcss-animate")],
} satisfies Config;