-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayground.html
313 lines (280 loc) · 10 KB
/
playground.html
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Code Playground - Kid-Friendly Coding</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
<link rel="icon" type="image/png" href="images/favicon.png">
<style>
.playground-container {
display: grid;
grid-template-columns: 300px 1fr;
gap: 2rem;
padding: 2rem;
height: calc(100vh - 200px);
}
.tools-panel {
background: white;
border-radius: 15px;
padding: 1.5rem;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.tools-section {
margin-bottom: 2rem;
}
.tools-section h3 {
color: var(--primary-color);
margin-bottom: 1rem;
}
.tool-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
}
.tool-btn {
background: var(--accent-color);
color: white;
border: none;
border-radius: 10px;
padding: 1rem;
cursor: pointer;
transition: transform 0.2s ease;
font-size: 1.2rem;
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
}
.tool-btn:hover {
transform: scale(1.05);
}
.canvas-area {
background: white;
border-radius: 15px;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
overflow: hidden;
display: flex;
flex-direction: column;
}
.canvas-toolbar {
padding: 1rem;
background: var(--primary-color);
display: flex;
gap: 1rem;
align-items: center;
}
.canvas-toolbar button {
background: white;
border: none;
border-radius: 5px;
padding: 0.5rem 1rem;
cursor: pointer;
transition: background 0.2s ease;
}
.canvas-toolbar button:hover {
background: var(--accent-color);
color: white;
}
#playgroundCanvas {
flex: 1;
background: white;
}
.character-select {
position: fixed;
bottom: 2rem;
right: 2rem;
background: white;
border-radius: 15px;
padding: 1rem;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
display: flex;
gap: 1rem;
}
.character-btn {
background: none;
border: none;
cursor: pointer;
transition: transform 0.2s ease;
font-size: 2rem;
}
.character-btn:hover {
transform: scale(1.2);
}
.active-character {
transform: scale(1.2);
position: relative;
}
.active-character::after {
content: '✓';
position: absolute;
top: -10px;
right: -10px;
background: var(--accent-color);
color: white;
border-radius: 50%;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.8rem;
}
</style>
</head>
<body>
<header class="main-header">
<div class="header-content">
<div class="logo-container">
<img src="images/giiyotech logo.png" alt="GiiyoTech Logo" class="logo">
</div>
<nav class="main-nav">
<a href="index.html">Home</a>
<a href="courses.html">Courses</a>
<a href="playground.html" class="active">Playground</a>
<a href="projects.html">Projects</a>
</nav>
</div>
</header>
<main>
<section class="hero">
<h1>🎨 Code Playground</h1>
<p>Let your creativity run wild and build amazing things!</p>
</section>
<div class="playground-container">
<div class="tools-panel">
<div class="tools-section">
<h3>HTML Blocks</h3>
<div class="tool-grid">
<button class="tool-btn" onclick="insertBlock('heading')">
📑 Heading
</button>
<button class="tool-btn" onclick="insertBlock('paragraph')">
📝 Paragraph
</button>
<button class="tool-btn" onclick="insertBlock('image')">
🖼️ Image
</button>
<button class="tool-btn" onclick="insertBlock('button')">
🔘 Button
</button>
</div>
</div>
<div class="tools-section">
<h3>Styling</h3>
<div class="tool-grid">
<button class="tool-btn" onclick="addStyle('color')">
🎨 Color
</button>
<button class="tool-btn" onclick="addStyle('size')">
📏 Size
</button>
<button class="tool-btn" onclick="addStyle('background')">
🌈 Background
</button>
<button class="tool-btn" onclick="addStyle('animation')">
✨ Animation
</button>
</div>
</div>
<div class="tools-section">
<h3>Special Effects</h3>
<div class="tool-grid">
<button class="tool-btn" onclick="addEffect('sparkles')">
⭐ Sparkles
</button>
<button class="tool-btn" onclick="addEffect('confetti')">
🎉 Confetti
</button>
<button class="tool-btn" onclick="addEffect('rainbow')">
🌈 Rainbow
</button>
<button class="tool-btn" onclick="addEffect('magic')">
🔮 Magic
</button>
</div>
</div>
</div>
<div class="canvas-area">
<div class="canvas-toolbar">
<button onclick="clearCanvas()">Clear Canvas</button>
<button onclick="saveCreation()">Save Creation</button>
<button onclick="shareCreation()">Share</button>
</div>
<canvas id="playgroundCanvas"></canvas>
</div>
</div>
<div class="character-select">
<button class="character-btn active-character" onclick="selectCharacter('pixel')">🤖</button>
<button class="character-btn" onclick="selectCharacter('cody')">🐱</button>
<button class="character-btn" onclick="selectCharacter('byte')">🐞</button>
</div>
</main>
<footer class="main-footer">
<div class="footer-content">
<div class="footer-section">
<h3>About Giiyo Tech</h3>
<p>Empowering young minds through fun and interactive coding education.</p>
</div>
<div class="footer-section">
<h3>Connect With Us</h3>
<div class="social-links">
<a href="https://twitter.com/giioyo" target="_blank">Twitter</a>
<a href="https://www.facebook.com/share/1B3QhyDXpk/?mibextid=wwXIfr" target="_blank">Facebook</a>
</div>
</div>
<div class="footer-section">
<h3>Contact</h3>
<p>Email: [email protected]</p>
<p>Website: www.giiyo.com</p>
</div>
</div>
<div class="footer-bottom">
<p>© 2024 Giiyo Tech. All rights reserved.</p>
</div>
</footer>
<script>
// Initialize canvas
const canvas = document.getElementById('playgroundCanvas');
const ctx = canvas.getContext('2d');
// Resize canvas to fit container
function resizeCanvas() {
const container = canvas.parentElement;
canvas.width = container.clientWidth;
canvas.height = container.clientHeight;
}
window.addEventListener('resize', resizeCanvas);
resizeCanvas();
// Character selection
function selectCharacter(character) {
document.querySelectorAll('.character-btn').forEach(btn => {
btn.classList.remove('active-character');
});
event.target.classList.add('active-character');
// Add character-specific animations or behaviors
}
// Tool functions
function insertBlock(type) {
// Implementation for inserting HTML blocks
}
function addStyle(type) {
// Implementation for adding styles
}
function addEffect(type) {
// Implementation for adding effects
}
function clearCanvas() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
}
function saveCreation() {
// Implementation for saving creation
}
function shareCreation() {
// Implementation for sharing creation
}
</script>
</body>
</html>