A high-performance, browser-based operating system simulation built entirely from scratch without relying on any front-end frameworks. It faithfully replicates the macOS desktop environment, complete with an in-memory Virtual File System, hardware-accelerated window management, and a suite of fully functional integrated applications. Designed as a comprehensive technical showcase, it pushes the limits of Vanilla JavaScript and DOM manipulation to deliver a fluid, 60fps native-like experience.
|
|
The interface is designed as a Pixel-Perfect Glassmorphism Dashboard, providing real-time feedback on algorithmic DOM manipulation and CSS3 hardware acceleration.
Simple MacOS Web is built with a strict separation of concerns, relying entirely on native browser APIs to achieve 60fps performance without the overhead of heavy frameworks like React or Vue.
-
State Management & VFS: A JSON-based Virtual File System tracks spatial coordinates, z-index layering, and app lifecycles. It drives the cross-environment drag-and-drop engine, enabling seamless file transfers between the Desktop, Finder, and Trash with dynamically generated 3D holograms.
-
Rendering Pipeline & GPU Acceleration: UI updates bypass CPU layout thrashing. Window dragging, dock magnification, and FLIP-driven animations (Music App) leverage
transformandwill-changefor pure GPU rasterization. The Zero-Lag Theme Engine uses a DoublerequestAnimationFramelock, synchronizing CSS variable swaps with the monitor's V-Sync to eliminate flicker. -
Spatial Collision & Trigonometric UI: Multi-file selection is powered by a custom AABB (Axis-Aligned Bounding Box) collision engine with spatial DOM caching. Complex UI elements, like context menus and folder color selectors, are generated on the fly using radial math and trigonometry.
-
Hardened Security Sandbox: Enforces a strict Content Security Policy (CSP). Includes an
eval()-free custom mathematical lexer for the Calculator, and an XSS-proof Bash Terminal emulator that rigidly sanitizes all VFS inputs.
The engine continuously monitors and optimizes browser rendering pipelines to guarantee an uncompromising 60fps experience:
-
Layout Thrashing Prevention: Mathematical state operations are completely decoupled from DOM repaints. Window resizing and the Marquee Tool utilize independent
requestAnimationFramebatches, ensuring layout calculations never block the main thread. -
JIT Memory Management: Passive CPU drain is eliminated. Heavy spatial event listeners (e.g.,
mousemovefor window dragging) are Just-In-Time attached onmousedownand surgically destroyed onmouseup, preventing garbage collection spikes. -
V-Sync Theme Engine: Zero-flicker Dark/Light mode transitions. A Double
requestAnimationFramelock pauses UI threads, forces global CSS variable recalculation, and executes the repaint exactly when the GPU confirms the next frame buffer.
|
|
The operating system enforces strict inter-app communication protocols to prevent state mutation leaks and ensure DOM predictability:
-
Single Source of Truth: The Virtual File System acts as the core state manager. File operations (CRUD) broadcast state changes globally, triggering targeted UI repaints only for active subscribers (e.g., open Finder windows, Desktop grid).
-
Z-Index Routing: A centralized interceptor captures
mousedownevents across the viewport. It dynamically recalculates layer stacking, pushes the active instance to the topz-index, and manages focus states across the ecosystem. -
Native IPC Delegation: Zero-dependency inter-process communication. Cross-environment events (e.g., dragging a file from the Desktop into the Trash) leverage native JS bubbling and capturing phases, bypassing the memory overhead of external state managers.
The application requires absolutely no build tools, Node.js, or npm packages. It runs natively in any modern browser.
-
Clone the infrastructure:
git clone [https://github.com/Vor7reX/Web_MacOS.git](https://github.com/Vor7reX/Web_MacOS.git) cd WebOS -
Launch the OS:
Simply double-click the `index.html` file.Note: For the best experience and to bypass local CORS restrictions (required for HTML5 Audio and fetching Map APIs), it is highly recommended to open the project using a local web server, such as the Live Server extension in VS Code.
WebOS/
├── index.html # Main OS interface & Application DOM templates
├── assets/
│ ├── css/
│ │ └── style.css # CSS Tokens, Glassmorphism, UI Layouts
│ ├── js/
│ │ └── script.js # Core Engine, VFS, Window Manager & Apps Logic
│ ├── audio/ # MP3 tracks for the Music App database
│ ├── icon/ # App icons, weather symbols, and UI vectors
│ ├── img/ # Default wallpapers and album covers
│ └── cursors/ # Custom macOS style SVG cursors
└── README.md # System documentation
- Non-Volatile VFS Storage: Migrating the current RAM-based state tree to the browser's
IndexedDB, enabling persistent file system structures, application states, and UI coordinates across sessions. - Touch Event Abstraction: Upgrading the pointer collision engine to seamlessly bridge native
MouseEventandTouchEventAPIs, guaranteeing fluid, 60fps drag-and-drop on mobile devices and iPads. - Socket-Driven Multiplayer: Implementing a bi-directional WebSocket layer to support real-time cursor telemetry and remote cross-instance file dropping between users over the internet.
This OS relies on pure Vanilla JS for its core architecture, but gratefully acknowledges the following APIs and libraries for extending its ecosystem:
- Leaflet.js - Vector GIS rendering and map interactions.
- html2canvas - Visual buffer capturing for DOM rasterization.
- Open-Meteo API - Live WMO weather telemetry.
- Nominatim (OSM) - Asynchronous global geocoding.
Assets & Media: All audio tracks are original compositions generated via AI to ensure a 100% royalty-free multimedia experience. All album cover artworks are original designs created by me :)
This project is open-source and released under the MIT License.
You are free to use, modify, and distribute this software, provided that you include the original copyright notice and give proper credit to the author.
Engineered to push the limits of Vanilla Web Development. Zero frameworks, pure DOM.




