How huihuilikaile/ctf-btfly-hmtl works
This is a small browser-based site with a light/dark theme toggle. On startup, its script reads a saved theme and checks the system color preference; when the user clicks the toggle, it changes the document root’s theme class and saves the selection. The source excerpt does not establish how the HTML loads the script or stylesheet, so those connections are omitted.
Main entry points: app.js Theme script
Components 6
Other components
- Visitor
- Site page
index.html - Theme script
app.js - Document root
- System preference
- Saved theme
Connections 5
- Visitor → Theme script: clicks toggle
- Theme script → Saved theme: reads theme
- Theme script → System preference: checks preference
- Theme script → Document root: toggles class
- Theme script → Saved theme: saves theme