Tag: reading routine

  • A Distraction-Free Reading Timer That Helps Kids Stay Focused

    A smartphone already has a timer, but opening the phone can create a new problem. A child may notice a notification, open YouTube, or move to another app before the reading session even begins. What was supposed to be a 20-minute reading period can easily turn into screen time.

    I wanted a timer with only one purpose: display the remaining reading time in large numbers and make it obvious when the session is complete. The web timer below can run from one HTML file on a computer. It does not show videos, recommendations, messages, or advertisements.

    The timer includes 10-, 15-, 20-, and 30-minute choices, as well as a custom setting. It can be paused or reset, plays a gentle sound at the end, and remembers how many sessions were completed today.

    Reading Timer example

    1. Copy the Reading Timer Code

    Open Notepad and copy all of the following code:

    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Reading Focus Timer</title>
      <style>
        * { box-sizing: border-box; }
        body { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 22px; font-family: Arial, sans-serif; color: #f8fafc; background: linear-gradient(145deg,#0f172a,#1e293b); }
        .app { width: min(680px,100%); text-align: center; }
        h1 { margin: 0 0 8px; font-size: clamp(2rem,5vw,3rem); }
        .subtitle { margin: 0 0 26px; color: #cbd5e1; }
        .card { padding: 32px; border: 1px solid #475569; border-radius: 24px; background: rgba(30,41,59,.88); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
        .presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-bottom: 22px; }
        button, input { font: inherit; }
        button { padding: 11px 17px; border: 0; border-radius: 10px; font-weight: bold; cursor: pointer; color: white; background: #475569; }
        button:hover { filter: brightness(1.12); }
        .preset.active { background: #0ea5e9; }
        .timer { margin: 14px 0; font-size: clamp(5rem,20vw,9rem); line-height: 1; font-variant-numeric: tabular-nums; font-weight: bold; letter-spacing: -4px; }
        .message { min-height: 28px; color: #bae6fd; font-size: 1.12rem; }
        .controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 22px; }
        .start { background: #16a34a; min-width: 130px; }
        .pause { background: #d97706; }
        .reset { background: #64748b; }
        .custom { display: flex; justify-content: center; align-items: center; gap: 9px; margin-top: 16px; color: #cbd5e1; }
        input { width: 78px; padding: 9px; border: 1px solid #64748b; border-radius: 8px; text-align: center; }
        .stats { margin-top: 20px; padding-top: 20px; border-top: 1px solid #475569; color: #cbd5e1; }
        .stats strong { color: #7dd3fc; font-size: 1.4rem; }
        .focus-note { margin: 20px auto 0; max-width: 560px; color: #94a3b8; font-size: .95rem; }
        body.finished { background: linear-gradient(145deg,#064e3b,#065f46); }
      </style>
    </head>
    <body>
      <main class="app">
        <h1>Reading Focus Timer</h1>
        <p class="subtitle">Put distractions away, open your book, and read until the timer ends.</p>
    
        <section class="card">
          <div class="presets" id="presets">
            <button class="preset" data-minutes="10">10 min</button>
            <button class="preset" data-minutes="15">15 min</button>
            <button class="preset active" data-minutes="20">20 min</button>
            <button class="preset" data-minutes="30">30 min</button>
          </div>
    
          <div class="timer" id="timer">20:00</div>
          <div class="message" id="message">Choose a time and press Start.</div>
    
          <div class="controls">
            <button class="start" id="startButton">Start Reading</button>
            <button class="pause" id="pauseButton">Pause</button>
            <button class="reset" id="resetButton">Reset</button>
          </div>
    
          <div class="custom">
            <label for="customMinutes">Custom minutes:</label>
            <input id="customMinutes" type="number" min="1" max="180" value="20">
            <button id="setCustomButton">Set</button>
          </div>
    
          <div class="stats">Completed today: <strong id="sessionCount">0</strong></div>
        </section>
    
        <p class="focus-note">Tip: Press F11 for full-screen mode, silence notifications, and keep the phone in another room during the reading session.</p>
      </main>
    
      <script>
        let selectedSeconds = 20 * 60;
        let remainingSeconds = selectedSeconds;
        let timerId = null;
        let endTime = null;
    
        const timerDisplay = document.getElementById("timer");
        const message = document.getElementById("message");
        const startButton = document.getElementById("startButton");
        const todayKey = new Date().toISOString().split("T")[0];
        const savedStats = JSON.parse(localStorage.getItem("readingTimerStats")) || {};
        let sessionsToday = savedStats.date === todayKey ? savedStats.count : 0;
    
        document.getElementById("sessionCount").textContent = sessionsToday;
    
        function displayTime() {
          const minutes = Math.floor(remainingSeconds / 60);
          const seconds = remainingSeconds % 60;
          timerDisplay.textContent = `${String(minutes).padStart(2,"0")}:${String(seconds).padStart(2,"0")}`;
          document.title = `${timerDisplay.textContent} — Reading Timer`;
        }
    
        function chooseMinutes(minutes) {
          clearInterval(timerId);
          timerId = null;
          selectedSeconds = minutes * 60;
          remainingSeconds = selectedSeconds;
          startButton.textContent = "Start Reading";
          message.textContent = `${minutes}-minute reading session ready.`;
          document.body.classList.remove("finished");
          displayTime();
        }
    
        function startTimer() {
          if (timerId || remainingSeconds <= 0) return;
          endTime = Date.now() + remainingSeconds * 1000;
          message.textContent = "Reading time — stay with your book.";
          startButton.textContent = "Reading…";
    
          timerId = setInterval(() => {
            remainingSeconds = Math.max(0, Math.ceil((endTime - Date.now()) / 1000));
            displayTime();
            if (remainingSeconds === 0) finishSession();
          }, 250);
        }
    
        function pauseTimer() {
          if (!timerId) return;
          clearInterval(timerId);
          timerId = null;
          remainingSeconds = Math.max(0, Math.ceil((endTime - Date.now()) / 1000));
          startButton.textContent = "Continue Reading";
          message.textContent = "Paused. Continue when you are ready.";
          displayTime();
        }
    
        function resetTimer() {
          clearInterval(timerId);
          timerId = null;
          remainingSeconds = selectedSeconds;
          startButton.textContent = "Start Reading";
          message.textContent = "Timer reset. Open your book when ready.";
          document.body.classList.remove("finished");
          displayTime();
        }
    
        function playChime() {
          const audio = new (window.AudioContext || window.webkitAudioContext)();
          [523.25, 659.25, 783.99].forEach((frequency, index) => {
            const oscillator = audio.createOscillator();
            const gain = audio.createGain();
            oscillator.frequency.value = frequency;
            gain.gain.setValueAtTime(0.18, audio.currentTime + index * 0.25);
            gain.gain.exponentialRampToValueAtTime(0.001, audio.currentTime + index * 0.25 + 0.55);
            oscillator.connect(gain).connect(audio.destination);
            oscillator.start(audio.currentTime + index * 0.25);
            oscillator.stop(audio.currentTime + index * 0.25 + 0.6);
          });
        }
    
        function finishSession() {
          clearInterval(timerId);
          timerId = null;
          sessionsToday++;
          localStorage.setItem("readingTimerStats", JSON.stringify({ date: todayKey, count: sessionsToday }));
          document.getElementById("sessionCount").textContent = sessionsToday;
          document.body.classList.add("finished");
          startButton.textContent = "Completed";
          message.textContent = "Reading session complete — great work!";
          document.title = "Reading Complete!";
          playChime();
        }
    
        document.querySelectorAll(".preset").forEach(button => {
          button.addEventListener("click", () => {
            document.querySelectorAll(".preset").forEach(item => item.classList.remove("active"));
            button.classList.add("active");
            chooseMinutes(Number(button.dataset.minutes));
          });
        });
    
        document.getElementById("setCustomButton").addEventListener("click", () => {
          const minutes = Number(document.getElementById("customMinutes").value);
          if (!Number.isInteger(minutes) || minutes < 1 || minutes > 180) {
            alert("Enter a whole number from 1 to 180.");
            return;
          }
          document.querySelectorAll(".preset").forEach(item => item.classList.remove("active"));
          chooseMinutes(minutes);
        });
    
        startButton.addEventListener("click", startTimer);
        document.getElementById("pauseButton").addEventListener("click", pauseTimer);
        document.getElementById("resetButton").addEventListener("click", resetTimer);
        displayTime();
      </script>
    </body>
    </html>

    2. Save and Open the Timer

    1. In Notepad, select File → Save As.
    2. Enter reading-focus-timer.html.
    3. Choose All Files for the file type.
    4. Select UTF-8 and save the file.
    5. Double-click the file to open it in Chrome, Edge, or Firefox.

    If the browser displays code instead of the timer, make sure the file does not end in .txt.

    3. Use It for a Focused Reading Session

    Choose 10, 15, 20, or 30 minutes and select Start Reading. The remaining time appears in large numbers. The timer can be paused if the child needs a necessary break, and Reset returns it to the selected length.

    For fewer distractions:

    1. Put the phone in another room or hand it to a parent.
    2. Close unrelated browser tabs.
    3. Press F11 on Windows to display the timer full screen.
    4. Keep only the book, timer, and any required worksheet nearby.
    5. Begin with a realistic reading period rather than the longest option.

    The web timer cannot technically block YouTube or prevent another tab from being opened. Its purpose is to create a clean, single-purpose screen. Browser parental controls or a separate website blocker would be required for actual blocking.

    4. Choosing the Right Reading Time

    A longer timer is not always better. Ten or fifteen focused minutes may be more useful than thirty minutes interrupted by frustration.

    • 10 minutes: A gentle starting point or a difficult reading day
    • 15 minutes: Short homework reading
    • 20 minutes: A practical everyday reading session
    • 30 minutes: Longer independent reading when attention is steady

    We can increase the time gradually after the routine becomes comfortable. The completed-session count is meant to encourage consistency, not to grade reading speed.

    5. Why the Timer Uses the Actual End Time

    Some simple web timers subtract one second at every interval. That approach can become inaccurate when a browser slows down or a computer briefly becomes busy. This timer records the intended ending time and repeatedly calculates the difference. That helps the displayed countdown stay closer to the real elapsed time.

    6. Troubleshooting

    No sound plays at the end

    Check the computer volume and make sure the browser tab is not muted. Browsers may restrict sound until the user interacts with the page, so always press the Start button rather than expecting the timer to begin automatically.

    The timer stops when the computer sleeps

    The code can correct the displayed time after a brief browser delay, but it cannot keep a sleeping computer awake. Temporarily adjust the Windows sleep setting or interact with the computer before it goes to sleep.

    The completed count disappeared

    The count is saved in the current browser and resets for a new date. Clearing browser data, using a private window, or changing browsers may remove it.

    Final Thoughts

    The most important feature of this timer is its simplicity. It gives a child one visible task: keep reading until the countdown ends. There are no recommended videos or messages competing for attention on the page.

    Start with a manageable time, use the same reading place when possible, and end the session when the chime sounds. A repeatable 15- or 20-minute routine can be more sustainable than waiting for a large block of free time.

  • A Daily HTML Schedule for School, Reading, and Violin Practice

    A Daily HTML Schedule for School, Reading, and Violin Practice

    Daily Schedule Example

    A busy school day can pass quickly without leaving enough time for reading, homework, or music practice. In our home, the challenge is not a lack of activities. It is fitting school, reading, violin practice, meals, breaks, and free time into a routine that feels realistic.

    When the plan exists only in a parent’s memory, a child may not know what comes next. We may also lose time repeatedly deciding when to start an activity. A visible daily schedule can reduce that uncertainty without turning every minute into work.

    The program below creates a simple schedule in one HTML file. It already includes sample entries for school, reading, and violin practice. You can add new activities, mark them complete, or delete activities that are no longer needed. The schedule is saved in the browser automatically.

    1. What This Daily Schedule Can Do

    • Add an activity with a start and end time
    • Group activities as school, study, reading, music, break, or family time
    • Display activities in time order
    • Mark completed activities
    • Show how many activities are finished
    • Delete unwanted entries
    • Restore the sample schedule
    • Save changes in the browser

    2. Copy the Complete HTML Template

    Open Notepad and copy all of the code below:

    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>My Daily Schedule</title>
      <style>
        * { box-sizing: border-box; }
        body { margin: 0; padding: 24px; min-height: 100vh; font-family: Arial, sans-serif; color: #1f2937; background: linear-gradient(135deg,#eff6ff,#f5f3ff); }
        .container { width: min(900px,100%); margin: auto; }
        header { text-align: center; margin-bottom: 22px; }
        h1 { color: #3730a3; margin-bottom: 8px; }
        h2 { margin-top: 0; color: #312e81; }
        .panel { background: white; padding: 24px; margin-bottom: 20px; border-radius: 18px; box-shadow: 0 10px 28px rgba(31,41,55,.1); }
        form { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr auto; gap: 12px; align-items: end; }
        label { display: block; margin-bottom: 6px; font-weight: bold; }
        input, select { width: 100%; padding: 11px; border: 2px solid #d1d5db; border-radius: 9px; font: inherit; }
        input:focus, select:focus { outline: none; border-color: #6366f1; }
        button { border: 0; border-radius: 9px; padding: 12px 16px; color: white; background: #4f46e5; font-weight: bold; cursor: pointer; }
        button:hover { filter: brightness(.94); }
        .summary { display: flex; justify-content: space-between; gap: 15px; align-items: center; }
        .progress-track { flex: 1; height: 12px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
        .progress-bar { height: 100%; width: 0; background: #16a34a; transition: width .25s; }
        .schedule { display: grid; gap: 12px; }
        .item { display: grid; grid-template-columns: 125px 1fr auto auto; align-items: center; gap: 14px; padding: 16px; border-left: 8px solid #6366f1; border-radius: 12px; background: #f8fafc; }
        .item.completed { opacity: .62; }
        .item.completed .activity { text-decoration: line-through; }
        .time { font-weight: bold; color: #4338ca; }
        .activity { font-size: 1.08rem; font-weight: bold; }
        .category { display: inline-block; margin-top: 5px; padding: 4px 9px; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-size: .82rem; }
        .complete { background: #15803d; }
        .delete { background: #dc2626; }
        .footer-actions { display: flex; justify-content: center; margin-top: 18px; }
        .reset { background: #64748b; }
        .empty { text-align: center; color: #6b7280; padding: 24px; }
        @media(max-width:760px){ form{grid-template-columns:1fr 1fr} .wide{grid-column:1/-1} .item{grid-template-columns:1fr} .item button{width:100%} }
      </style>
    </head>
    <body>
      <main class="container">
        <header>
          <h1>My Daily Schedule</h1>
          <p>A clear plan for school, study, practice, rest, and family time.</p>
        </header>
    
        <section class="panel">
          <h2>Add an Activity</h2>
          <form id="scheduleForm">
            <div class="wide"><label for="activity">Activity</label><input id="activity" required placeholder="Example: Math homework"></div>
            <div><label for="startTime">Start</label><input id="startTime" type="time" required></div>
            <div><label for="endTime">End</label><input id="endTime" type="time" required></div>
            <div><label for="category">Category</label><select id="category"><option>School</option><option>Study</option><option>Reading</option><option>Music</option><option>Break</option><option>Family</option></select></div>
            <button type="submit">Add</button>
          </form>
        </section>
    
        <section class="panel summary">
          <strong id="progressText">0 of 0 completed</strong>
          <div class="progress-track"><div class="progress-bar" id="progressBar"></div></div>
        </section>
    
        <section class="panel">
          <h2>Today's Plan</h2>
          <div class="schedule" id="scheduleList"></div>
          <div class="footer-actions"><button class="reset" id="resetButton">Restore Sample Schedule</button></div>
        </section>
      </main>
    
      <script>
        const storageKey = "familyDailySchedule";
        const sampleSchedule = [
          { id: 1, activity: "Get ready and eat breakfast", start: "07:00", end: "07:40", category: "Family", completed: false },
          { id: 2, activity: "School", start: "08:00", end: "15:00", category: "School", completed: false },
          { id: 3, activity: "Snack and quiet break", start: "15:30", end: "16:00", category: "Break", completed: false },
          { id: 4, activity: "Homework and school review", start: "16:00", end: "17:00", category: "Study", completed: false },
          { id: 5, activity: "Violin practice", start: "17:10", end: "17:40", category: "Music", completed: false },
          { id: 6, activity: "Dinner and family time", start: "18:00", end: "19:00", category: "Family", completed: false },
          { id: 7, activity: "Reading", start: "19:15", end: "19:40", category: "Reading", completed: false },
          { id: 8, activity: "Free time and prepare for tomorrow", start: "19:40", end: "20:30", category: "Break", completed: false }
        ];
    
        let schedule = JSON.parse(localStorage.getItem(storageKey)) || structuredClone(sampleSchedule);
        const list = document.getElementById("scheduleList");
    
        function save(){ localStorage.setItem(storageKey, JSON.stringify(schedule)); }
        function displayTime(time){ const [h,m]=time.split(":"); const hour=Number(h); return `${hour%12||12}:${m} ${hour>=12?"PM":"AM"}`; }
    
        function render(){
          list.innerHTML = "";
          schedule.sort((a,b)=>a.start.localeCompare(b.start));
          if(!schedule.length){ list.innerHTML='<p class="empty">No activities have been added.</p>'; }
    
          schedule.forEach(item=>{
            const row=document.createElement("div");
            row.className=`item${item.completed?" completed":""}`;
    
            const time=document.createElement("div"); time.className="time"; time.textContent=`${displayTime(item.start)}–${displayTime(item.end)}`;
            const details=document.createElement("div");
            const name=document.createElement("div"); name.className="activity"; name.textContent=item.activity;
            const tag=document.createElement("span"); tag.className="category"; tag.textContent=item.category;
            details.append(name,tag);
    
            const done=document.createElement("button"); done.className="complete"; done.textContent=item.completed?"Undo":"Done"; done.onclick=()=>toggle(item.id);
            const remove=document.createElement("button"); remove.className="delete"; remove.textContent="Delete"; remove.onclick=()=>removeItem(item.id);
            row.append(time,details,done,remove); list.appendChild(row);
          });
    
          const completed=schedule.filter(item=>item.completed).length;
          document.getElementById("progressText").textContent=`${completed} of ${schedule.length} completed`;
          document.getElementById("progressBar").style.width=schedule.length?`${completed/schedule.length*100}%`:"0%";
        }
    
        function toggle(id){ const item=schedule.find(item=>item.id===id); item.completed=!item.completed; save(); render(); }
        function removeItem(id){ if(confirm("Delete this activity?")){ schedule=schedule.filter(item=>item.id!==id); save(); render(); } }
    
        document.getElementById("scheduleForm").addEventListener("submit",event=>{
          event.preventDefault();
          const start=document.getElementById("startTime").value;
          const end=document.getElementById("endTime").value;
          if(end<=start){ alert("The end time must be later than the start time."); return; }
          schedule.push({ id:Date.now(), activity:document.getElementById("activity").value.trim(), start, end, category:document.getElementById("category").value, completed:false });
          save(); event.target.reset(); render();
        });
    
        document.getElementById("resetButton").addEventListener("click",()=>{
          if(confirm("Replace the current schedule with the sample schedule?")){ schedule=structuredClone(sampleSchedule); save(); render(); }
        });
    
        render();
      </script>
    </body>
    </html>

    3. Save and Open the Schedule

    1. In Notepad, select File → Save As.
    2. Name the file daily-schedule.html.
    3. Change Save as type to All Files.
    4. Select UTF-8 and save it.
    5. Double-click the saved file to open it in a browser.

    If it opens as text, check that the file is not named daily-schedule.html.txt.

    4. Adjust the Sample Schedule

    The included schedule is only a starting point. School is shown from 8:00 AM to 3:00 PM, followed by a break, homework, violin practice, dinner, reading, and free time. Use the form to add your own activities and delete entries that do not fit your family.

    Avoid filling every open minute. A schedule becomes difficult to follow when it does not include transition time, meals, or rest. Leaving 10 minutes between homework and violin practice can make both activities easier to begin.

    5. Use the Schedule to Reduce Wasted Time

    The greatest benefit is reducing repeated decisions. Instead of asking, “What should we do now?” after school, the next activity is already visible.

    A practical routine is:

    1. Check the schedule after arriving home.
    2. Complete the highest-priority school task first.
    3. Keep violin practice focused and reasonably short.
    4. Use reading as a regular daily block rather than waiting for extra time.
    5. Mark each activity complete and move on.

    The goal is not to make a child busy all day. Free time belongs on the schedule too. A balanced plan helps protect rest while preventing important activities from being forgotten.

    6. How the Schedule Is Saved

    The program uses the browser’s localStorage. Changes normally remain after the page is closed. Always use the same HTML file and browser. Records may be lost if browser data is cleared, a private window is used, or the file is opened on another computer.

    7. Troubleshooting

    Activities are not in the order entered

    The program sorts activities by starting time automatically. This keeps the day in chronological order.

    An activity cannot be added

    Make sure the activity name, start time, and end time are entered. The ending time must be later than the starting time.

    The original examples disappeared

    Select Restore Sample Schedule. This replaces the current entries, so use it only when you are ready to reset the schedule.

    Final Thoughts

    A useful schedule should provide direction without making family life rigid. For us, the important pieces are school responsibilities, a realistic reading period, regular violin practice, and enough breaks to make the plan sustainable.

    Start with only the activities that matter most. After using the schedule for several days, adjust the times based on what actually works. A plan that can be followed is more valuable than a perfect-looking timetable that is too crowded.