openfree commited on
Commit
3edcd3e
·
verified ·
1 Parent(s): 45ed4b2

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +229 -227
index.html CHANGED
@@ -3,311 +3,313 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Smart Article Generator 📝</title>
7
  <style>
8
- :root {
9
- --primary: #2563eb;
10
- --secondary: #475569;
11
- --background: #f8fafc;
12
- --surface: #ffffff;
13
- }
14
-
15
  * {
16
  margin: 0;
17
  padding: 0;
18
  box-sizing: border-box;
19
- font-family: 'Inter', system-ui, sans-serif;
20
  }
21
 
22
  body {
23
- background-color: var(--background);
24
  min-height: 100vh;
25
- padding: 2rem;
26
- line-height: 1.6;
 
 
 
27
  }
28
 
29
  .container {
30
- max-width: 900px;
31
- margin: 0 auto;
32
- background: var(--surface);
33
- padding: 2.5rem;
34
- border-radius: 1rem;
35
- box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
36
- }
37
-
38
- .header {
39
  text-align: center;
40
- margin-bottom: 3rem;
41
  }
42
 
43
- .header h1 {
44
- color: var(--primary);
45
- font-size: 2.5rem;
46
- margin-bottom: 1rem;
47
- }
48
-
49
- .header p {
50
- color: var(--secondary);
51
- font-size: 1.1rem;
52
- }
53
-
54
- .step {
55
  margin-bottom: 2rem;
56
  }
57
 
58
- .step-number {
59
- background: var(--primary);
60
- color: white;
61
- width: 30px;
62
- height: 30px;
63
- display: inline-flex;
64
- align-items: center;
65
- justify-content: center;
66
- border-radius: 50%;
67
- margin-right: 0.5rem;
68
  }
69
 
70
- .step h2 {
71
- color: var(--secondary);
72
- margin-bottom: 1rem;
73
  display: flex;
74
- align-items: center;
 
75
  }
76
 
77
- input[type="text"] {
78
- width: 100%;
79
- padding: 1rem;
80
- border: 2px solid #e2e8f0;
81
- border-radius: 0.5rem;
82
- font-size: 1rem;
83
- transition: all 0.3s;
84
  }
85
 
86
- input[type="text"]:focus {
87
- outline: none;
88
- border-color: var(--primary);
89
- box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
 
90
  }
91
 
92
- .source-options {
93
  display: grid;
94
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
95
  gap: 1rem;
96
- margin-top: 1rem;
97
  }
98
 
99
- .source-option {
100
- padding: 1.5rem;
101
- border: 2px solid #e2e8f0;
102
- border-radius: 0.5rem;
103
  cursor: pointer;
104
- transition: all 0.3s;
105
- text-align: center;
 
106
  }
107
 
108
- .source-option:hover {
109
- border-color: var(--primary);
110
- background: rgba(37, 99, 235, 0.05);
 
 
111
  }
112
 
113
- .source-option.selected {
114
- border-color: var(--primary);
115
- background: rgba(37, 99, 235, 0.1);
 
 
116
  }
117
 
118
- .source-option h3 {
119
- font-size: 1.2rem;
120
- margin-bottom: 0.5rem;
121
  }
122
 
123
- .generate-btn {
124
- width: 100%;
125
- padding: 1rem;
126
- background: var(--primary);
 
 
 
127
  color: white;
128
  border: none;
129
- border-radius: 0.5rem;
130
- font-size: 1.1rem;
131
  cursor: pointer;
132
- transition: all 0.3s;
133
- margin: 2rem 0;
134
- }
135
-
136
- .generate-btn:hover {
137
- background: #1d4ed8;
138
  }
139
 
140
- .loader {
141
- display: none;
142
- text-align: center;
143
- margin: 2rem 0;
144
  }
145
 
146
- .loader-spinner {
147
- width: 40px;
148
- height: 40px;
149
- border: 4px solid #f3f3f3;
150
- border-top: 4px solid var(--primary);
151
- border-radius: 50%;
152
- animation: spin 1s linear infinite;
153
- margin: 0 auto 1rem;
154
  }
155
 
156
- @keyframes spin {
157
- 0% { transform: rotate(0deg); }
158
- 100% { transform: rotate(360deg); }
 
 
159
  }
160
 
161
- .result {
162
- display: none;
163
- margin-top: 2rem;
164
  }
165
 
166
- .article-content {
167
- padding: 1.5rem;
168
- border: 2px solid #e2e8f0;
169
- border-radius: 0.5rem;
170
- margin-bottom: 1rem;
171
- white-space: pre-wrap;
172
  }
173
 
174
- .copy-btn {
175
- padding: 0.75rem 1.5rem;
176
- background: #10b981;
177
- color: white;
178
- border: none;
179
- border-radius: 0.5rem;
180
- cursor: pointer;
181
- transition: all 0.3s;
182
  }
183
 
184
- .copy-btn:hover {
185
- background: #059669;
 
 
 
 
 
 
 
 
 
 
 
186
  }
187
  </style>
188
  </head>
189
  <body>
190
  <div class="container">
191
  <div class="header">
192
- <h1>✨ Smart Article Generator ✨</h1>
193
- <p>Create professional articles in seconds! 🚀</p>
194
- </div>
195
-
196
- <div class="step">
197
- <h2><span class="step-number">1</span> Enter Your Topic 📝</h2>
198
- <input type="text" id="topic" placeholder="Example: The Impact of Artificial Intelligence on Modern Society">
199
- </div>
200
-
201
- <div class="step">
202
- <h2><span class="step-number">2</span> Choose Your Source 🎯</h2>
203
- <div class="source-options">
204
- <div class="source-option" data-source="trusted">
205
- <h3>Trusted Sources 📰</h3>
206
- <p>Curated from reputable publications</p>
207
- </div>
208
- <div class="source-option" data-source="ai">
209
- <h3>AI Generated 🤖</h3>
210
- <p>Created by advanced AI</p>
211
- </div>
212
  </div>
213
  </div>
214
-
215
- <button class="generate-btn" id="generateBtn">Generate Article ✨</button>
216
-
217
- <div class="loader">
218
- <div class="loader-spinner"></div>
219
- <p>Creating your professional article... 🎨</p>
220
- </div>
221
-
222
- <div class="result">
223
- <div class="article-content" id="articleContent"></div>
224
- <button class="copy-btn" id="copyBtn">Copy Article 📋</button>
225
- </div>
226
  </div>
227
 
228
  <script>
229
- const sourceOptions = document.querySelectorAll('.source-option');
230
- const generateBtn = document.getElementById('generateBtn');
231
- const loader = document.querySelector('.loader');
232
- const result = document.querySelector('.result');
233
- const articleContent = document.getElementById('articleContent');
234
- const copyBtn = document.getElementById('copyBtn');
235
- let selectedSource = null;
236
-
237
- sourceOptions.forEach(option => {
238
- option.addEventListener('click', () => {
239
- sourceOptions.forEach(opt => opt.classList.remove('selected'));
240
- option.classList.add('selected');
241
- selectedSource = option.dataset.source;
242
- });
243
- });
244
-
245
- function generateArticle(topic, source) {
246
- const trustedSources = ["The New York Times 📰", "BBC News 🌐", "Reuters 📱", "Associated Press 📢"];
247
- const source_credit = source === 'trusted' ?
248
- `Source: ${trustedSources[Math.floor(Math.random() * trustedSources.length)]}` :
249
- "Generated by AI 🤖";
250
-
251
- const paragraphs = [
252
- `📌 ${topic} has become one of the most discussed topics in recent times. As we delve deeper into this fascinating subject, we discover its profound impact on various aspects of our lives and society as a whole.`,
253
-
254
- `🔍 Recent studies and analyses have shown that ${topic} plays a crucial role in shaping our future. Experts from leading institutions have conducted extensive research, revealing remarkable insights about this phenomenon.`,
255
-
256
- `💡 The evolution of ${topic} has been nothing short of revolutionary. From its humble beginnings to its current state, we've witnessed tremendous growth and development in this field. Industry leaders and innovators continue to push boundaries, exploring new possibilities and applications.`,
257
-
258
- `📊 According to recent statistics and data analysis, the impact of ${topic} has grown exponentially over the past decade. Organizations implementing related strategies have reported significant improvements in efficiency and effectiveness.`,
259
-
260
- `🌟 Looking ahead, the future of ${topic} appears incredibly promising. Experts predict continued growth and innovation in this space, with new developments emerging regularly. This dynamic landscape presents both challenges and opportunities for individuals and organizations alike.`,
261
 
262
- `📈 The practical implications of ${topic} are far-reaching. From everyday applications to complex industrial solutions, its influence can be observed across various sectors. This widespread adoption has led to remarkable transformations in how we approach traditional problems.`,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
 
264
- `🎯 To fully leverage the potential of ${topic}, experts recommend following these key principles: understanding fundamental concepts, staying updated with latest developments, and implementing best practices. These guidelines ensure optimal results and sustainable progress.`,
 
 
 
265
 
266
- `🔮 As we look to the future, it's clear that ${topic} will continue to evolve and shape our world in unprecedented ways. The possibilities are endless, and the potential for positive change is immense.`,
 
 
 
 
 
 
 
 
 
267
 
268
- `\n${source_credit}\nArticle generated on: ${new Date().toLocaleDateString()} 📅`
269
- ].join('\n\n');
270
 
271
- return paragraphs;
 
 
 
 
 
 
 
 
 
272
  }
273
 
274
- generateBtn.addEventListener('click', () => {
275
- const topic = document.getElementById('topic').value;
276
-
277
- if (!topic) {
278
- alert('Please enter a topic first! 🎯');
279
- return;
280
- }
281
 
282
- if (!selectedSource) {
283
- alert('Please select a source! 📚');
284
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  }
286
 
287
- loader.style.display = 'block';
288
- result.style.display = 'none';
289
-
290
- setTimeout(() => {
291
- const article = generateArticle(topic, selectedSource);
292
- articleContent.textContent = article;
293
- loader.style.display = 'none';
294
- result.style.display = 'block';
295
- }, 3000);
296
- });
297
-
298
- copyBtn.addEventListener('click', () => {
299
- navigator.clipboard.writeText(articleContent.textContent)
300
- .then(() => {
301
- copyBtn.textContent = 'Copied! ✅';
302
- setTimeout(() => {
303
- copyBtn.textContent = 'Copy Article 📋';
304
- }, 2000);
305
- })
306
- .catch(err => {
307
- alert('Failed to copy text! ❌');
308
- console.error('Failed to copy text: ', err);
309
- });
310
- });
311
  </script>
312
  </body>
313
  </html>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Fun Math Game</title>
7
  <style>
 
 
 
 
 
 
 
8
  * {
9
  margin: 0;
10
  padding: 0;
11
  box-sizing: border-box;
12
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
13
  }
14
 
15
  body {
 
16
  min-height: 100vh;
17
+ display: flex;
18
+ justify-content: center;
19
+ align-items: center;
20
+ background: linear-gradient(45deg, #6ab1e7, #4377c4);
21
+ padding: 20px;
22
  }
23
 
24
  .container {
25
+ background: white;
26
+ padding: 2rem;
27
+ border-radius: 20px;
28
+ box-shadow: 0 10px 30px rgba(0,0,0,0.2);
29
+ max-width: 500px;
30
+ width: 90%;
 
 
 
31
  text-align: center;
 
32
  }
33
 
34
+ .header {
 
 
 
 
 
 
 
 
 
 
 
35
  margin-bottom: 2rem;
36
  }
37
 
38
+ .title {
39
+ font-size: 2rem;
40
+ color: #4377c4;
41
+ margin-bottom: 1rem;
 
 
 
 
 
 
42
  }
43
 
44
+ .stats {
 
 
45
  display: flex;
46
+ justify-content: space-around;
47
+ margin-bottom: 1rem;
48
  }
49
 
50
+ .stat-item {
51
+ background: #f0f8ff;
52
+ padding: 0.5rem 1rem;
53
+ border-radius: 10px;
54
+ font-weight: bold;
 
 
55
  }
56
 
57
+ .question {
58
+ font-size: 2.5rem;
59
+ margin: 1.5rem 0;
60
+ color: #333;
61
+ animation: fadeIn 0.5s ease;
62
  }
63
 
64
+ .options {
65
  display: grid;
66
+ grid-template-columns: repeat(2, 1fr);
67
  gap: 1rem;
68
+ margin: 2rem 0;
69
  }
70
 
71
+ .option {
72
+ padding: 1rem;
73
+ border: 2px solid #4377c4;
74
+ border-radius: 15px;
75
  cursor: pointer;
76
+ transition: all 0.3s ease;
77
+ font-size: 1.2rem;
78
+ background: white;
79
  }
80
 
81
+ .option:hover {
82
+ background: #4377c4;
83
+ color: white;
84
+ transform: translateY(-2px);
85
+ box-shadow: 0 5px 15px rgba(67, 119, 196, 0.3);
86
  }
87
 
88
+ .feedback {
89
+ margin: 1rem 0;
90
+ font-size: 1.3rem;
91
+ min-height: 1.5em;
92
+ font-weight: bold;
93
  }
94
 
95
+ .correct {
96
+ color: #2ecc71;
97
+ animation: bounce 0.5s ease;
98
  }
99
 
100
+ .wrong {
101
+ color: #e74c3c;
102
+ animation: shake 0.5s ease;
103
+ }
104
+
105
+ .next-btn {
106
+ background: #4377c4;
107
  color: white;
108
  border: none;
109
+ padding: 1rem 2.5rem;
110
+ border-radius: 10px;
111
  cursor: pointer;
112
+ font-size: 1.1rem;
113
+ transition: all 0.3s ease;
114
+ font-weight: bold;
 
 
 
115
  }
116
 
117
+ .next-btn:hover {
118
+ transform: scale(1.05);
119
+ box-shadow: 0 5px 15px rgba(67, 119, 196, 0.3);
 
120
  }
121
 
122
+ .timer {
123
+ width: 100%;
124
+ height: 5px;
125
+ background: #eee;
126
+ margin-bottom: 1rem;
127
+ border-radius: 5px;
128
+ overflow: hidden;
 
129
  }
130
 
131
+ .timer-bar {
132
+ height: 100%;
133
+ background: #4377c4;
134
+ width: 100%;
135
+ transition: width 1s linear;
136
  }
137
 
138
+ @keyframes fadeIn {
139
+ from { opacity: 0; transform: translateY(-10px); }
140
+ to { opacity: 1; transform: translateY(0); }
141
  }
142
 
143
+ @keyframes bounce {
144
+ 0%, 100% { transform: scale(1); }
145
+ 50% { transform: scale(1.1); }
 
 
 
146
  }
147
 
148
+ @keyframes shake {
149
+ 0%, 100% { transform: translateX(0); }
150
+ 25% { transform: translateX(-5px); }
151
+ 75% { transform: translateX(5px); }
 
 
 
 
152
  }
153
 
154
+ @media (max-width: 480px) {
155
+ .container {
156
+ padding: 1rem;
157
+ }
158
+
159
+ .question {
160
+ font-size: 1.8rem;
161
+ }
162
+
163
+ .option {
164
+ font-size: 1rem;
165
+ padding: 0.8rem;
166
+ }
167
  }
168
  </style>
169
  </head>
170
  <body>
171
  <div class="container">
172
  <div class="header">
173
+ <h1 class="title">Fun Math Game 🎮</h1>
174
+ <div class="timer">
175
+ <div class="timer-bar" id="timer-bar"></div>
176
+ </div>
177
+ <div class="stats">
178
+ <div class="stat-item">Score: <span id="score">0</span></div>
179
+ <div class="stat-item">Level: <span id="level">1</span></div>
180
+ <div class="stat-item">Streak: <span id="streak">0</span></div>
 
 
 
 
 
 
 
 
 
 
 
 
181
  </div>
182
  </div>
183
+ <div class="question" id="question"></div>
184
+ <div class="options" id="options"></div>
185
+ <div class="feedback" id="feedback"></div>
186
+ <button class="next-btn" onclick="nextQuestion()">Next Question ➡️</button>
 
 
 
 
 
 
 
 
187
  </div>
188
 
189
  <script>
190
+ let score = 0;
191
+ let level = 1;
192
+ let streak = 0;
193
+ let correctAnswer;
194
+ let timerInterval;
195
+
196
+ function startTimer() {
197
+ clearInterval(timerInterval);
198
+ const timerBar = document.getElementById('timer-bar');
199
+ timerBar.style.width = '100%';
200
+
201
+ let timeLeft = 100;
202
+ timerInterval = setInterval(() => {
203
+ timeLeft -= 1;
204
+ timerBar.style.width = timeLeft + '%';
205
+
206
+ if (timeLeft <= 0) {
207
+ clearInterval(timerInterval);
208
+ checkAnswer(null);
209
+ }
210
+ }, 100);
211
+ }
 
 
 
 
 
 
 
 
 
 
212
 
213
+ function generateQuestion() {
214
+ const operations = ['+', '-', '*', '/'];
215
+ const operation = operations[Math.floor(Math.random() * operations.length)];
216
+ let num1, num2;
217
+ const maxNum = 10 + (level * 5); // Increase difficulty with level
218
+
219
+ switch(operation) {
220
+ case '+':
221
+ num1 = Math.floor(Math.random() * maxNum);
222
+ num2 = Math.floor(Math.random() * maxNum);
223
+ correctAnswer = num1 + num2;
224
+ break;
225
+ case '-':
226
+ num1 = Math.floor(Math.random() * maxNum);
227
+ num2 = Math.floor(Math.random() * num1);
228
+ correctAnswer = num1 - num2;
229
+ break;
230
+ case '*':
231
+ num1 = Math.floor(Math.random() * (level + 5));
232
+ num2 = Math.floor(Math.random() * (level + 5));
233
+ correctAnswer = num1 * num2;
234
+ break;
235
+ case '/':
236
+ num2 = Math.floor(Math.random() * (level + 3)) + 1;
237
+ correctAnswer = Math.floor(Math.random() * (level + 3));
238
+ num1 = correctAnswer * num2;
239
+ break;
240
+ }
241
 
242
+ document.getElementById('question').textContent = `${num1} ${operation} ${num2} = ?`;
243
+ generateOptions(correctAnswer);
244
+ startTimer();
245
+ }
246
 
247
+ function generateOptions(correct) {
248
+ const options = [correct];
249
+ const range = Math.max(10, correct * 0.5);
250
+
251
+ while(options.length < 4) {
252
+ const randomOption = correct + Math.floor(Math.random() * range) - (range/2);
253
+ if(!options.includes(randomOption) && randomOption >= 0) {
254
+ options.push(randomOption);
255
+ }
256
+ }
257
 
258
+ options.sort(() => Math.random() - 0.5);
 
259
 
260
+ const optionsContainer = document.getElementById('options');
261
+ optionsContainer.innerHTML = '';
262
+
263
+ options.forEach(option => {
264
+ const button = document.createElement('div');
265
+ button.className = 'option';
266
+ button.textContent = option;
267
+ button.onclick = () => checkAnswer(option);
268
+ optionsContainer.appendChild(button);
269
+ });
270
  }
271
 
272
+ function checkAnswer(selected) {
273
+ clearInterval(timerInterval);
274
+ const feedback = document.getElementById('feedback');
 
 
 
 
275
 
276
+ if(selected === correctAnswer) {
277
+ score += (level * 10);
278
+ streak++;
279
+ if(streak % 3 === 0) level++;
280
+
281
+ document.getElementById('score').textContent = score;
282
+ document.getElementById('level').textContent = level;
283
+ document.getElementById('streak').textContent = streak;
284
+
285
+ feedback.textContent = "Awesome! 🎉";
286
+ feedback.className = 'feedback correct';
287
+ } else {
288
+ streak = 0;
289
+ document.getElementById('streak').textContent = streak;
290
+ feedback.textContent = selected === null ? "Time's up! ⏰" : "Wrong! Try again! 😢";
291
+ feedback.className = 'feedback wrong';
292
  }
293
 
294
+ document.querySelectorAll('.option').forEach(option => {
295
+ option.style.pointerEvents = 'none';
296
+ if(parseInt(option.textContent) === correctAnswer) {
297
+ option.style.background = '#2ecc71';
298
+ option.style.color = 'white';
299
+ } else if(parseInt(option.textContent) === selected && selected !== correctAnswer) {
300
+ option.style.background = '#e74c3c';
301
+ option.style.color = 'white';
302
+ }
303
+ });
304
+ }
305
+
306
+ function nextQuestion() {
307
+ document.getElementById('feedback').textContent = '';
308
+ generateQuestion();
309
+ }
310
+
311
+ // Start game
312
+ generateQuestion();
 
 
 
 
 
313
  </script>
314
  </body>
315
  </html>