Update index.html
Browse files- index.html +58 -23
index.html
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
<!DOCTYPE html>
|
|
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
|
@@ -203,6 +204,10 @@
|
|
| 203 |
color: #ef4444;
|
| 204 |
}
|
| 205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
.controls {
|
| 207 |
background: white;
|
| 208 |
border-radius: 1rem;
|
|
@@ -246,6 +251,8 @@
|
|
| 246 |
button:hover:not(:disabled) { transform: translateY(-2px); }
|
| 247 |
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
|
| 248 |
|
|
|
|
|
|
|
| 249 |
.btn-start { background: #22c55e; }
|
| 250 |
.btn-start:hover:not(:disabled) { background: #16a34a; }
|
| 251 |
.btn-next { background: #3b82f6; }
|
|
@@ -313,7 +320,7 @@
|
|
| 313 |
|
| 314 |
<div class="scenario-display hidden" id="scenarioDisplay">
|
| 315 |
<div class="conversation-tip">
|
| 316 |
-
<p>Each person should try not to talk more than 30 seconds
|
| 317 |
</div>
|
| 318 |
|
| 319 |
<div class="roles-container">
|
|
@@ -327,15 +334,18 @@
|
|
| 327 |
</div>
|
| 328 |
</div>
|
| 329 |
<div class="timer-display-container">
|
| 330 |
-
<div class="timer-display" id="timerDisplay">2:00</div>
|
| 331 |
</div>
|
| 332 |
</div>
|
| 333 |
|
| 334 |
<div class="controls">
|
| 335 |
-
<div class="placeholder-text" id="placeholderText">Select a category and press
|
| 336 |
<div class="buttons">
|
| 337 |
-
<button id="
|
| 338 |
-
<span>
|
|
|
|
|
|
|
|
|
|
| 339 |
</button>
|
| 340 |
<button id="nextBtn" class="btn-next hidden">
|
| 341 |
<span>→</span> Next Scenario
|
|
@@ -351,10 +361,11 @@
|
|
| 351 |
<ol>
|
| 352 |
<li>Select a scenario category that interests you</li>
|
| 353 |
<li>Set your conversation duration (2 to 4 minutes)</li>
|
| 354 |
-
<li>Press
|
| 355 |
-
<li>
|
| 356 |
-
<li>
|
| 357 |
-
<li>
|
|
|
|
| 358 |
</ol>
|
| 359 |
</div>
|
| 360 |
</div>
|
|
@@ -455,12 +466,14 @@
|
|
| 455 |
|
| 456 |
let selectedCategory = null;
|
| 457 |
let isRunning = false;
|
|
|
|
| 458 |
let timerInterval = null;
|
| 459 |
let remainingSeconds = 120;
|
| 460 |
let durationSeconds = 120;
|
| 461 |
let currentScenario = null;
|
| 462 |
|
| 463 |
const categoryBtns = document.querySelectorAll('.category-btn');
|
|
|
|
| 464 |
const startBtn = document.getElementById('startBtn');
|
| 465 |
const nextBtn = document.getElementById('nextBtn');
|
| 466 |
const resetBtn = document.getElementById('resetBtn');
|
|
@@ -477,7 +490,7 @@
|
|
| 477 |
categoryBtns.forEach(b => b.classList.remove('selected'));
|
| 478 |
btn.classList.add('selected');
|
| 479 |
selectedCategory = btn.dataset.category;
|
| 480 |
-
|
| 481 |
});
|
| 482 |
});
|
| 483 |
|
|
@@ -503,10 +516,12 @@
|
|
| 503 |
timerDisplay.textContent = formatTime(remainingSeconds);
|
| 504 |
|
| 505 |
timerDisplay.classList.remove('warning', 'danger');
|
| 506 |
-
if (
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
|
|
|
|
|
|
| 510 |
}
|
| 511 |
}
|
| 512 |
|
|
@@ -528,10 +543,10 @@
|
|
| 528 |
}
|
| 529 |
}
|
| 530 |
|
| 531 |
-
function
|
| 532 |
-
if (!selectedCategory
|
| 533 |
|
| 534 |
-
|
| 535 |
remainingSeconds = durationSeconds;
|
| 536 |
currentScenario = getRandomScenario();
|
| 537 |
|
|
@@ -542,17 +557,30 @@
|
|
| 542 |
role2.textContent = currentScenario.role2;
|
| 543 |
updateTimerDisplay();
|
| 544 |
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
startBtn.disabled = true;
|
| 548 |
durationSlider.disabled = true;
|
| 549 |
categoryBtns.forEach(btn => btn.style.pointerEvents = 'none');
|
| 550 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 551 |
startTimer();
|
| 552 |
}
|
| 553 |
|
| 554 |
function next() {
|
| 555 |
stopTimer();
|
|
|
|
|
|
|
| 556 |
remainingSeconds = durationSeconds;
|
| 557 |
currentScenario = getRandomScenario();
|
| 558 |
|
|
@@ -560,26 +588,33 @@
|
|
| 560 |
role2.textContent = currentScenario.role2;
|
| 561 |
updateTimerDisplay();
|
| 562 |
|
| 563 |
-
|
|
|
|
|
|
|
|
|
|
| 564 |
}
|
| 565 |
|
| 566 |
function reset() {
|
| 567 |
stopTimer();
|
| 568 |
isRunning = false;
|
|
|
|
| 569 |
remainingSeconds = durationSeconds;
|
| 570 |
|
| 571 |
placeholderText.classList.remove('hidden');
|
| 572 |
scenarioDisplay.classList.add('hidden');
|
| 573 |
|
| 574 |
-
|
|
|
|
| 575 |
nextBtn.classList.add('hidden');
|
| 576 |
-
|
| 577 |
durationSlider.disabled = false;
|
| 578 |
categoryBtns.forEach(btn => btn.style.pointerEvents = 'auto');
|
| 579 |
|
|
|
|
| 580 |
updateTimerDisplay();
|
| 581 |
}
|
| 582 |
|
|
|
|
| 583 |
startBtn.addEventListener('click', start);
|
| 584 |
nextBtn.addEventListener('click', next);
|
| 585 |
resetBtn.addEventListener('click', reset);
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<!DOCTYPE html>
|
| 3 |
<html lang="en">
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8">
|
|
|
|
| 204 |
color: #ef4444;
|
| 205 |
}
|
| 206 |
|
| 207 |
+
.timer-display.paused {
|
| 208 |
+
color: #6b7280;
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
.controls {
|
| 212 |
background: white;
|
| 213 |
border-radius: 1rem;
|
|
|
|
| 251 |
button:hover:not(:disabled) { transform: translateY(-2px); }
|
| 252 |
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
|
| 253 |
|
| 254 |
+
.btn-show { background: #3b82f6; }
|
| 255 |
+
.btn-show:hover:not(:disabled) { background: #2563eb; }
|
| 256 |
.btn-start { background: #22c55e; }
|
| 257 |
.btn-start:hover:not(:disabled) { background: #16a34a; }
|
| 258 |
.btn-next { background: #3b82f6; }
|
|
|
|
| 320 |
|
| 321 |
<div class="scenario-display hidden" id="scenarioDisplay">
|
| 322 |
<div class="conversation-tip">
|
| 323 |
+
<p>Each person should try not to talk more than 30 seconds each time, to encourage back and forth conversation</p>
|
| 324 |
</div>
|
| 325 |
|
| 326 |
<div class="roles-container">
|
|
|
|
| 334 |
</div>
|
| 335 |
</div>
|
| 336 |
<div class="timer-display-container">
|
| 337 |
+
<div class="timer-display paused" id="timerDisplay">2:00</div>
|
| 338 |
</div>
|
| 339 |
</div>
|
| 340 |
|
| 341 |
<div class="controls">
|
| 342 |
+
<div class="placeholder-text" id="placeholderText">Select a category and press Show Roles</div>
|
| 343 |
<div class="buttons">
|
| 344 |
+
<button id="showBtn" class="btn-show" disabled>
|
| 345 |
+
<span>👁</span> Show Roles
|
| 346 |
+
</button>
|
| 347 |
+
<button id="startBtn" class="btn-start hidden">
|
| 348 |
+
<span>▶</span> Start Timer
|
| 349 |
</button>
|
| 350 |
<button id="nextBtn" class="btn-next hidden">
|
| 351 |
<span>→</span> Next Scenario
|
|
|
|
| 361 |
<ol>
|
| 362 |
<li>Select a scenario category that interests you</li>
|
| 363 |
<li>Set your conversation duration (2 to 4 minutes)</li>
|
| 364 |
+
<li>Press Show Roles to see the scenario (timer won't start yet)</li>
|
| 365 |
+
<li>Read the roles and decide who will be Person 1 and Person 2</li>
|
| 366 |
+
<li>When ready, press Start Timer to begin the conversation</li>
|
| 367 |
+
<li>Use Short-Link-Stop pattern during your conversation</li>
|
| 368 |
+
<li>When finished, click Next Scenario or Reset to change categories</li>
|
| 369 |
</ol>
|
| 370 |
</div>
|
| 371 |
</div>
|
|
|
|
| 466 |
|
| 467 |
let selectedCategory = null;
|
| 468 |
let isRunning = false;
|
| 469 |
+
let rolesShown = false;
|
| 470 |
let timerInterval = null;
|
| 471 |
let remainingSeconds = 120;
|
| 472 |
let durationSeconds = 120;
|
| 473 |
let currentScenario = null;
|
| 474 |
|
| 475 |
const categoryBtns = document.querySelectorAll('.category-btn');
|
| 476 |
+
const showBtn = document.getElementById('showBtn');
|
| 477 |
const startBtn = document.getElementById('startBtn');
|
| 478 |
const nextBtn = document.getElementById('nextBtn');
|
| 479 |
const resetBtn = document.getElementById('resetBtn');
|
|
|
|
| 490 |
categoryBtns.forEach(b => b.classList.remove('selected'));
|
| 491 |
btn.classList.add('selected');
|
| 492 |
selectedCategory = btn.dataset.category;
|
| 493 |
+
showBtn.disabled = false;
|
| 494 |
});
|
| 495 |
});
|
| 496 |
|
|
|
|
| 516 |
timerDisplay.textContent = formatTime(remainingSeconds);
|
| 517 |
|
| 518 |
timerDisplay.classList.remove('warning', 'danger');
|
| 519 |
+
if (isRunning) {
|
| 520 |
+
if (remainingSeconds <= 30) {
|
| 521 |
+
timerDisplay.classList.add('danger');
|
| 522 |
+
} else if (remainingSeconds <= 60) {
|
| 523 |
+
timerDisplay.classList.add('warning');
|
| 524 |
+
}
|
| 525 |
}
|
| 526 |
}
|
| 527 |
|
|
|
|
| 543 |
}
|
| 544 |
}
|
| 545 |
|
| 546 |
+
function showRoles() {
|
| 547 |
+
if (!selectedCategory) return;
|
| 548 |
|
| 549 |
+
rolesShown = true;
|
| 550 |
remainingSeconds = durationSeconds;
|
| 551 |
currentScenario = getRandomScenario();
|
| 552 |
|
|
|
|
| 557 |
role2.textContent = currentScenario.role2;
|
| 558 |
updateTimerDisplay();
|
| 559 |
|
| 560 |
+
showBtn.classList.add('hidden');
|
| 561 |
+
startBtn.classList.remove('hidden');
|
|
|
|
| 562 |
durationSlider.disabled = true;
|
| 563 |
categoryBtns.forEach(btn => btn.style.pointerEvents = 'none');
|
| 564 |
|
| 565 |
+
timerDisplay.classList.add('paused');
|
| 566 |
+
}
|
| 567 |
+
|
| 568 |
+
function start() {
|
| 569 |
+
if (!rolesShown || isRunning) return;
|
| 570 |
+
|
| 571 |
+
isRunning = true;
|
| 572 |
+
timerDisplay.classList.remove('paused');
|
| 573 |
+
|
| 574 |
+
startBtn.classList.add('hidden');
|
| 575 |
+
nextBtn.classList.remove('hidden');
|
| 576 |
+
|
| 577 |
startTimer();
|
| 578 |
}
|
| 579 |
|
| 580 |
function next() {
|
| 581 |
stopTimer();
|
| 582 |
+
isRunning = false;
|
| 583 |
+
rolesShown = false;
|
| 584 |
remainingSeconds = durationSeconds;
|
| 585 |
currentScenario = getRandomScenario();
|
| 586 |
|
|
|
|
| 588 |
role2.textContent = currentScenario.role2;
|
| 589 |
updateTimerDisplay();
|
| 590 |
|
| 591 |
+
timerDisplay.classList.add('paused');
|
| 592 |
+
nextBtn.classList.add('hidden');
|
| 593 |
+
startBtn.classList.remove('hidden');
|
| 594 |
+
rolesShown = true;
|
| 595 |
}
|
| 596 |
|
| 597 |
function reset() {
|
| 598 |
stopTimer();
|
| 599 |
isRunning = false;
|
| 600 |
+
rolesShown = false;
|
| 601 |
remainingSeconds = durationSeconds;
|
| 602 |
|
| 603 |
placeholderText.classList.remove('hidden');
|
| 604 |
scenarioDisplay.classList.add('hidden');
|
| 605 |
|
| 606 |
+
showBtn.classList.remove('hidden');
|
| 607 |
+
startBtn.classList.add('hidden');
|
| 608 |
nextBtn.classList.add('hidden');
|
| 609 |
+
showBtn.disabled = selectedCategory === null;
|
| 610 |
durationSlider.disabled = false;
|
| 611 |
categoryBtns.forEach(btn => btn.style.pointerEvents = 'auto');
|
| 612 |
|
| 613 |
+
timerDisplay.classList.remove('paused');
|
| 614 |
updateTimerDisplay();
|
| 615 |
}
|
| 616 |
|
| 617 |
+
showBtn.addEventListener('click', showRoles);
|
| 618 |
startBtn.addEventListener('click', start);
|
| 619 |
nextBtn.addEventListener('click', next);
|
| 620 |
resetBtn.addEventListener('click', reset);
|