Spaces:
Running
Running
File size: 24,250 Bytes
00d0e0c | 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 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reading Practice - RISE</title>
<link rel="stylesheet" href="style.css">
<style>
/* ----------------------------------------------------------------
PAGE-SPECIFIC STYLES
All colours and type follow style.css; these rules only handle
layout and components that don't exist on other pages.
---------------------------------------------------------------- */
/* Hero */
.reading-hero {
padding: 120px 5% 60px;
text-align: center;
max-width: 720px;
margin: 0 auto;
}
.reading-hero h1 {
font-size: clamp(2rem, 5vw, 3.2rem);
line-height: 1.15;
margin: 12px 0 20px;
}
.reading-hero p {
font-size: 1.1rem;
opacity: 0.75;
max-width: 560px;
margin: 0 auto 40px;
line-height: 1.7;
}
/* Current level pill */
.current-pill {
display: inline-flex;
align-items: center;
gap: 8px;
background: rgba(255,255,255,0.07);
border: 1px solid rgba(255,255,255,0.15);
border-radius: 100px;
padding: 8px 20px;
font-size: 0.9rem;
margin-bottom: 32px;
}
.current-pill .dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #7c6ff7;
flex-shrink: 0;
}
/* ----------------------------------------------------------------
LEVELS GRID
---------------------------------------------------------------- */
.levels-section {
padding: 20px 5% 80px;
max-width: 1100px;
margin: 0 auto;
}
.levels-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 24px;
margin-top: 48px;
}
/* Each level card */
.level-card {
border-radius: 16px;
padding: 36px 32px;
display: flex;
flex-direction: column;
gap: 16px;
position: relative;
overflow: hidden;
transition: transform 0.2s, box-shadow 0.2s;
cursor: pointer;
border: 1px solid rgba(255,255,255,0.08);
background: rgba(255,255,255,0.03);
}
.level-card:hover {
transform: translateY(-4px);
box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
/* Accent strip at the top of each card */
.level-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
border-radius: 16px 16px 0 0;
}
.level-card.l1::before { background: #7c6ff7; }
.level-card.l2::before { background: #56b0f5; }
.level-card.l3::before { background: #4ecdc4; }
.level-card.l4::before { background: #f5a623; }
.level-card.l5::before { background: #f56565; }
/* Number badge */
.level-badge {
font-size: 0.75rem;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
opacity: 0.5;
}
.level-card .level-icon {
font-size: 2rem;
line-height: 1;
}
.level-card h3 {
font-size: 1.25rem;
font-weight: 700;
margin: 0;
}
.level-card .level-desc {
font-size: 0.92rem;
opacity: 0.65;
line-height: 1.6;
flex: 1;
}
/* Part pills inside each card */
.part-pills {
display: flex;
gap: 8px;
flex-wrap: wrap;
margin-top: 4px;
}
.part-pill {
font-size: 0.75rem;
font-weight: 600;
padding: 4px 12px;
border-radius: 100px;
background: rgba(255,255,255,0.08);
border: 1px solid rgba(255,255,255,0.12);
opacity: 0.8;
}
/* Lock overlay for locked levels */
.level-card.locked {
cursor: not-allowed;
}
.level-card.locked::after {
content: 'π';
position: absolute;
top: 20px;
right: 20px;
font-size: 1.1rem;
opacity: 0.5;
}
.level-card.locked:hover {
transform: none;
box-shadow: none;
}
/* Active indicator for current level */
.level-card.active-level {
border-color: rgba(124, 111, 247, 0.4);
background: rgba(124, 111, 247, 0.05);
}
.active-badge {
display: inline-block;
font-size: 0.7rem;
font-weight: 700;
letter-spacing: 0.06em;
text-transform: uppercase;
background: rgba(124,111,247,0.2);
border: 1px solid rgba(124,111,247,0.4);
color: #a99ff7;
padding: 3px 10px;
border-radius: 100px;
margin-top: -4px;
}
.level-card .start-btn {
margin-top: 8px;
display: inline-block;
padding: 12px 24px;
border-radius: 8px;
font-size: 0.9rem;
font-weight: 600;
text-align: center;
cursor: pointer;
border: none;
transition: opacity 0.15s;
text-decoration: none;
}
.level-card.locked .start-btn {
background: rgba(255,255,255,0.06);
color: rgba(255,255,255,0.35);
cursor: not-allowed;
}
.level-card:not(.locked) .start-btn {
background: #7c6ff7;
color: #fff;
}
.level-card:not(.locked) .start-btn:hover {
opacity: 0.88;
}
/* ----------------------------------------------------------------
HOW THE LEVELS WORK β info strip
---------------------------------------------------------------- */
.how-levels-section {
padding: 60px 5%;
border-top: 1px solid rgba(255,255,255,0.07);
border-bottom: 1px solid rgba(255,255,255,0.07);
background: rgba(255,255,255,0.02);
}
.how-levels-inner {
max-width: 1000px;
margin: 0 auto;
}
.how-levels-steps {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 32px;
margin-top: 48px;
}
.how-step {
display: flex;
flex-direction: column;
gap: 12px;
}
.how-step-icon {
font-size: 1.6rem;
}
.how-step h4 {
font-size: 1rem;
font-weight: 700;
margin: 0;
}
.how-step p {
font-size: 0.88rem;
opacity: 0.6;
line-height: 1.6;
margin: 0;
}
/* ----------------------------------------------------------------
GESTURE GUIDE
---------------------------------------------------------------- */
.gesture-section {
padding: 70px 5%;
max-width: 900px;
margin: 0 auto;
}
.gesture-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 20px;
margin-top: 40px;
}
.gesture-card {
background: rgba(255,255,255,0.03);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 12px;
padding: 24px 20px;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
}
.gesture-emoji {
font-size: 2rem;
}
.gesture-label {
font-size: 0.8rem;
font-weight: 700;
letter-spacing: 0.04em;
text-transform: uppercase;
opacity: 0.45;
}
.gesture-action {
font-size: 0.9rem;
font-weight: 600;
margin: 0;
}
.gesture-card p {
font-size: 0.8rem;
opacity: 0.55;
line-height: 1.5;
margin: 0;
}
/* ----------------------------------------------------------------
MODAL β launched when user clicks Start (non-locked levels)
---------------------------------------------------------------- */
.modal-backdrop {
display: none;
position: fixed;
inset: 0;
background: rgba(0,0,0,0.75);
z-index: 1000;
align-items: center;
justify-content: center;
padding: 24px;
}
.modal-backdrop.open {
display: flex;
}
.modal {
background: #1a1a2e;
border: 1px solid rgba(255,255,255,0.12);
border-radius: 20px;
padding: 44px 40px;
max-width: 520px;
width: 100%;
position: relative;
}
.modal h2 {
margin: 0 0 12px;
font-size: 1.6rem;
}
.modal p {
opacity: 0.65;
line-height: 1.65;
margin: 0 0 28px;
font-size: 0.95rem;
}
.modal-parts {
display: flex;
gap: 12px;
margin-bottom: 32px;
}
.modal-part {
flex: 1;
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.1);
border-radius: 10px;
padding: 16px 12px;
text-align: center;
font-size: 0.82rem;
}
.modal-part .part-num {
font-size: 1.4rem;
margin-bottom: 4px;
}
.modal-part strong {
display: block;
font-size: 0.85rem;
margin-bottom: 4px;
}
.modal-part span {
opacity: 0.5;
font-size: 0.78rem;
}
.modal-actions {
display: flex;
gap: 12px;
}
.modal-close {
position: absolute;
top: 16px;
right: 20px;
background: none;
border: none;
color: rgba(255,255,255,0.4);
font-size: 1.4rem;
cursor: pointer;
line-height: 1;
}
.modal-close:hover {
color: rgba(255,255,255,0.8);
}
.btn-secondary-modal {
padding: 12px 24px;
border-radius: 8px;
font-size: 0.9rem;
font-weight: 600;
border: 1px solid rgba(255,255,255,0.15);
background: transparent;
color: rgba(255,255,255,0.7);
cursor: pointer;
}
.btn-secondary-modal:hover {
background: rgba(255,255,255,0.06);
}
/* Responsive */
@media (max-width: 600px) {
.modal { padding: 32px 24px; }
.modal-parts { flex-direction: column; }
.modal-actions { flex-direction: column; }
.levels-grid { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<!-- ================================================================
NAVIGATION (matches all other pages exactly)
================================================================ -->
<nav class="navbar">
<div class="logo">RISE</div>
<div class="nav-links">
<a href="dashboard.html">Home</a>
<a href="reading.html" class="active">Reading</a>
<a href="speaking.html">Speaking</a>
</div>
<a href="index.html" class="signin-btn">Log Out</a>
</nav>
<!-- ================================================================
HERO
================================================================ -->
<section class="reading-hero">
<p class="small-title">READING PRACTICE</p>
<h1>Build fluency,<br><span>one level at a time.</span></h1>
<p>
Read aloud, get real-time pronunciation feedback, and advance through
five levels of increasing complexity β from simple sentences to full stories.
</p>
<div class="current-pill">
<span class="dot"></span>
<span id="hero-level-text">You are on Level 1 β Beginner</span>
</div>
</section>
<!-- ================================================================
HOW LEVELS WORK
================================================================ -->
<section class="how-levels-section">
<div class="how-levels-inner">
<div class="section-heading" style="text-align:left; max-width:480px;">
<p>HOW IT WORKS</p>
<h2>Each level has three parts</h2>
</div>
<div class="how-levels-steps">
<div class="how-step">
<div class="how-step-icon">π</div>
<h4>Part 1 β Sentence</h4>
<p>Read a set of short sentences. Good for warming up and building word-by-word accuracy.</p>
</div>
<div class="how-step">
<div class="how-step-icon">π</div>
<h4>Part 2 β Paragraph</h4>
<p>Read a connected paragraph on one topic. Builds reading flow and natural phrasing.</p>
</div>
<div class="how-step">
<div class="how-step-icon">π</div>
<h4>Part 3 β Story</h4>
<p>Read a short story with a beginning, middle and end. The full fluency challenge.</p>
</div>
<div class="how-step">
<div class="how-step-icon">π―</div>
<h4>Score 85% to advance</h4>
<p>You need 85% or above in each part. If you slip on Part 2 or 3, you restart from Part 1.</p>
</div>
</div>
</div>
</section>
<!-- ================================================================
LEVELS GRID
================================================================ -->
<section class="levels-section">
<div class="section-heading" style="text-align:center;">
<p>CHOOSE YOUR LEVEL</p>
<h2>Where would you like to read today?</h2>
</div>
<div class="levels-grid" id="levels-grid">
<!-- Level 1 β always unlocked -->
<div class="level-card l1" id="card-1" onclick="openModal(1)">
<div class="level-badge">Level 1</div>
<div class="level-icon">π±</div>
<h3>Beginner</h3>
<p class="level-desc">
Short everyday sentences using simple, common words. A comfortable
starting point focused on building word-level accuracy.
</p>
<div class="part-pills">
<span class="part-pill">Sentences</span>
<span class="part-pill">Paragraph</span>
<span class="part-pill">Story</span>
</div>
<button class="start-btn">Start Level 1</button>
</div>
<!-- Level 2 -->
<div class="level-card l2" id="card-2" onclick="openModal(2)">
<div class="level-badge">Level 2</div>
<div class="level-icon">π</div>
<h3>Elementary</h3>
<p class="level-desc">
Slightly longer sentences with a wider vocabulary. Introduces
descriptive language and connected ideas.
</p>
<div class="part-pills">
<span class="part-pill">Sentences</span>
<span class="part-pill">Paragraph</span>
<span class="part-pill">Story</span>
</div>
<button class="start-btn">Start Level 2</button>
</div>
<!-- Level 3 -->
<div class="level-card l3" id="card-3" onclick="openModal(3)">
<div class="level-badge">Level 3</div>
<div class="level-icon">π</div>
<h3>Intermediate</h3>
<p class="level-desc">
Multi-clause sentences with richer vocabulary and descriptive
passages. A step up in reading flow and phrasing.
</p>
<div class="part-pills">
<span class="part-pill">Sentences</span>
<span class="part-pill">Paragraph</span>
<span class="part-pill">Story</span>
</div>
<button class="start-btn">Start Level 3</button>
</div>
<!-- Level 4 -->
<div class="level-card l4" id="card-4" onclick="openModal(4)">
<div class="level-badge">Level 4</div>
<div class="level-icon">π</div>
<h3>Upper Intermediate</h3>
<p class="level-desc">
Complex sentence structures, abstract vocabulary and nuanced ideas.
Designed for confident, fluid reading.
</p>
<div class="part-pills">
<span class="part-pill">Sentences</span>
<span class="part-pill">Paragraph</span>
<span class="part-pill">Story</span>
</div>
<button class="start-btn">Start Level 4</button>
</div>
<!-- Level 5 -->
<div class="level-card l5" id="card-5" onclick="openModal(5)">
<div class="level-badge">Level 5</div>
<div class="level-icon">π</div>
<h3>Advanced</h3>
<p class="level-desc">
Sophisticated academic and literary language. Complex syntax,
formal register, and rich vocabulary throughout.
</p>
<div class="part-pills">
<span class="part-pill">Sentences</span>
<span class="part-pill">Paragraph</span>
<span class="part-pill">Story</span>
</div>
<button class="start-btn">Start Level 5</button>
</div>
</div>
</section>
<!-- ================================================================
GESTURE GUIDE
================================================================ -->
<section class="gesture-section">
<div class="section-heading" style="text-align:center;">
<p>HAND GESTURES</p>
<h2>Navigate with your hands</h2>
</div>
<div class="gesture-grid">
<div class="gesture-card">
<div class="gesture-emoji">βοΈ</div>
<div class="gesture-label">1 finger</div>
<p class="gesture-action">Jump to Level 1</p>
</div>
<div class="gesture-card">
<div class="gesture-emoji">βοΈ</div>
<div class="gesture-label">2 fingers</div>
<p class="gesture-action">Jump to Level 2</p>
</div>
<div class="gesture-card">
<div class="gesture-emoji">π€</div>
<div class="gesture-label">3 fingers</div>
<p class="gesture-action">Jump to Level 3</p>
</div>
<div class="gesture-card">
<div class="gesture-emoji">π</div>
<div class="gesture-label">4 fingers</div>
<p class="gesture-action">Jump to Level 4</p>
</div>
<div class="gesture-card">
<div class="gesture-emoji">β</div>
<div class="gesture-label">Open palm</div>
<p class="gesture-action">Jump to Level 5</p>
</div>
<div class="gesture-card">
<div class="gesture-emoji">π</div>
<div class="gesture-label">Thumbs up</div>
<p class="gesture-action">Restart from Level 1</p>
</div>
<div class="gesture-card">
<div class="gesture-emoji">π</div>
<div class="gesture-label">Thumbs down</div>
<p class="gesture-action">Pause & see results</p>
</div>
</div>
<p style="text-align:center; opacity:0.45; font-size:0.85rem; margin-top:28px;">
Gestures are detected automatically between passages inside the Colab session.
</p>
</section>
<!-- ================================================================
FOOTER (matches all other pages)
================================================================ -->
<footer>
<div class="logo">RISE</div>
<p>AI-powered social communication coaching.</p>
<p class="copyright">Β© 2026 RISE. All rights reserved.</p>
</footer>
<!-- ================================================================
START MODAL
================================================================ -->
<div class="modal-backdrop" id="modal-backdrop" onclick="closeModal(event)">
<div class="modal" id="modal">
<button class="modal-close" onclick="closeModalDirect()">β</button>
<h2 id="modal-title">Level 1 β Beginner</h2>
<p id="modal-desc">
You are about to start Level 1. Read each passage aloud and score 85%
or above to move through the three parts.
</p>
<div class="modal-parts">
<div class="modal-part">
<div class="part-num">π</div>
<strong>Part 1</strong>
<span>Sentences</span>
</div>
<div class="modal-part">
<div class="part-num">π</div>
<strong>Part 2</strong>
<span>Paragraph</span>
</div>
<div class="modal-part">
<div class="part-num">π</div>
<strong>Part 3</strong>
<span>Story</span>
</div>
</div>
<div class="modal-actions">
<a id="modal-colab-link" href="#" target="_blank" class="primary-btn" style="flex:1; text-align:center; padding:14px;">
Open in Colab
</a>
<button class="btn-secondary-modal" onclick="closeModalDirect()">
Cancel
</button>
</div>
</div>
</div>
<!-- ================================================================
JAVASCRIPT
================================================================ -->
<script>
// ----------------------------------------------------------------
// Level metadata
// ----------------------------------------------------------------
const LEVELS = {
1: {
name: "Beginner",
label: "Level 1 β Beginner",
colour: "#7c6ff7",
desc: "You are about to start Level 1. Read short everyday sentences aloud and score 85%+ in each part to advance.",
colab: "#", // replace with your Colab notebook URL
},
2: {
name: "Elementary",
label: "Level 2 β Elementary",
colour: "#56b0f5",
desc: "You are starting Level 2. Sentences are a little longer and vocabulary is wider. Score 85%+ in each part to move on.",
colab: "#",
},
3: {
name: "Intermediate",
label: "Level 3 β Intermediate",
colour: "#4ecdc4",
desc: "Level 3 introduces multi-clause sentences and richer descriptions. Score 85%+ in all three parts to advance.",
colab: "#",
},
4: {
name: "Upper Intermediate",
label: "Level 4 β Upper Intermediate",
colour: "#f5a623",
desc: "Level 4 uses complex structures and abstract vocabulary. Score 85%+ to reach the final level.",
colab: "#",
},
5: {
name: "Advanced",
label: "Level 5 β Advanced",
colour: "#f56565",
desc: "The highest level. Literary and academic language, sophisticated syntax. Complete all three parts to finish the programme.",
colab: "#",
},
};
// ----------------------------------------------------------------
// Read progress from localStorage
// ----------------------------------------------------------------
const savedLevel = Number(localStorage.getItem("readingLevel")) || 1;
const savedPart = Number(localStorage.getItem("readingPart")) || 1;
// ----------------------------------------------------------------
// Mark cards as locked / active on page load
// ----------------------------------------------------------------
function applyLockStates() {
for (let i = 1; i <= 5; i++) {
const card = document.getElementById("card-" + i);
if (!card) continue;
// Remove any existing state classes
card.classList.remove("locked", "active-level");
// Remove previous active badge if any
const prevBadge = card.querySelector(".active-badge");
if (prevBadge) prevBadge.remove();
if (i > savedLevel) {
// Future level β lock it
card.classList.add("locked");
card.querySelector(".start-btn").textContent = "Locked";
} else if (i === savedLevel) {
// Current level β mark as active
card.classList.add("active-level");
const badge = document.createElement("span");
badge.className = "active-badge";
badge.textContent = "Current level Β· Part " + savedPart + " / 3";
card.querySelector("h3").insertAdjacentElement("afterend", badge);
card.querySelector(".start-btn").textContent = "Continue Level " + i;
} else {
// Completed level
card.querySelector(".start-btn").textContent = "Revisit Level " + i;
}
}
// Update hero pill
const heroText = document.getElementById("hero-level-text");
heroText.textContent =
"You are on Level " + savedLevel +
" β " + LEVELS[savedLevel].name +
" (Part " + savedPart + " of 3)";
}
applyLockStates();
// ----------------------------------------------------------------
// Modal
// ----------------------------------------------------------------
let selectedLevel = null;
function openModal(levelNum) {
if (levelNum > savedLevel) return; // locked β do nothing
selectedLevel = levelNum;
const data = LEVELS[levelNum];
document.getElementById("modal-title").textContent = data.label;
document.getElementById("modal-desc").textContent = data.desc;
document.getElementById("modal-colab-link").href = data.colab;
// Tint the modal accent strip to match the level colour
document.getElementById("modal").style.borderTopColor = data.colour;
document.getElementById("modal").style.borderTopWidth = "3px";
document.getElementById("modal-backdrop").classList.add("open");
}
function closeModalDirect() {
document.getElementById("modal-backdrop").classList.remove("open");
}
function closeModal(e) {
if (e.target === document.getElementById("modal-backdrop")) {
closeModalDirect();
}
}
// Close on Escape
document.addEventListener("keydown", e => {
if (e.key === "Escape") closeModalDirect();
});
</script>
</body>
</html>
|