rrr257 commited on
Commit
98d5a47
·
1 Parent(s): 5bd895b

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +66 -73
index.html CHANGED
@@ -26,27 +26,26 @@ color: #fef3c7;
26
  font-size: 1.125rem;
27
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
28
  }
29
- .theme-selection {
30
  background: white;
31
  border-radius: 1rem;
32
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
33
  padding: 2rem;
34
  margin-bottom: 2rem;
35
  }
36
- .theme-selection.hidden { display: none; }
37
- .theme-title {
38
  font-size: 1.25rem;
39
  font-weight: 600;
40
  color: #5b21b6;
41
  margin-bottom: 1rem;
42
  text-align: center;
43
  }
44
- .themes {
45
  display: grid;
46
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
47
  gap: 1rem;
48
  }
49
- .theme-btn {
50
  padding: 1.25rem;
51
  background: #f5f3ff;
52
  border: 2px solid #c4b5fd;
@@ -56,12 +55,10 @@ color: #5b21b6;
56
  cursor: pointer;
57
  transition: all 0.2s;
58
  text-align: center;
59
- font-size: 1rem;
60
- border: none;
61
  }
62
- .theme-btn:hover {
63
  background: #ede9fe;
64
- border: 2px solid #a78bfa;
65
  transform: translateY(-2px);
66
  }
67
  .topics-container {
@@ -291,9 +288,17 @@ line-height: 1.5;
291
  <p class="subtitle">Toastmasters Impromptu Speaking Practice</p>
292
  </header>
293
 
294
- <div class="theme-selection" id="themeSelection">
295
- <h2 class="theme-title">Select a Theme for This Meeting</h2>
296
- <div class="themes" id="themesContainer"></div>
 
 
 
 
 
 
 
 
297
  </div>
298
 
299
  <div class="topics-container" id="topicsContainer">
@@ -455,51 +460,44 @@ topics: [
455
  }
456
  };
457
 
458
- let currentTheme = null;
459
  let usedTopics = [];
460
  let timerInterval = null;
461
  let timeElapsed = 0;
462
  let isRunning = false;
463
 
464
- // Initialize theme buttons
465
- function initThemeButtons() {
466
- const themesContainer = document.getElementById('themesContainer');
467
- const themeButtons = [
468
- { id: 'if-you-could', emoji: '🌟', text: 'If You Could...' },
469
- { id: 'unpopular', emoji: '💭', text: 'Unpopular Opinions' },
470
- { id: 'what-would', emoji: '🤔', text: 'What Would You Do?' },
471
- { id: 'throwback', emoji: '📸', text: 'Throwback' },
472
- { id: 'expert', emoji: '🎓', text: 'You're the Expert' },
473
- { id: 'big-questions', emoji: '🌍', text: 'The Big Questions' },
474
- { id: 'would-rather', emoji: '⚖️', text: 'Would You Rather' }
475
- ];
476
-
477
- themeButtons.forEach(theme => {
478
- const btn = document.createElement('button');
479
- btn.className = 'theme-btn';
480
- btn.textContent = `${theme.emoji} ${theme.text}`;
481
- btn.onclick = () => selectTheme(theme.id);
482
- themesContainer.appendChild(btn);
483
- });
484
- }
485
 
486
- function selectTheme(themeId) {
487
- currentTheme = themeId;
 
 
488
  usedTopics = [];
489
  showTopics();
490
- }
 
491
 
492
  function showTopics() {
493
- document.getElementById('themeSelection').classList.add('hidden');
494
- document.getElementById('topicsContainer').classList.add('active');
495
- document.getElementById('currentThemeName').textContent = themes[currentTheme].name;
496
  renderTopics();
497
  }
498
 
499
  function renderTopics() {
500
- const topicsGrid = document.getElementById('topicsGrid');
501
  topicsGrid.innerHTML = '';
502
- themes[currentTheme].topics.forEach((topic, index) => {
503
  const card = document.createElement('div');
504
  card.className = 'topic-card';
505
  if (usedTopics.includes(index)) {
@@ -511,17 +509,17 @@ card.innerHTML = `
511
  ${usedTopics.includes(index) ? '<div class="used-badge">USED</div>' : ''}
512
  `;
513
  if (!usedTopics.includes(index)) {
514
- card.onclick = () => selectTopic(index);
515
  }
516
  topicsGrid.appendChild(card);
517
  });
518
  }
519
 
520
  function selectTopic(index) {
521
- document.getElementById('selectedTopicText').textContent = themes[currentTheme].topics[index];
522
  usedTopics.push(index);
523
- document.getElementById('topicsContainer').classList.remove('active');
524
- document.getElementById('speakingSection').classList.add('active');
525
  resetTimer();
526
  }
527
 
@@ -530,29 +528,28 @@ clearInterval(timerInterval);
530
  isRunning = false;
531
  timeElapsed = 0;
532
  updateTimerDisplay();
533
- document.getElementById('startBtn').disabled = false;
534
  }
535
 
536
  function updateTimerDisplay() {
537
  const minutes = Math.floor(timeElapsed / 60);
538
  const seconds = timeElapsed % 60;
539
- const display = document.getElementById('timerDisplay');
540
- display.textContent = `${minutes}:${seconds.toString().padStart(2, '0')}`;
541
 
542
- display.classList.remove('green', 'yellow', 'red');
543
  if (timeElapsed < 60) {
544
- display.classList.add('green');
545
  } else if (timeElapsed < 90) {
546
- display.classList.add('yellow');
547
  } else {
548
- display.classList.add('red');
549
  }
550
  }
551
 
552
  function startTimer() {
553
  if (isRunning) return;
554
  isRunning = true;
555
- document.getElementById('startBtn').disabled = true;
556
 
557
  timerInterval = setInterval(() => {
558
  timeElapsed++;
@@ -565,36 +562,32 @@ isRunning = false;
565
  }, 1000);
566
  }
567
 
568
- // Event listeners
569
- document.getElementById('startBtn').onclick = startTimer;
570
 
571
- document.getElementById('nextSpeakerBtn').onclick = () => {
572
- document.getElementById('speakingSection').classList.remove('active');
573
- document.getElementById('topicsContainer').classList.add('active');
574
  renderTopics();
575
  resetTimer();
576
- };
577
 
578
- document.getElementById('backBtn').onclick = () => {
579
- document.getElementById('topicsContainer').classList.remove('active');
580
- document.getElementById('themeSelection').classList.remove('hidden');
581
- };
582
 
583
- document.getElementById('backToTopicsBtn').onclick = () => {
584
- document.getElementById('speakingSection').classList.remove('active');
585
- document.getElementById('topicsContainer').classList.add('active');
586
  resetTimer();
587
- };
588
 
589
- document.getElementById('resetUsedBtn').onclick = () => {
590
  if (confirm('Reset all used topics for this theme?')) {
591
  usedTopics = [];
592
  renderTopics();
593
  }
594
- };
595
-
596
- // Initialize on load
597
- initThemeButtons();
598
  </script>
599
  </body>
600
  </html>
 
26
  font-size: 1.125rem;
27
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
28
  }
29
+ .category-selection {
30
  background: white;
31
  border-radius: 1rem;
32
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
33
  padding: 2rem;
34
  margin-bottom: 2rem;
35
  }
36
+ .category-title {
 
37
  font-size: 1.25rem;
38
  font-weight: 600;
39
  color: #5b21b6;
40
  margin-bottom: 1rem;
41
  text-align: center;
42
  }
43
+ .categories {
44
  display: grid;
45
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
46
  gap: 1rem;
47
  }
48
+ .category-btn {
49
  padding: 1.25rem;
50
  background: #f5f3ff;
51
  border: 2px solid #c4b5fd;
 
55
  cursor: pointer;
56
  transition: all 0.2s;
57
  text-align: center;
 
 
58
  }
59
+ .category-btn:hover {
60
  background: #ede9fe;
61
+ border-color: #a78bfa;
62
  transform: translateY(-2px);
63
  }
64
  .topics-container {
 
288
  <p class="subtitle">Toastmasters Impromptu Speaking Practice</p>
289
  </header>
290
 
291
+ <div class="category-selection" id="categorySelection">
292
+ <h2 class="category-title">Select a Theme for This Meeting</h2>
293
+ <div class="categories">
294
+ <button class="category-btn" data-category="if-you-could">🌟 If You Could...</button>
295
+ <button class="category-btn" data-category="unpopular">💭 Unpopular Opinions</button>
296
+ <button class="category-btn" data-category="what-would">🤔 What Would You Do?</button>
297
+ <button class="category-btn" data-category="throwback">📸 Throwback</button>
298
+ <button class="category-btn" data-category="expert">🎓 You're the Expert</button>
299
+ <button class="category-btn" data-category="big-questions">🌍 The Big Questions</button>
300
+ <button class="category-btn" data-category="would-rather">⚖️ Would You Rather</button>
301
+ </div>
302
  </div>
303
 
304
  <div class="topics-container" id="topicsContainer">
 
460
  }
461
  };
462
 
463
+ let currentCategory = null;
464
  let usedTopics = [];
465
  let timerInterval = null;
466
  let timeElapsed = 0;
467
  let isRunning = false;
468
 
469
+ const categorySelection = document.getElementById('categorySelection');
470
+ const topicsContainer = document.getElementById('topicsContainer');
471
+ const speakingSection = document.getElementById('speakingSection');
472
+ const currentThemeName = document.getElementById('currentThemeName');
473
+ const topicsGrid = document.getElementById('topicsGrid');
474
+ const selectedTopicText = document.getElementById('selectedTopicText');
475
+ const timerDisplay = document.getElementById('timerDisplay');
476
+ const startBtn = document.getElementById('startBtn');
477
+ const nextSpeakerBtn = document.getElementById('nextSpeakerBtn');
478
+ const backBtn = document.getElementById('backBtn');
479
+ const backToTopicsBtn = document.getElementById('backToTopicsBtn');
480
+ const resetUsedBtn = document.getElementById('resetUsedBtn');
 
 
 
 
 
 
 
 
 
481
 
482
+ // Category selection - SAME PATTERN AS ROLE PLAY/DEBATES
483
+ document.querySelectorAll('.category-btn').forEach(btn => {
484
+ btn.addEventListener('click', () => {
485
+ currentCategory = btn.dataset.category;
486
  usedTopics = [];
487
  showTopics();
488
+ });
489
+ });
490
 
491
  function showTopics() {
492
+ categorySelection.style.display = 'none';
493
+ topicsContainer.classList.add('active');
494
+ currentThemeName.textContent = themes[currentCategory].name;
495
  renderTopics();
496
  }
497
 
498
  function renderTopics() {
 
499
  topicsGrid.innerHTML = '';
500
+ themes[currentCategory].topics.forEach((topic, index) => {
501
  const card = document.createElement('div');
502
  card.className = 'topic-card';
503
  if (usedTopics.includes(index)) {
 
509
  ${usedTopics.includes(index) ? '<div class="used-badge">USED</div>' : ''}
510
  `;
511
  if (!usedTopics.includes(index)) {
512
+ card.addEventListener('click', () => selectTopic(index));
513
  }
514
  topicsGrid.appendChild(card);
515
  });
516
  }
517
 
518
  function selectTopic(index) {
519
+ selectedTopicText.textContent = themes[currentCategory].topics[index];
520
  usedTopics.push(index);
521
+ topicsContainer.classList.remove('active');
522
+ speakingSection.classList.add('active');
523
  resetTimer();
524
  }
525
 
 
528
  isRunning = false;
529
  timeElapsed = 0;
530
  updateTimerDisplay();
531
+ startBtn.disabled = false;
532
  }
533
 
534
  function updateTimerDisplay() {
535
  const minutes = Math.floor(timeElapsed / 60);
536
  const seconds = timeElapsed % 60;
537
+ timerDisplay.textContent = `${minutes}:${seconds.toString().padStart(2, '0')}`;
 
538
 
539
+ timerDisplay.classList.remove('green', 'yellow', 'red');
540
  if (timeElapsed < 60) {
541
+ timerDisplay.classList.add('green');
542
  } else if (timeElapsed < 90) {
543
+ timerDisplay.classList.add('yellow');
544
  } else {
545
+ timerDisplay.classList.add('red');
546
  }
547
  }
548
 
549
  function startTimer() {
550
  if (isRunning) return;
551
  isRunning = true;
552
+ startBtn.disabled = true;
553
 
554
  timerInterval = setInterval(() => {
555
  timeElapsed++;
 
562
  }, 1000);
563
  }
564
 
565
+ startBtn.addEventListener('click', startTimer);
 
566
 
567
+ nextSpeakerBtn.addEventListener('click', () => {
568
+ speakingSection.classList.remove('active');
569
+ topicsContainer.classList.add('active');
570
  renderTopics();
571
  resetTimer();
572
+ });
573
 
574
+ backBtn.addEventListener('click', () => {
575
+ topicsContainer.classList.remove('active');
576
+ categorySelection.style.display = 'block';
577
+ });
578
 
579
+ backToTopicsBtn.addEventListener('click', () => {
580
+ speakingSection.classList.remove('active');
581
+ topicsContainer.classList.add('active');
582
  resetTimer();
583
+ });
584
 
585
+ resetUsedBtn.addEventListener('click', () => {
586
  if (confirm('Reset all used topics for this theme?')) {
587
  usedTopics = [];
588
  renderTopics();
589
  }
590
+ });
 
 
 
591
  </script>
592
  </body>
593
  </html>