Skip to content

About

A browser-based re-creation of the Windows 98 Disk Defragmenter, built for nostalgia. The grid of clusters consolidates as you watch: scattered light-blue blocks move to the front of the drive, clusters being read flash green, clusters being written flash red, and the percentage counts up to 100%.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Windows 98 Disk Defragmenter Simulator

Live demo Deploy to GitHub Pages License: MIT Stars No dependencies No build step Made with HTML, CSS & JS Self-test 20/20 UI test 8/8

A browser-based re-creation of the Windows 98 Disk Defragmenter, built for nostalgia. The grid of clusters consolidates as you watch: scattered light-blue blocks move to the front of the drive, clusters being read flash green, clusters being written flash red, authentic mechanical hard drive sounds crunch in real-time, and the percentage counts up to 100%. The window features period-accurate details: a draggable blue title bar, beveled chrome, full Action/View/Help menus, Windows 98 taskbar with live clock, interactive cluster inspection, and an under-construction mode.

It runs entirely in the browser. No real disk, filesystem, or system is ever touched. This is a visual and acoustic simulation only.

Try it live · Source on GitHub


Screenshots

Disk Defragmenter ready to run, showing a cluster map with a consolidated navy front and a scattered light-blue tail Mid-run, with four clusters flashing green as they are read from the drive
Ready to run Reading a run (green flash)
Mid-run, with clusters flashing red as they are written to the front of the drive Finished, showing one contiguous navy block at the front and a white free-space tail
Writing a run (red flash) Finished at 100%
The window with details hidden, showing just the segmented progress bar and buttons The Defrag Legend dialog listing the six cluster states with matching colour chips
Details hidden The Legend dialog

Site mode doubles as an under-construction page:

The simulator running under an Under Construction banner on a teal desktop, with the site name and message above the window


Quick start

The fastest route is the hosted demo: https://geeklord.github.io/Win98-Defrag-Simulator/

To run it yourself:

  1. Clone or download the repo:

    git clone https://github.com/GeekLord/Win98-Defrag-Simulator.git
    
  2. Open index.html in any modern browser (double-click it, or drag it into a browser window). No server, no install, no build step.

  3. Press Start and watch the drive defragment.

  4. Pause / Resume to freeze or continue, Stop to reset, and Hide details / Show details to collapse or expand the cluster map.

  5. Hover over any cluster block to inspect simulated cluster sectors and 90s Windows files!

You can also pass URL parameters for instant demos, e.g.:

index.html?speed=6&drive=C&sound=1

The same parameters work on the hosted demo: https://geeklord.github.io/Win98-Defrag-Simulator/?speed=6&drive=C&sound=1


Key Features

  • Procedural Hard Drive Sound Synthesis: Real-time acoustic hard drive stepper motor seeking, read clicks, and write crunches generated purely via Web Audio API (no external sound files, 100% offline & zero dependencies).
  • Draggable Window: Grab and reposition the Disk Defragmenter window across the desktop by its title bar.
  • Windows 98 Taskbar & Live Clock: Authentic bottom taskbar with Start button, active task item (minimizes and restores the window), system tray with mute icon, and a live digital clock.
  • Interactive Cluster Inspector Tooltip: Hover over any cluster block to see cluster numbers, LBA sector offsets, status, and period-accurate simulated 90s FAT32 files (KERNEL32.DLL, DOOM2.WAD, NETSCAPE.EXE, AUTOEXEC.BAT, etc.). Click any cluster to open its Properties dialog.
  • Drive Selector & Options: Defragment Drive C: (Hard Disk), Drive D: (Secondary Volume), or Drive A: (3.5" Floppy 1.44 MB FAT12 with authentic geometry). Configure defragmentation strategy in Settings.
  • Win98 Help Topics: Nostalgic tabbed Windows Help dialog with Contents, Index, and 1998 defrag trivia.
  • Retro CRT Scanline Filter: Optional vintage CRT monitor visual scanline overlay (View > CRT Scanlines).
  • Speed Presets: Choose between Slow (1x), Normal (2x), Fast (6x), and Turbo (20x) speeds in the View menu.

The window

Area What it does
Title bar Draggable title bar, icon, title (Disk Defragmenter when ready, Defragmenting Drive C while running), Minimize, Maximize, and Close buttons
Menu bar Action → Start, Pause, Stop, Select Drive, Options, Exit; View → Details, Legend, Sound FX, CRT Scanlines, Speed presets; Help → Help Topics, About
Cluster map The grid of blocks; each box is one simulated cluster. Hover to inspect files; click for Cluster Properties
Legend What each color means (labels and colors match the original utility)
Progress bar The chunky segmented bar from the original progress window
Buttons Start, Pause/Resume, Stop, Legend, Hide/Show details
Status bar Current operation on the left, live percentage on the right (0% complete → 100% complete)
Taskbar Bottom bar with Start menu, active task item, mute toggle, and live clock

Legend

Color Meaning Hex
Light blue Unoptimized data #6ae5fb
Dark navy Optimized (defragmented) data #0208aa
White Free space #ffffff
White + black outline Data that will not be moved (bad or unmovable clusters) n/a
Green Data currently being read (flashes) #64d940
Red Data currently being written (flashes) #ea3a2e

Customization

URL parameters (no code changes needed)

Parameter Default Description
cols 42 Grid columns (10 to 120)
rows 18 Grid rows (4 to 60)
used 0.72 Share of usable cells holding data (0.30 to 0.95)
preopt 0.35 Front fraction already consolidated at start (0 to 0.9)
unmovable 5 Number of unmovable clusters (0 to 40)
speed 1 Animation speed multiplier (0.25 to 1000)
seed 1998 Pattern seed; a different value gives a different fragmentation
drive C Simulated drive letter (C, D, A)
sound 1 Procedural HDD audio simulation (sound=0 mutes)
crt 0 Retro CRT monitor scanlines overlay (crt=1 enables)
site This Website Under-construction banner: site name
msg (see banner) Under-construction banner: message text
uc on uc=0 hides the under-construction banner
autostart off autostart=1 runs the simulation automatically on load
selftest off selftest=1 runs the built-in QA suite and prints a report
uitest off uitest=1 runs the click-level integration test (about 10 s)

Examples:

index.html?cols=60&rows=16&speed=3        # wider, faster drive
index.html?used=0.85&unmovable=12         # nearly full, heavily blocked drive
index.html?drive=A                        # 3.5" floppy disk defrag
index.html?sound=1&crt=1                  # full acoustic and CRT retro experience
index.html?selftest=1                     # run the QA self-test suite (20/20)

Live equivalents:


Self-test and QA hook

Open index.html?selftest=1 to run 20 automated checks: grid build, fragmentation shape, legend colors, compaction correctness, monotonic progress, start/pause/stop transitions, audio synthesis engine, cluster inspector file mapping, drive selection (C, D, A Floppy), taskbar/clock sync, details toggle, under-construction banner, completion layout, progress bar fill, Legend dialog, and runtime error counters. The tab title displays SELFTEST PASS 20/20 on success.

For a click-level integration test, open index.html?uitest=1. It drives the real buttons with real DOM click events through a full Start, Pause, freeze check, Resume, Stop, Hide/Show details, and run-to-100% cycle, reporting UITEST PASS 8/8 in the tab title.

The page also exposes window.__defrag (config, engine, audio, and helpers) for scripted QA.


Accessibility

  • All controls are real <button> elements with labels. Keyboard focus shows the classic dotted Win98 focus rectangle.
  • The status bar announces changes via aria-live, and the percentage has role="progressbar" with aria-valuenow.
  • Space toggles Pause/Resume, F1 opens Windows Help, and Esc closes menus and dialogs.
  • With prefers-reduced-motion, the read/write flashes render as static colors instead of blinking.

Author

Developed by Shobhit Kumar Prabhakar (shobhit.net).


Attribution & license

This is an educational, nostalgic homage to the Windows 98 Disk Defragmenter, re-created from public screenshots and descriptions. It is not affiliated with or endorsed by Microsoft. "Windows" is a trademark of Microsoft Corporation, and no Microsoft assets or code are included. Provided under the MIT License.

About

A browser-based re-creation of the Windows 98 Disk Defragmenter, built for nostalgia. The grid of clusters consolidates as you watch: scattered light-blue blocks move to the front of the drive, clusters being read flash green, clusters being written flash red, and the percentage counts up to 100%.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages