-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestionPatterns.ts
More file actions
213 lines (209 loc) · 8.02 KB
/
Copy pathquestionPatterns.ts
File metadata and controls
213 lines (209 loc) · 8.02 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
206
207
208
209
210
211
212
213
export interface QuestionPattern {
id: string;
title: string;
html: string;
difficulty: "beginner" | "intermediate" | "advanced";
}
export const questionPatterns: QuestionPattern[] = [
{
id: "Q1",
title: "Half Circle",
difficulty: "beginner",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="relative h-[150px] w-[300px] rounded-full bg-blue-500 text-white">
<div class="absolute bottom-[5px] left-[5px] h-[calc(100%-10px)] w-[calc(50%-10px)] rounded-full border-2 border-white bg-white"></div>
</div>
</div>`,
},
{
id: "Q2",
title: "Horizontal Stripes",
difficulty: "beginner",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[200px] w-[200px]" style="background: repeating-linear-gradient(0deg, #3b82f6 0px, #3b82f6 20px, #ef4444 20px, #ef4444 40px);"></div>
</div>`,
},
{
id: "Q3",
title: "Checkerboard",
difficulty: "beginner",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[200px] w-[200px]" style="background-color: #fff; background-image: linear-gradient(45deg, #000 25%, transparent 25%), linear-gradient(-45deg, #000 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #000 75%), linear-gradient(-45deg, transparent 75%, #000 75%); background-size: 50px 50px; background-position: 0 0, 0 25px, 25px -25px, -25px 0px;"></div>
</div>`,
},
{
id: "Q4",
title: "Centered Square",
difficulty: "beginner",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[100px] w-[100px] bg-purple-500"></div>
</div>`,
},
{
id: "Q5",
title: "Circle with Border",
difficulty: "beginner",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[120px] w-[120px] rounded-full border-8 border-green-500 bg-yellow-300"></div>
</div>`,
},
{
id: "Q6",
title: "Gradient Background",
difficulty: "beginner",
html: `<div class="flex h-full w-full items-center justify-center" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);">
<div class="text-4xl font-bold text-white">CSS</div>
</div>`,
},
{
id: "Q7",
title: "Dotted Pattern",
difficulty: "intermediate",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[200px] w-[200px]" style="background-color: #fff; background-image: radial-gradient(circle, #000 2px, transparent 2px); background-size: 20px 20px;"></div>
</div>`,
},
{
id: "Q8",
title: "Overlapping Circles",
difficulty: "intermediate",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="relative h-[150px] w-[150px]">
<div class="absolute top-0 left-0 h-[100px] w-[100px] rounded-full bg-red-500 opacity-70"></div>
<div class="absolute top-[50px] left-[50px] h-[100px] w-[100px] rounded-full bg-blue-500 opacity-70"></div>
</div>
</div>`,
},
{
id: "Q9",
title: "Border Radius Mix",
difficulty: "intermediate",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[150px] w-[150px] bg-orange-400" style="border-radius: 50% 0 50% 0;"></div>
</div>`,
},
{
id: "Q10",
title: "Triangle",
difficulty: "intermediate",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-0 w-0" style="border-left: 75px solid transparent; border-right: 75px solid transparent; border-bottom: 130px solid #10b981;"></div>
</div>`,
},
{
id: "Q11",
title: "Vertical Stripes",
difficulty: "intermediate",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[200px] w-[200px]" style="background: repeating-linear-gradient(90deg, #fbbf24 0px, #fbbf24 30px, #f87171 30px, #f87171 60px);"></div>
</div>`,
},
{
id: "Q12",
title: "Box Shadow Layers",
difficulty: "intermediate",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[100px] w-[100px] bg-white" style="box-shadow: 0 0 0 10px #ef4444, 0 0 0 20px #3b82f6, 0 0 0 30px #10b981;"></div>
</div>`,
},
{
id: "Q13",
title: "Radial Gradient",
difficulty: "intermediate",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[200px] w-[200px] rounded-full" style="background: radial-gradient(circle, #fbbf24 0%, #f97316 50%, #dc2626 100%);"></div>
</div>`,
},
{
id: "Q14",
title: "Plus Sign",
difficulty: "intermediate",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="relative h-[150px] w-[150px]">
<div class="absolute left-[60px] top-0 h-[150px] w-[30px] bg-blue-600"></div>
<div class="absolute left-0 top-[60px] h-[30px] w-[150px] bg-blue-600"></div>
</div>
</div>`,
},
{
id: "Q15",
title: "Diamond Shape",
difficulty: "advanced",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[100px] w-[100px] rotate-45 bg-purple-600"></div>
</div>`,
},
{
id: "Q16",
title: "Yin Yang",
difficulty: "advanced",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="relative h-[150px] w-[150px] rounded-full bg-white" style="background: linear-gradient(to right, #000 50%, #fff 50%); border: 3px solid #000;">
<div class="absolute left-0 top-0 h-[75px] w-[75px] rounded-full bg-white"></div>
<div class="absolute bottom-0 left-0 h-[75px] w-[75px] rounded-full bg-black"></div>
<div class="absolute left-[30px] top-[30px] h-[15px] w-[15px] rounded-full bg-black"></div>
<div class="absolute bottom-[30px] left-[30px] h-[15px] w-[15px] rounded-full bg-white"></div>
</div>
</div>`,
},
{
id: "Q17",
title: "Concentric Circles",
difficulty: "advanced",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="relative h-[200px] w-[200px]">
<div class="absolute inset-0 rounded-full bg-red-500"></div>
<div class="absolute inset-[20px] rounded-full bg-white"></div>
<div class="absolute inset-[40px] rounded-full bg-blue-500"></div>
<div class="absolute inset-[60px] rounded-full bg-white"></div>
<div class="absolute inset-[80px] rounded-full bg-red-500"></div>
</div>
</div>`,
},
{
id: "Q18",
title: "Grid Pattern",
difficulty: "advanced",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[200px] w-[200px]" style="background-color: #fff; background-image: linear-gradient(#ddd 1px, transparent 1px), linear-gradient(90deg, #ddd 1px, transparent 1px); background-size: 25px 25px;"></div>
</div>`,
},
{
id: "Q19",
title: "Star Burst",
difficulty: "advanced",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[150px] w-[150px]" style="background: conic-gradient(from 0deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);"></div>
</div>`,
},
{
id: "Q20",
title: "Hexagon",
difficulty: "advanced",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="relative h-[100px] w-[173px]">
<div class="absolute inset-0 bg-teal-500" style="clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);"></div>
</div>
</div>`,
},
{
id: "Q21",
title: "Optical Illusion",
difficulty: "advanced",
html: `<div class="flex h-full w-full items-center justify-center">
<div class="h-[200px] w-[200px]" style="background: repeating-conic-gradient(from 0deg, #000 0deg 45deg, #fff 45deg 90deg); border-radius: 50%;"></div>
</div>`,
},
];
export const getPatternHtml = (id: string): string => {
const pattern = questionPatterns.find((pattern) => pattern.id === id);
return pattern?.html ?? "";
};
export const getPatternTitle = (id: string): string => {
const pattern = questionPatterns.find((pattern) => pattern.id === id);
return pattern?.title ?? "";
};
export const getPatternDifficulty = (id: string): string => {
const pattern = questionPatterns.find((pattern) => pattern.id === id);
return pattern?.difficulty ?? "beginner";
};