Spaces:
Sleeping
Sleeping
Download static/index.html from FunWith/irish-maths-ai: direct link, hf CLI and curl.
- Browser
- Download file 8.52 kB
-
https://huggingface.co/spaces/FunWith/irish-maths-ai/resolve/main/static/index.html
- Command line
-
hf download hf://spaces/FunWith/irish-maths-ai/static/index.html
-
curl -L -o index.html https://huggingface.co/spaces/FunWith/irish-maths-ai/resolve/main/static/index.html
8.52 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Mathaí — Irish Maths AI Tutor</title> | |
| <link rel="stylesheet" href="/static/styles.css"> | |
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet"> | |
| <!-- KaTeX for maths rendering --> | |
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css"> | |
| <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js"></script> | |
| <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js"></script> | |
| </head> | |
| <body> | |
| <!-- ── PIN Auth Overlay ─────────────────────────────────────────── --> | |
| <div id="pinOverlay" class="pin-overlay"> | |
| <div class="pin-card"> | |
| <div class="pin-icon">🔒</div> | |
| <h2>Enter Access Code</h2> | |
| <p>This app is currently in private preview.</p> | |
| <div class="pin-input-row"> | |
| <input type="text" id="pinInput" maxlength="4" placeholder="····" autocomplete="off" autofocus> | |
| </div> | |
| <button class="pin-submit" onclick="checkPin()">Unlock</button> | |
| <p id="pinError" class="pin-error"></p> | |
| </div> | |
| </div> | |
| <!-- ── Welcome Screen ─────────────────────────────────────────── --> | |
| <div id="welcomeScreen" class="welcome-screen"> | |
| <div class="welcome-content"> | |
| <div class="welcome-hero"> | |
| <div class="hero-icon">🧮</div> | |
| <h1>Mathaí</h1> | |
| <p class="hero-sub">Your Irish Maths AI Tutor</p> | |
| <p class="hero-desc">Get help with any maths topic from the Irish curriculum.<br>Primary, Junior Cycle & Leaving Cert.</p> | |
| </div> | |
| <div class="role-picker"> | |
| <h3>I am a...</h3> | |
| <div class="role-cards"> | |
| <button class="role-card" data-role="student" id="pickStudent"> | |
| <span class="role-icon">🎒</span> | |
| <span class="role-label">Student</span> | |
| <span class="role-hint">Get help with homework & study</span> | |
| </button> | |
| <button class="role-card" data-role="teacher" id="pickTeacher"> | |
| <span class="role-icon">👩🏫</span> | |
| <span class="role-label">Teacher</span> | |
| <span class="role-hint">Lesson plans, worksheets & ideas</span> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Level picker (shown after student is picked) --> | |
| <div class="level-picker" id="levelPicker" style="display:none;"> | |
| <h3>What level are you?</h3> | |
| <div class="level-cards"> | |
| <button class="level-card" data-level="primary"> | |
| <span class="level-emoji">🏫</span> | |
| <span class="level-name">Primary</span> | |
| <span class="level-detail">Junior Infants – 6th Class</span> | |
| </button> | |
| <button class="level-card" data-level="junior_cycle"> | |
| <span class="level-emoji">📚</span> | |
| <span class="level-name">Junior Cycle</span> | |
| <span class="level-detail">1st – 3rd Year</span> | |
| </button> | |
| <button class="level-card" data-level="senior_cycle"> | |
| <span class="level-emoji">🎓</span> | |
| <span class="level-name">Senior Cycle</span> | |
| <span class="level-detail">5th & 6th Year / Leaving Cert</span> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Class picker for primary (shown after primary is picked) --> | |
| <div class="class-picker" id="classPicker" style="display:none;"> | |
| <h3>What class are you in?</h3> | |
| <div class="class-grid" id="classGrid"></div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- ── Chat Screen ────────────────────────────────────────────── --> | |
| <div id="chatScreen" class="chat-screen" style="display:none;"> | |
| <header class="chat-header"> | |
| <div class="header-left"> | |
| <button class="btn-back" id="backBtn" title="Back to start">←</button> | |
| <div class="header-brand"> | |
| <span class="brand-icon">🧮</span> | |
| <div> | |
| <span class="brand-name">Mathaí</span> | |
| <span class="brand-level" id="headerLevel"></span> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="header-right"> | |
| <button class="btn-topics" id="topicsBtn" title="Browse topics">📖 Topics</button> | |
| <button class="btn-new-chat" id="newChatBtn" title="New conversation">+ New Chat</button> | |
| </div> | |
| </header> | |
| <main class="chat-main" id="chatMain"> | |
| <!-- Quick topic buttons --> | |
| <div class="quick-topics" id="quickTopics"></div> | |
| <!-- Messages appear here --> | |
| <div class="messages" id="messages"></div> | |
| </main> | |
| <div class="chat-input-area"> | |
| <div class="input-row"> | |
| <textarea id="chatInput" placeholder="Ask me anything about maths..." rows="1"></textarea> | |
| <button class="btn-send" id="sendBtn" title="Send"> | |
| <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg> | |
| </button> | |
| </div> | |
| <div class="input-hint"> | |
| Mathaí follows the Irish curriculum. Answers may not always be perfect — always check with your teacher! | |
| </div> | |
| </div> | |
| <!-- Topics sidebar --> | |
| <div class="topics-sidebar" id="topicsSidebar"> | |
| <div class="sidebar-header"> | |
| <h3>📖 Browse Topics</h3> | |
| <button class="sidebar-close" id="sidebarClose">×</button> | |
| </div> | |
| <div class="sidebar-content" id="sidebarContent"></div> | |
| </div> | |
| </div> | |
| <script> | |
| (async function() { | |
| var overlay = document.getElementById('pinOverlay'); | |
| var stored = localStorage.getItem('mathai_pin_token'); | |
| if (stored) { | |
| try { | |
| var r = await fetch('/api/pin/check', { | |
| method: 'POST', | |
| headers: {'Content-Type': 'application/json'}, | |
| body: JSON.stringify({token: stored}) | |
| }); | |
| var d = await r.json(); | |
| if (d.ok) { overlay.style.display = 'none'; return; } | |
| } catch(e) {} | |
| localStorage.removeItem('mathai_pin_token'); | |
| } | |
| })(); | |
| function checkPin() { | |
| var pin = document.getElementById('pinInput').value.trim(); | |
| fetch('/api/pin/verify', { | |
| method: 'POST', | |
| headers: {'Content-Type': 'application/json'}, | |
| body: JSON.stringify({pin: pin}) | |
| }).then(function(r) { return r.json(); }).then(function(d) { | |
| if (d.ok) { | |
| localStorage.setItem('mathai_pin_token', d.token); | |
| document.getElementById('pinOverlay').style.display = 'none'; | |
| } else { | |
| document.getElementById('pinError').textContent = 'Incorrect code. Try again.'; | |
| document.getElementById('pinInput').value = ''; | |
| document.getElementById('pinInput').focus(); | |
| } | |
| }).catch(function() { | |
| document.getElementById('pinError').textContent = 'Connection error. Try again.'; | |
| }); | |
| } | |
| document.getElementById('pinInput').addEventListener('keydown', function(e) { | |
| if (e.key === 'Enter') checkPin(); | |
| }); | |
| </script> | |
| <script src="/static/app.js"></script> | |
| </body> | |
| </html> | |