-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcourse1.html
More file actions
291 lines (258 loc) ยท 9.58 KB
/
course1.html
File metadata and controls
291 lines (258 loc) ยท 9.58 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-EBR3S0M396"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-EBR3S0M396');
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CODEON HTML Foundations โ World Class</title>
<!-- Monaco Editor -->
<script src="https://cdn.jsdelivr.net/npm/monaco-editor@0.44.0/min/vs/loader.js"></script>
<!-- Confetti -->
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.6.0/dist/confetti.browser.min.js"></script>
<style>
body {
margin: 0;
height: 100vh;
/* Base gradient color (same as your reference page) */
background: linear-gradient(135deg, #ff9a9e, #fad0c4, #a1c4fd, #c2e9fb);
background-size: 400% 400%;
animation: gradientMove 15s ease infinite;
}
@keyframes gradientMove {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
header{background:#111;color:white;text-align:center;padding:20px;}
.lesson{background:white;max-width:900px;margin:20px auto;padding:25px;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,0.15);}
.locked{opacity:0.5;pointer-events:none;}
button{padding:10px 20px;background:#111;color:white;border:none;cursor:pointer;margin-top:10px;border-radius:5px;}
button:hover{background:#333;}
#editor{height:300px;border:1px solid #ccc;margin-top:10px;border-radius:5px;}
iframe{width:100%;height:200px;border:1px solid black;margin-top:10px;border-radius:5px;}
.status{margin-top:10px;font-weight:bold;}
.protip{background:#e8f4ff;padding:10px;margin:10px 0;border-left:4px solid #2196F3;border-radius:5px;}
.protip h3{margin-top:0;}
.tag-guide{background:#fff3e0;padding:10px;margin:10px 0;border-left:4px solid #ff9800;border-radius:5px;}
.tag-guide h4{margin-top:0;}
.complete{color:green;font-weight:bold;}
</style>
</head>
<body>
<header>
<h1>CODEON โ HTML Foundations</h1>
<p>Learn, code, deploy & earn! Each lesson unlocks the next.</p>
</header>
<!-- LESSON 1 -->
<div class="lesson" id="lesson1">
<h2>Lesson 1 โ HTML Structure</h2>
<h3>Concepts & Tag Guide:</h3>
<div class="tag-guide">
<h4><!DOCTYPE html></h4>
<p>Declares this document as HTML5 so browsers know how to render it.</p>
<h4><html></h4>
<p>Root element that wraps all HTML content.</p>
<h4><head></h4>
<p>Contains metadata like <title>, <meta> tags, CSS links, scripts.</p>
<h4><title></h4>
<p>Specifies the title shown in browser tab.</p>
<h4><body></h4>
<p>Contains all visible content like headings, paragraphs, images.</p>
</div>
<h3>Task:</h3>
<p>Change <b>"Your Name"</b> to your real name and write a paragraph about why you want to code.</p>
<div id="editor"></div>
<button onclick="runCode()">Run Code</button>
<button onclick="checkLesson(1)">Submit Lesson 1</button>
<iframe id="output"></iframe>
<p class="status" id="status1"></p>
</div>
<!-- LESSON 2 -->
<div class="lesson locked" id="lesson2">
<h2>Lesson 2 โ Headings & Paragraphs</h2>
<h3>Concepts & Tag Guide:</h3>
<div class="tag-guide">
<h4><h1> to <h6></h4>
<p>Headings; <h1> is the largest/main heading, <h6> is smallest.</p>
<h4><p></h4>
<p>Paragraph tag for blocks of text.</p>
</div>
<h3>Task:</h3>
<p>Add an <h1> and a <p> about your coding goals.</p>
<button onclick="checkLesson(2)">Submit Lesson 2</button>
<p class="status" id="status2"></p>
</div>
<!-- LESSON 3 -->
<div class="lesson locked" id="lesson3">
<h2>Lesson 3 โ Images & Links</h2>
<h3>Concepts & Tag Guide:</h3>
<div class="tag-guide">
<h4><img src="" alt=""></h4>
<p>Displays an image. 'src' is the image path, 'alt' is alternative text.</p>
<h4><a href=""></h4>
<p>Anchor tag creates hyperlinks to other pages or sites.</p>
</div>
<h3>Task:</h3>
<p>Add an image and a link to your favorite coding resource.</p>
<button onclick="checkLesson(3)">Submit Lesson 3</button>
<p class="status" id="status3"></p>
</div>
<!-- LESSON 4 -->
<div class="lesson locked" id="lesson4">
<h2>Lesson 4 โ Sections & Organization</h2>
<h3>Concepts & Tag Guide:</h3>
<div class="tag-guide">
<h4><section></h4>
<p>Defines thematic sections of a page.</p>
<h4><div></h4>
<p>Generic container to group elements for layout and styling.</p>
</div>
<h3>Task:</h3>
<p>Use <section> and <div> to organize your page into at least 2 sections.</p>
<button onclick="checkLesson(4)">Submit Lesson 4</button>
<p class="status" id="status4"></p>
</div>
<!-- LESSON 5 -->
<div class="lesson locked" id="lesson5">
<h2>Lesson 5 โ GitHub & Monetization</h2>
<h3>Task:</h3>
<p>Deploy your project online and learn to monetize your skills.</p>
<div class="protip">
<h3>๐ป GitHub Guide:</h3>
<ul>
<li>Create a free GitHub account: <a href="https://github.com/join" target="_blank">Sign up here</a></li>
<li>Make a new repository for your project.</li>
<li>Push your HTML/CSS files using Git or GitHub Desktop.</li>
<li>Deploy with GitHub Pages to get a live website.</li>
</ul>
</div>
<div class="protip">
<h3>๐ฐ Monetization Tips:</h3>
<ul>
<li>Offer web design for local businesses.</li>
<li>Create templates or small apps to sell online.</li>
<li>Freelance on Upwork, Fiverr, or local platforms.</li>
<li>Document your projects to attract clients and sponsorships.</li>
</ul>
</div>
<button onclick="checkLesson(5)">Submit Final Lesson</button>
<p class="status" id="status5"></p>
</div>
<!-- Certificate -->
<div class="lesson" id="certificateSection" style="display:none;">
<h2>๐ Certificate</h2>
<p>Click below after completing all lessons to generate your certificate:</p>
<button onclick="generateCertificate()">Generate Certificate</button>
<div id="certificate"></div>
</div>
<script>
// Monaco Editor
require.config({ paths: { vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.44.0/min/vs' }});
require(['vs/editor/editor.main'], function() {
window.editor = monaco.editor.create(document.getElementById('editor'), {
value: `<!DOCTYPE html>
<html>
<head>
<title>My First Website</title>
</head>
<body>
<h1>Your Name</h1>
<p>I want to become a Developer.</p>
</body>
</html>`,
language: 'html',
theme: 'vs-dark'
});
});
// Run code
function runCode(){
const code = editor.getValue();
document.getElementById("output").srcdoc = code;
}
// Points system
let points = 0;
function updatePoints(){console.log("Points:", points);}
// Confetti / flowers celebration
function celebrateLesson(lessonNum){
const lessonEmojis = {
1: ["๐ธ","๐ผ"],
2: ["๐","โจ"],
3: ["๐","๐บ"],
4: ["๐","๐ฅณ"],
5: ["๐","๐"]
};
const emojis = lessonEmojis[lessonNum] || ["๐ธ"];
for(let i=0;i<20;i++){
confetti({
particleCount:1,
startVelocity:Math.random()*30+10,
spread:60,
ticks:120,
gravity:0.5,
origin:{x:Math.random(),y:Math.random()*0.6},
shapes: ['text'],
emojis: [emojis[Math.floor(Math.random()*emojis.length)]]
});
}
}
// Unlock next lesson & check
function unlockNext(num){
const lesson = document.getElementById("lesson"+num);
if(lesson) lesson.classList.remove("locked");
}
function checkLesson(lessonNum){
const code = editor.getValue();
let statusEl = document.getElementById("status"+lessonNum);
if(lessonNum===1){
if(code.includes("<h1>") && !code.includes("Your Name")){
statusEl.innerHTML="โ
Lesson 1 Complete! Lesson 2 unlocked.";
unlockNext(2); points+=10; updatePoints(); celebrateLesson(1);
} else {statusEl.innerHTML="โ Replace 'Your Name' before submitting.";}
}
if(lessonNum===2){
if(code.includes("<h1>") && code.includes("<p>")){
statusEl.innerHTML="โ
Lesson 2 Complete! Lesson 3 unlocked.";
unlockNext(3); points+=10; updatePoints(); celebrateLesson(2);
} else {statusEl.innerHTML="โ Add a heading and a paragraph.";}
}
if(lessonNum===3){
if(code.includes("<img") && code.includes("<a")){
statusEl.innerHTML="โ
Lesson 3 Complete! Lesson 4 unlocked.";
unlockNext(4); points+=10; updatePoints(); celebrateLesson(3);
} else {statusEl.innerHTML="โ Add an image and a link.";}
}
if(lessonNum===4){
if(code.includes("<section") && code.includes("<div")){
statusEl.innerHTML="โ
Lesson 4 Complete! Final lesson unlocked.";
unlockNext(5); points+=10; updatePoints(); celebrateLesson(4);
} else {statusEl.innerHTML="โ Use section and div tags.";}
}
if(lessonNum===5){
statusEl.innerHTML="๐ All lessons complete! You can generate your certificate.";
document.getElementById("certificateSection").style.display="block";
points+=20; updatePoints(); celebrateLesson(5);
}
}
// Certificate generator (payment placeholder)
function generateCertificate(){
const name = editor.getValue().match(/<h1>(.*?)<\/h1>/i);
const studentName = name ? name[1] : "Student";
document.getElementById("certificate").innerHTML=`
<div style="border:4px solid #111;padding:20px;text-align:center;border-radius:10px;">
<img src="codeon_logo.png" alt="CODEON Logo" style="width:100px;"><br>
<h2>๐ CODEON Certificate</h2>
<p>Congratulations <b>${studentName}</b>!</p>
<p>All lessons completed. QR code verification coming soon.</p>
</div>`;
alert("Certificate generated! (Imagine payment verified via Pesapal.)");
}
</script>
</body>
</html>