From ca658f6369536da8ec06f7160752bcc961a9b120 Mon Sep 17 00:00:00 2001 From: posimai Date: Sun, 19 Apr 2026 16:40:41 +0900 Subject: [PATCH] feat: finish step flow without losing quiz, clear-and-start option, scroll to comprehension Made-with: Cursor --- index.html | 41 ++++++++++++++++++++++++++++++----------- js/app.js | 22 +++++++++++++++++++++- sw.js | 2 +- 3 files changed, 52 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index f62f676..f684e91 100644 --- a/index.html +++ b/index.html @@ -645,25 +645,36 @@ header{display:flex;align-items:center;justify-content:space-between;padding:0 1 -
- +
-
-
+
+
3ステップで学ぶ
- +
+ + +
@@ -732,14 +743,22 @@ header{display:flex;align-items:center;justify-content:space-between;padding:0 1 Step 3 — 本番問題
-

- 下の理解度チェックを解いて完了です。全問正解でこの単元をマスターしましょう。 +

+ 下の理解度チェックで確認します。途中まで答えた内容はそのまま続きからできます。最初から出し直すときは、全問に一度答えたあとに表示される「やり直し」か、フロー外の「理解度をクリアして学ぶ」を使ってください。

+

+ 現在の解答は保持されています。 +

+
-
+
diff --git a/js/app.js b/js/app.js index 4aacfba..8a374ee 100644 --- a/js/app.js +++ b/js/app.js @@ -418,17 +418,37 @@ document.addEventListener('alpine:init', () => { this.stepDrillIdx=0; this.stepDrillAnswered=false; this.stepDrillSelected=-1; - this.quizState={}; this.$nextTick(()=>{ if(window.lucide) lucide.createIcons(); const m=document.getElementById('main'); if(m) m.scrollTo({top:0,behavior:'smooth'}); }); }, + /** 理解度を空にしてから 3 ステップ(Step3 で一貫した初回解答) */ + startStepModeClearQuiz(){ + this.quizState={}; + this.startStepMode(); + }, exitStepMode(){ this.stepMode=false; this.$nextTick(()=>{ if(window.lucide) lucide.createIcons(); }); }, + /** ガイド付き学習をやめ、単元画面に戻す(理解度の回答は保持) */ + finishStepMode(){ + this.stepMode=false; + this.$nextTick(()=>{ + if(window.lucide) lucide.createIcons(); + const el=document.getElementById('comprehension-quiz'); + if(el) el.scrollIntoView({behavior:'smooth',block:'start'}); + }); + }, + scrollToComprehension(){ + this.$nextTick(()=>{ + const el=document.getElementById('comprehension-quiz'); + if(el) el.scrollIntoView({behavior:'smooth',block:'start'}); + if(window.lucide) lucide.createIcons(); + }); + }, /** ヘッダ「戻る」: 同一ステップ内なら1枚前、先頭なら3ステップを終了 */ stepGoBack(){ if(!this.stepMode) return; diff --git a/sw.js b/sw.js index aa7c8db..e3bca0b 100644 --- a/sw.js +++ b/sw.js @@ -1,5 +1,5 @@ // posimai-boki SW — stale-while-revalidate + skipWaiting -const CACHE = 'posimai-boki-v16'; +const CACHE = 'posimai-boki-v17'; const STATIC = ['/', '/index.html', '/manifest.json', '/logo.png', '/js/app.js', '/js/data/drills.js', '/js/data/categories.js']; self.addEventListener('install', e => {