@@ -0,0 +1,53 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="pl">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover" />
|
||||||
|
<title>Czytanie</title>
|
||||||
|
<link rel="stylesheet" href="styles.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<!-- ── LIST SCREEN ── -->
|
||||||
|
<div id="list-wrap">
|
||||||
|
<nav class="nav-wrap">
|
||||||
|
<a href="index.html" class="back-to-hub" id="back-to-hub">← Menu</a>
|
||||||
|
</nav>
|
||||||
|
<div class="app-wrap">
|
||||||
|
<main class="screen" id="list-screen">
|
||||||
|
<h1 class="app-title">📖 Czytanie</h1>
|
||||||
|
|
||||||
|
<section class="panel">
|
||||||
|
<h2>Wybierz tekst</h2>
|
||||||
|
<div id="text-list" class="reading-list"></div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="panel">
|
||||||
|
<h2>Własny tekst</h2>
|
||||||
|
<textarea id="custom-input" class="custom-input"
|
||||||
|
placeholder="Wklej lub wpisz tekst…"></textarea>
|
||||||
|
<button id="custom-start-btn" class="mode-btn">Czytaj →</button>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ── READING SCREEN ── -->
|
||||||
|
<div id="read-wrap" class="read-wrap hidden">
|
||||||
|
<header class="read-header">
|
||||||
|
<button id="read-back-btn" class="read-nav-btn">← Lista</button>
|
||||||
|
<span id="read-title" class="read-title-text"></span>
|
||||||
|
<button id="speed-btn" class="read-nav-btn read-speed-btn">⏸</button>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="read-viewport" id="read-viewport">
|
||||||
|
<div class="read-text" id="read-text"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button id="next-line-btn" class="next-line-btn" aria-label="Następna linia">▼</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="nav.js"></script>
|
||||||
|
<script src="czytanie.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+126
@@ -0,0 +1,126 @@
|
|||||||
|
// Nauka Czytania
|
||||||
|
;(function () {
|
||||||
|
// ms between line advances for each speed level (0 = manual)
|
||||||
|
const SPEEDS_MS = [0, 3500, 2000, 1000]
|
||||||
|
const SPEED_LABELS = ['⏸', '▶', '▶▶', '▶▶▶']
|
||||||
|
|
||||||
|
let yOffset = 0
|
||||||
|
let lineH = 80 // recalculated after render
|
||||||
|
let maxOffset = 0
|
||||||
|
let speedIdx = 0
|
||||||
|
let autoTimer = null
|
||||||
|
|
||||||
|
const listWrap = document.getElementById('list-wrap')
|
||||||
|
const readWrap = document.getElementById('read-wrap')
|
||||||
|
const textList = document.getElementById('text-list')
|
||||||
|
const customInput = document.getElementById('custom-input')
|
||||||
|
const customStartBtn = document.getElementById('custom-start-btn')
|
||||||
|
const readBackBtn = document.getElementById('read-back-btn')
|
||||||
|
const readTitleEl = document.getElementById('read-title')
|
||||||
|
const speedBtn = document.getElementById('speed-btn')
|
||||||
|
const readViewport = document.getElementById('read-viewport')
|
||||||
|
const readTextEl = document.getElementById('read-text')
|
||||||
|
const nextLineBtn = document.getElementById('next-line-btn')
|
||||||
|
|
||||||
|
// ── Load text list from dyktanda.json ────────────────────────────────────
|
||||||
|
fetch('dyktanda.json')
|
||||||
|
.then(r => r.json())
|
||||||
|
.then(data => {
|
||||||
|
data.forEach(item => {
|
||||||
|
const btn = document.createElement('button')
|
||||||
|
btn.className = 'reading-item'
|
||||||
|
btn.textContent = item.name
|
||||||
|
btn.addEventListener('click', () => startReading(item.name, item.text))
|
||||||
|
textList.appendChild(btn)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
textList.innerHTML = '<p style="color:var(--muted);padding:8px 0">Nie udało się wczytać tekstów.</p>'
|
||||||
|
})
|
||||||
|
|
||||||
|
customStartBtn.addEventListener('click', () => {
|
||||||
|
const txt = customInput.value.trim()
|
||||||
|
if (!txt) return
|
||||||
|
startReading('Własny', txt)
|
||||||
|
})
|
||||||
|
|
||||||
|
// ── Start reading ─────────────────────────────────────────────────────────
|
||||||
|
function startReading(title, text) {
|
||||||
|
yOffset = 0
|
||||||
|
speedIdx = 0
|
||||||
|
clearInterval(autoTimer)
|
||||||
|
autoTimer = null
|
||||||
|
|
||||||
|
readTitleEl.textContent = title
|
||||||
|
readTextEl.textContent = text
|
||||||
|
readTextEl.style.transform = 'translateY(0)'
|
||||||
|
speedBtn.textContent = SPEED_LABELS[0]
|
||||||
|
|
||||||
|
listWrap.classList.add('hidden')
|
||||||
|
readWrap.classList.remove('hidden')
|
||||||
|
|
||||||
|
// measure real line height after layout
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
const cs = getComputedStyle(readTextEl)
|
||||||
|
const lhVal = cs.lineHeight
|
||||||
|
lineH = (lhVal === 'normal')
|
||||||
|
? parseFloat(cs.fontSize) * 1.35
|
||||||
|
: parseFloat(lhVal)
|
||||||
|
|
||||||
|
maxOffset = Math.max(0, readTextEl.offsetHeight - readViewport.offsetHeight)
|
||||||
|
updateNextBtn()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Back to list ──────────────────────────────────────────────────────────
|
||||||
|
readBackBtn.addEventListener('click', () => {
|
||||||
|
const active = yOffset > 0 || autoTimer !== null
|
||||||
|
if (active && !confirm('Wrócić do listy tekstów?')) return
|
||||||
|
clearInterval(autoTimer)
|
||||||
|
autoTimer = null
|
||||||
|
readWrap.classList.add('hidden')
|
||||||
|
listWrap.classList.remove('hidden')
|
||||||
|
})
|
||||||
|
|
||||||
|
// ── Speed selector ────────────────────────────────────────────────────────
|
||||||
|
speedBtn.addEventListener('click', () => {
|
||||||
|
clearInterval(autoTimer)
|
||||||
|
autoTimer = null
|
||||||
|
speedIdx = (speedIdx + 1) % SPEEDS_MS.length
|
||||||
|
speedBtn.textContent = SPEED_LABELS[speedIdx]
|
||||||
|
if (SPEEDS_MS[speedIdx] > 0 && yOffset < maxOffset) {
|
||||||
|
autoTimer = setInterval(advanceLine, SPEEDS_MS[speedIdx])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// ── Manual line advance ───────────────────────────────────────────────────
|
||||||
|
nextLineBtn.addEventListener('click', advanceLine)
|
||||||
|
|
||||||
|
// ── Core scroll logic ─────────────────────────────────────────────────────
|
||||||
|
function advanceLine() {
|
||||||
|
if (yOffset >= maxOffset) {
|
||||||
|
stopAutoAtEnd()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
yOffset = Math.min(yOffset + lineH, maxOffset)
|
||||||
|
readTextEl.style.transform = `translateY(${-yOffset}px)`
|
||||||
|
updateNextBtn()
|
||||||
|
if (yOffset >= maxOffset) stopAutoAtEnd()
|
||||||
|
}
|
||||||
|
|
||||||
|
function stopAutoAtEnd() {
|
||||||
|
if (autoTimer !== null) {
|
||||||
|
clearInterval(autoTimer)
|
||||||
|
autoTimer = null
|
||||||
|
speedIdx = 0
|
||||||
|
speedBtn.textContent = SPEED_LABELS[0]
|
||||||
|
}
|
||||||
|
updateNextBtn()
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateNextBtn() {
|
||||||
|
nextLineBtn.disabled = yOffset >= maxOffset
|
||||||
|
}
|
||||||
|
})()
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "Wiosenna wycieczka",
|
||||||
|
"text": "W sobotę Krzyś i Jurek pojechali z mamą do lasu. Wśród dużych drzew rosły żółte kwiaty i czerwone grzyby. Chłopcy słuchali śpiewu ptaków i szumu strumyka. Później zjedli bułki, jabłka i gorącą herbatę."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Na podwórku",
|
||||||
|
"text": "Hania huśtała się na huśtawce obok wysokiego płotu. Jej koleżanka Róża jeździła na różowym rowerze. Na chodniku bawiły się trzy małe kotki. Wieczorem dziewczynki wróciły do domu bardzo wesołe."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "W kuchni babci",
|
||||||
|
"text": "Babcia upiekła pyszne drożdżowe bułeczki z różą i jabłkami. W dużym garnku gotowała się zupa jarzynowa. Henio pomagał kroić marchewkę i ogórki. Po obiedzie wszyscy chrupali kruche ciasteczka."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Zimowy poranek",
|
||||||
|
"text": "W grudniu spadł puszysty śnieg i zrobiło się chłodno. Przed szkołą dzieci lepiły dużego bałwana. Grześ rzucał śnieżkami, a Hela ciągnęła sanki. Po zabawie wszyscy pili gorącą czekoladę."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "W zoo",
|
||||||
|
"text": "W warszawskim zoo Zuzia zobaczyła żyrafę i małego żubra. Obok wybiegów chodziły pawie i hałaśliwe papugi. Pan przewodnik opowiadał ciekawostki o zwierzętach. Na końcu wycieczki dzieci kupiły pamiątkowe magnesy."
|
||||||
|
}
|
||||||
|
]
|
||||||
+1
-6
@@ -8,12 +8,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="nav-wrap">
|
<nav class="nav-wrap">
|
||||||
<button class="hamburger-btn" id="hamburger-btn">☰</button>
|
<a href="index.html" class="back-to-hub" id="back-to-hub">← Menu</a>
|
||||||
<div class="hamburger-menu" id="hamburger-menu">
|
|
||||||
<a href="index.html"><span class="nav-icon">🏠</span> Strona główna</a>
|
|
||||||
<a href="mnozenie.html"><span class="nav-icon">×</span> Nauka mnożenia</a>
|
|
||||||
<a href="dzielenie.html"><span class="nav-icon">÷</span> Nauka dzielenia</a>
|
|
||||||
</div>
|
|
||||||
</nav>
|
</nav>
|
||||||
<div class="app-wrap">
|
<div class="app-wrap">
|
||||||
<!-- ── SELECT SCREEN ── -->
|
<!-- ── SELECT SCREEN ── -->
|
||||||
|
|||||||
+40
-147
@@ -3,157 +3,50 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover" />
|
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover" />
|
||||||
<title>Trening Matematyczny - Dodawanie/Odejmowanie</title>
|
<title>Edu — Główne Menu</title>
|
||||||
<link rel="stylesheet" href="styles.css" />
|
<link rel="stylesheet" href="styles.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="nav-wrap">
|
<div class="app-wrap">
|
||||||
<button class="hamburger-btn" id="hamburger-btn">☰</button>
|
<main class="screen hub-screen">
|
||||||
<div class="hamburger-menu" id="hamburger-menu">
|
<h1 class="app-title hub-logo">📚 Nauka</h1>
|
||||||
<a href="index.html"><span class="nav-icon">🏠</span> Strona główna</a>
|
|
||||||
<a href="mnozenie.html"><span class="nav-icon">×</span> Nauka mnożenia</a>
|
<section class="panel hub-group">
|
||||||
<a href="dzielenie.html"><span class="nav-icon">÷</span> Nauka dzielenia</a>
|
<h2 class="hub-group-title">🇵🇱 Język Polski</h2>
|
||||||
|
<div class="hub-cards">
|
||||||
|
<a href="czytanie.html" class="hub-card">
|
||||||
|
<span class="hub-card-icon">📖</span>
|
||||||
|
<span class="hub-card-label">Czytanie</span>
|
||||||
|
</a>
|
||||||
|
<a class="hub-card hub-card--disabled" aria-disabled="true">
|
||||||
|
<span class="hub-card-icon">✏️</span>
|
||||||
|
<span class="hub-card-label">Ortografia</span>
|
||||||
|
<span class="hub-card-badge">wkrótce</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="panel hub-group">
|
||||||
|
<h2 class="hub-group-title">🔢 Matematyka</h2>
|
||||||
|
<div class="hub-cards">
|
||||||
|
<a href="testy.html" class="hub-card">
|
||||||
|
<span class="hub-card-icon">📝</span>
|
||||||
|
<span class="hub-card-label">Testy</span>
|
||||||
|
</a>
|
||||||
|
<a href="mnozenie.html" class="hub-card">
|
||||||
|
<span class="hub-card-icon">×</span>
|
||||||
|
<span class="hub-card-label">Nauka mnożenia</span>
|
||||||
|
</a>
|
||||||
|
<a href="dzielenie.html" class="hub-card">
|
||||||
|
<span class="hub-card-icon">÷</span>
|
||||||
|
<span class="hub-card-label">Nauka dzielenia</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
|
||||||
<div class="app-wrap">
|
|
||||||
<main class="screen" id="menu-screen">
|
|
||||||
<h1 class="app-title">Matma Trening</h1>
|
|
||||||
|
|
||||||
<section class="panel">
|
<footer class="app-footer">Version: <span id="commit-sha">(loading)</span></footer>
|
||||||
<h2>Wybierz działania</h2>
|
<script src="version.js" defer></script>
|
||||||
<div class="ops" id="ops">
|
|
||||||
<button class="op-btn" data-op="add">+ Dodawanie</button>
|
|
||||||
<button class="op-btn" data-op="sub">− Odejmowanie</button>
|
|
||||||
<button class="op-btn" data-op="mul">× Mnożenie</button>
|
|
||||||
<button class="op-btn" data-op="div">÷ Dzielenie</button>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="panel">
|
|
||||||
<h2>Tryb gry</h2>
|
|
||||||
<div class="modes">
|
|
||||||
<button class="mode-btn" data-mode="timed" id="mode-timed">
|
|
||||||
<span class="icon">⧗</span>
|
|
||||||
Na czas
|
|
||||||
</button>
|
|
||||||
<button class="mode-btn" data-mode="training" id="mode-training">
|
|
||||||
<span class="icon">∞</span>
|
|
||||||
Trening
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<p class="hint">Wybierz co najmniej jedno działanie, a następnie tryb, aby rozpocząć.</p>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="panel">
|
|
||||||
<h2>Historia
|
|
||||||
<button id="history-toggle" class="small" style="float:right">Pokaż</button>
|
|
||||||
</h2>
|
|
||||||
<div class="history-list collapsed" id="history-panel">
|
|
||||||
<div id="history-list">
|
|
||||||
<!-- wpisy historii w menu -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="panel">
|
|
||||||
<h2>
|
|
||||||
Ustawienia
|
|
||||||
<button id="settings-toggle" class="small" style="float:right">Pokaż</button>
|
|
||||||
</h2>
|
|
||||||
<div class="settings collapsed" id="settings-panel">
|
|
||||||
<label> Czas (sek) — tryb na czas
|
|
||||||
<input id="setting-timed" type="number" min="5" max="600" />
|
|
||||||
</label>
|
|
||||||
<label> Maksymalny wynik
|
|
||||||
<input id="setting-max-result" type="number" min="1" max="999" />
|
|
||||||
</label>
|
|
||||||
<label> Maksymalna składowa (operand)
|
|
||||||
<input id="setting-max-operand" type="number" min="1" max="999" />
|
|
||||||
</label>
|
|
||||||
<label> Liczba zadań (tryb Trening)
|
|
||||||
<input id="setting-session-problems" type="number" min="1" max="500" />
|
|
||||||
</label>
|
|
||||||
<label> Wynik może być ujemny
|
|
||||||
<input id="setting-allow-negative" type="checkbox" />
|
|
||||||
</label>
|
|
||||||
<label> Wynik może być ułamkiem
|
|
||||||
<input id="setting-allow-fraction" type="checkbox" />
|
|
||||||
</label>
|
|
||||||
<div class="settings-actions">
|
|
||||||
<button id="save-settings" class="mode-btn">Zapisz</button>
|
|
||||||
<button id="reset-settings" class="mode-btn">Reset</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<main class="screen hidden" id="play-screen">
|
|
||||||
<header class="play-header">
|
|
||||||
<div class="left">
|
|
||||||
<button id="back-btn" class="small">← Menu</button>
|
|
||||||
</div>
|
|
||||||
<div class="center">
|
|
||||||
<div id="status">Trening</div>
|
|
||||||
</div>
|
|
||||||
<div class="right">
|
|
||||||
<div id="score">0</div>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
<div class="progress-outer"><div id="progress-inner" class="progress-inner"></div></div>
|
|
||||||
|
|
||||||
<section class="problem-area">
|
|
||||||
<div id="timer" class="timer hidden">60</div>
|
|
||||||
<div id="problem" class="problem">—</div>
|
|
||||||
<div id="feedback" class="feedback"></div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="answer-area">
|
|
||||||
<div id="answer" class="answer"> </div>
|
|
||||||
<div class="keypad">
|
|
||||||
<div class="row">
|
|
||||||
<button class="key">1</button>
|
|
||||||
<button class="key">2</button>
|
|
||||||
<button class="key">3</button>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<button class="key">4</button>
|
|
||||||
<button class="key">5</button>
|
|
||||||
<button class="key">6</button>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<button class="key">7</button>
|
|
||||||
<button class="key">8</button>
|
|
||||||
<button class="key">9</button>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<button class="key special" id="negate">+/-</button>
|
|
||||||
<button class="key">0</button>
|
|
||||||
<button class="key" id="dot">.</button>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<button class="key special" id="clear">C</button>
|
|
||||||
<button class="key special" id="backspace">←</button>
|
|
||||||
<button class="submit-btn" id="submit">Sprawdź</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="panel hidden" id="summary-panel">
|
|
||||||
<div class="summary">
|
|
||||||
<h2>Podsumowanie</h2>
|
|
||||||
<p id="summary-text">Poprawne odpowiedzi: 0</p>
|
|
||||||
<div style="display:flex;gap:8px;justify-content:center;margin-top:12px">
|
|
||||||
<button id="summary-back" class="mode-btn">Powrót</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer class="app-footer">Version: <span id="commit-sha">(loading)</span></footer>
|
|
||||||
|
|
||||||
<script src="version.js" defer></script>
|
|
||||||
<script src="nav.js"></script>
|
|
||||||
<script src="app.js"></script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+1
-6
@@ -8,12 +8,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="nav-wrap">
|
<nav class="nav-wrap">
|
||||||
<button class="hamburger-btn" id="hamburger-btn">☰</button>
|
<a href="index.html" class="back-to-hub" id="back-to-hub">← Menu</a>
|
||||||
<div class="hamburger-menu" id="hamburger-menu">
|
|
||||||
<a href="index.html"><span class="nav-icon">🏠</span> Strona główna</a>
|
|
||||||
<a href="mnozenie.html"><span class="nav-icon">×</span> Nauka mnożenia</a>
|
|
||||||
<a href="dzielenie.html"><span class="nav-icon">÷</span> Nauka dzielenia</a>
|
|
||||||
</div>
|
|
||||||
</nav>
|
</nav>
|
||||||
<div class="app-wrap">
|
<div class="app-wrap">
|
||||||
<!-- ── SELECT SCREEN ── -->
|
<!-- ── SELECT SCREEN ── -->
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
// Shared hamburger menu toggle
|
// Back-to-hub button with active-task confirmation
|
||||||
(function () {
|
(function () {
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const btn = document.getElementById('hamburger-btn')
|
const backBtn = document.getElementById('back-to-hub')
|
||||||
const menu = document.getElementById('hamburger-menu')
|
if (!backBtn) return
|
||||||
if (!btn || !menu) return
|
|
||||||
btn.addEventListener('click', (e) => {
|
backBtn.addEventListener('click', (e) => {
|
||||||
e.stopPropagation()
|
const playScreen = document.getElementById('play-screen')
|
||||||
menu.classList.toggle('open')
|
const taskActive = playScreen && !playScreen.classList.contains('hidden')
|
||||||
})
|
if (taskActive) {
|
||||||
document.addEventListener('click', () => menu.classList.remove('open'))
|
e.preventDefault()
|
||||||
// mark active link
|
const ok = confirm('Masz aktywne zadanie. Czy na pewno chcesz wyjść do menu?')
|
||||||
const current = location.pathname.split('/').pop() || 'index.html'
|
if (ok) window.location.href = backBtn.getAttribute('href')
|
||||||
menu.querySelectorAll('a').forEach(a => {
|
}
|
||||||
if (a.getAttribute('href') === current) a.classList.add('active')
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})()
|
})()
|
||||||
|
|||||||
+40
-10
@@ -65,16 +65,6 @@ body{
|
|||||||
|
|
||||||
.app-footer{font-size:12px;color:var(--muted);text-align:center;padding:10px 0;width:100%;max-width:420px}
|
.app-footer{font-size:12px;color:var(--muted);text-align:center;padding:10px 0;width:100%;max-width:420px}
|
||||||
|
|
||||||
/* ── Hamburger nav ── */
|
|
||||||
.nav-wrap{position:relative;width:100%;max-width:420px;display:flex;justify-content:flex-end;padding:6px 8px 0}
|
|
||||||
.hamburger-btn{background:var(--card);border:1px solid #e6e9ef;border-radius:10px;padding:8px 12px;font-size:20px;cursor:pointer;line-height:1;box-shadow:0 2px 8px rgba(16,24,40,0.07)}
|
|
||||||
.hamburger-menu{display:none;position:absolute;top:46px;right:8px;background:var(--card);border:1px solid #e6e9ef;border-radius:14px;box-shadow:0 8px 24px rgba(16,24,40,0.13);z-index:100;min-width:210px;overflow:hidden}
|
|
||||||
.hamburger-menu.open{display:block}
|
|
||||||
.hamburger-menu a{display:flex;align-items:center;gap:10px;padding:14px 18px;text-decoration:none;color:#111;font-size:16px;border-bottom:1px solid #f0f0f3}
|
|
||||||
.hamburger-menu a:last-child{border-bottom:none}
|
|
||||||
.hamburger-menu a:hover,.hamburger-menu a.active{background:#f0f4ff;color:var(--accent)}
|
|
||||||
.hamburger-menu a .nav-icon{font-size:20px;width:24px;text-align:center}
|
|
||||||
|
|
||||||
/* ── Shared learn-page styles ── */
|
/* ── Shared learn-page styles ── */
|
||||||
.learn-title{margin:20px 16px 0;font-size:22px;font-weight:700;text-align:center}
|
.learn-title{margin:20px 16px 0;font-size:22px;font-weight:700;text-align:center}
|
||||||
.learn-subtitle{text-align:center;color:var(--muted);font-size:14px;margin:4px 16px 12px}
|
.learn-subtitle{text-align:center;color:var(--muted);font-size:14px;margin:4px 16px 12px}
|
||||||
@@ -92,9 +82,49 @@ body{
|
|||||||
.screen{max-height:94vh}
|
.screen{max-height:94vh}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ── Back-to-hub button ── */
|
||||||
|
.nav-wrap{position:relative;width:100%;max-width:420px;display:flex;justify-content:flex-start;padding:6px 8px 0}
|
||||||
|
.back-to-hub{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;background:var(--card);border:1px solid #e6e9ef;border-radius:10px;font-size:15px;font-weight:600;color:var(--accent);text-decoration:none;box-shadow:0 2px 8px rgba(16,24,40,0.07);cursor:pointer}
|
||||||
|
.back-to-hub:hover{background:#f0f4ff}
|
||||||
|
|
||||||
|
/* ── Hub page ── */
|
||||||
|
.hub-screen{padding-bottom:20px}
|
||||||
|
.hub-logo{font-size:26px;padding:20px 0 4px}
|
||||||
|
.hub-group{padding:14px 18px}
|
||||||
|
.hub-group-title{font-size:15px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:0 0 12px}
|
||||||
|
.hub-cards{display:flex;flex-direction:column;gap:10px}
|
||||||
|
.hub-card{display:flex;align-items:center;gap:14px;padding:14px 16px;border-radius:12px;border:1px solid #e6e9ef;background:white;text-decoration:none;color:#111;font-size:17px;font-weight:500;transition:background .15s,box-shadow .15s}
|
||||||
|
.hub-card:hover{background:#f0f4ff;box-shadow:0 4px 14px rgba(43,108,176,0.12);color:var(--accent)}
|
||||||
|
.hub-card-icon{font-size:22px;width:32px;text-align:center;flex-shrink:0}
|
||||||
|
.hub-card-label{flex:1}
|
||||||
|
.hub-card-badge{font-size:11px;font-weight:600;padding:3px 8px;border-radius:20px;background:#f3f4f6;color:var(--muted)}
|
||||||
|
.hub-card--disabled{opacity:.55;cursor:default;pointer-events:none}
|
||||||
|
|
||||||
/* Mobile-specific: ensure the app fills viewport and screens scroll vertically */
|
/* Mobile-specific: ensure the app fills viewport and screens scroll vertically */
|
||||||
@media (max-width:480px){
|
@media (max-width:480px){
|
||||||
body{padding:0}
|
body{padding:0}
|
||||||
.app-wrap{max-width:100%;height:100vh}
|
.app-wrap{max-width:100%;height:100vh}
|
||||||
.screen{height:100vh;max-height:none;border-radius:0;overflow:auto;-webkit-overflow-scrolling:touch}
|
.screen{height:100vh;max-height:none;border-radius:0;overflow:auto;-webkit-overflow-scrolling:touch}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ── Czytanie — list screen ── */
|
||||||
|
.reading-list{display:flex;flex-direction:column;gap:8px}
|
||||||
|
.reading-item{width:100%;padding:14px 16px;border-radius:10px;border:1px solid #e6e9ef;background:white;text-align:left;font-size:16px;font-family:inherit;cursor:pointer}
|
||||||
|
.reading-item:hover,.reading-item:active{background:#f0f4ff;color:var(--accent)}
|
||||||
|
.custom-input{width:100%;min-height:100px;padding:10px 12px;border-radius:10px;border:1px solid #e6e9ef;font-size:15px;font-family:inherit;resize:vertical;margin-bottom:10px;display:block}
|
||||||
|
|
||||||
|
/* ── Czytanie — reading screen ── */
|
||||||
|
.read-wrap{position:fixed;inset:0;background:white;display:flex;flex-direction:column;z-index:50}
|
||||||
|
.read-wrap.hidden{display:none}
|
||||||
|
|
||||||
|
.read-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;padding-top:max(10px,env(safe-area-inset-top));background:white;border-bottom:1px solid #e6e9ef;flex-shrink:0}
|
||||||
|
.read-nav-btn{padding:8px 14px;border-radius:10px;border:1px solid #e6e9ef;background:white;font-size:15px;font-weight:600;cursor:pointer;white-space:nowrap;flex-shrink:0}
|
||||||
|
.read-nav-btn:hover{background:#f0f4ff;color:var(--accent)}
|
||||||
|
.read-speed-btn{min-width:52px;text-align:center;letter-spacing:.05em}
|
||||||
|
.read-title-text{flex:1;text-align:center;font-size:15px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#111}
|
||||||
|
|
||||||
|
.read-viewport{flex:1;overflow:hidden;padding:20px 20px 0;position:relative}
|
||||||
|
.read-text{font-size:clamp(52px,16vw,82px);font-weight:700;line-height:1.35;word-break:break-word;overflow-wrap:break-word;hyphens:auto;color:#111;transition:transform .32s cubic-bezier(.4,0,.2,1);will-change:transform}
|
||||||
|
|
||||||
|
.next-line-btn{position:absolute;bottom:max(24px,calc(env(safe-area-inset-bottom) + 12px));right:20px;width:64px;height:64px;border-radius:50%;background:var(--accent);color:white;font-size:26px;border:none;box-shadow:0 4px 20px rgba(43,108,176,.38);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:opacity .2s}
|
||||||
|
.next-line-btn:disabled{opacity:.3;cursor:default}
|
||||||
|
|||||||
+154
@@ -0,0 +1,154 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="pl">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover" />
|
||||||
|
<title>Testy Matematyczne</title>
|
||||||
|
<link rel="stylesheet" href="styles.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<nav class="nav-wrap">
|
||||||
|
<a href="index.html" class="back-to-hub" id="back-to-hub">← Menu</a>
|
||||||
|
</nav>
|
||||||
|
<div class="app-wrap">
|
||||||
|
<main class="screen" id="menu-screen">
|
||||||
|
<h1 class="app-title">Matma Trening</h1>
|
||||||
|
|
||||||
|
<section class="panel">
|
||||||
|
<h2>Wybierz działania</h2>
|
||||||
|
<div class="ops" id="ops">
|
||||||
|
<button class="op-btn" data-op="add">+ Dodawanie</button>
|
||||||
|
<button class="op-btn" data-op="sub">− Odejmowanie</button>
|
||||||
|
<button class="op-btn" data-op="mul">× Mnożenie</button>
|
||||||
|
<button class="op-btn" data-op="div">÷ Dzielenie</button>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="panel">
|
||||||
|
<h2>Tryb gry</h2>
|
||||||
|
<div class="modes">
|
||||||
|
<button class="mode-btn" data-mode="timed" id="mode-timed">
|
||||||
|
<span class="icon">⧗</span>
|
||||||
|
Na czas
|
||||||
|
</button>
|
||||||
|
<button class="mode-btn" data-mode="training" id="mode-training">
|
||||||
|
<span class="icon">∞</span>
|
||||||
|
Trening
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<p class="hint">Wybierz co najmniej jedno działanie, a następnie tryb, aby rozpocząć.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="panel">
|
||||||
|
<h2>Historia
|
||||||
|
<button id="history-toggle" class="small" style="float:right">Pokaż</button>
|
||||||
|
</h2>
|
||||||
|
<div class="history-list collapsed" id="history-panel">
|
||||||
|
<div id="history-list">
|
||||||
|
<!-- wpisy historii w menu -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="panel">
|
||||||
|
<h2>
|
||||||
|
Ustawienia
|
||||||
|
<button id="settings-toggle" class="small" style="float:right">Pokaż</button>
|
||||||
|
</h2>
|
||||||
|
<div class="settings collapsed" id="settings-panel">
|
||||||
|
<label> Czas (sek) — tryb na czas
|
||||||
|
<input id="setting-timed" type="number" min="5" max="600" />
|
||||||
|
</label>
|
||||||
|
<label> Maksymalny wynik
|
||||||
|
<input id="setting-max-result" type="number" min="1" max="999" />
|
||||||
|
</label>
|
||||||
|
<label> Maksymalna składowa (operand)
|
||||||
|
<input id="setting-max-operand" type="number" min="1" max="999" />
|
||||||
|
</label>
|
||||||
|
<label> Liczba zadań (tryb Trening)
|
||||||
|
<input id="setting-session-problems" type="number" min="1" max="500" />
|
||||||
|
</label>
|
||||||
|
<label> Wynik może być ujemny
|
||||||
|
<input id="setting-allow-negative" type="checkbox" />
|
||||||
|
</label>
|
||||||
|
<label> Wynik może być ułamkiem
|
||||||
|
<input id="setting-allow-fraction" type="checkbox" />
|
||||||
|
</label>
|
||||||
|
<div class="settings-actions">
|
||||||
|
<button id="save-settings" class="mode-btn">Zapisz</button>
|
||||||
|
<button id="reset-settings" class="mode-btn">Reset</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<main class="screen hidden" id="play-screen">
|
||||||
|
<header class="play-header">
|
||||||
|
<div class="left">
|
||||||
|
<button id="back-btn" class="small">← Menu</button>
|
||||||
|
</div>
|
||||||
|
<div class="center">
|
||||||
|
<div id="status">Trening</div>
|
||||||
|
</div>
|
||||||
|
<div class="right">
|
||||||
|
<div id="score">0</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<div class="progress-outer"><div id="progress-inner" class="progress-inner"></div></div>
|
||||||
|
|
||||||
|
<section class="problem-area">
|
||||||
|
<div id="timer" class="timer hidden">60</div>
|
||||||
|
<div id="problem" class="problem">—</div>
|
||||||
|
<div id="feedback" class="feedback"></div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="answer-area">
|
||||||
|
<div id="answer" class="answer"> </div>
|
||||||
|
<div class="keypad">
|
||||||
|
<div class="row">
|
||||||
|
<button class="key">1</button>
|
||||||
|
<button class="key">2</button>
|
||||||
|
<button class="key">3</button>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<button class="key">4</button>
|
||||||
|
<button class="key">5</button>
|
||||||
|
<button class="key">6</button>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<button class="key">7</button>
|
||||||
|
<button class="key">8</button>
|
||||||
|
<button class="key">9</button>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<button class="key special" id="negate">+/-</button>
|
||||||
|
<button class="key">0</button>
|
||||||
|
<button class="key" id="dot">.</button>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<button class="key special" id="clear">C</button>
|
||||||
|
<button class="key special" id="backspace">←</button>
|
||||||
|
<button class="submit-btn" id="submit">Sprawdź</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="panel hidden" id="summary-panel">
|
||||||
|
<div class="summary">
|
||||||
|
<h2>Podsumowanie</h2>
|
||||||
|
<p id="summary-text">Poprawne odpowiedzi: 0</p>
|
||||||
|
<div style="display:flex;gap:8px;justify-content:center;margin-top:12px">
|
||||||
|
<button id="summary-back" class="mode-btn">Powrót</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<footer class="app-footer">Version: <span id="commit-sha">(loading)</span></footer>
|
||||||
|
|
||||||
|
<script src="version.js" defer></script>
|
||||||
|
<script src="nav.js"></script>
|
||||||
|
<script src="app.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user