# daily-song **Repository Path**: LPK-Gitee/daily-song ## Basic Information - **Project Name**: daily-song - **Description**: ๐ŸŽต Daily Song - One song a day, immersive music player - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-10-09 - **Last Updated**: 2026-10-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
![Daily Song Banner](./docs/images/banner.svg) # Daily Song ๐ŸŽต [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![GitHub Pages](https://img.shields.io/badge/demo-live-success)](https://lpk3215.github.io/daily-song/) [![Pure Static](https://img.shields.io/badge/build-none-blue)](https://github.com/LPK3215/daily-song) [![PWA Ready](https://img.shields.io/badge/PWA-ready-purple)](https://github.com/LPK3215/daily-song) [![Code Size](https://img.shields.io/badge/code-~2.1k%20lines-informational)](https://github.com/LPK3215/daily-song) **A minimalist "daily song" web player that automatically switches songs every day.** Pure static frontend โ€ข Zero build tools โ€ข Zero backend โ€ข GitHub Pages ready [๐Ÿ“– Documentation](#documentation) โ€ข [๐Ÿš€ Quick Start](#quick-start) โ€ข [๐Ÿค Contributing](./CONTRIBUTING.md) > ๐Ÿš€ **[Live Demo](https://lpk3215.github.io/daily-song/)** โ€” Try it now on GitHub Pages
--- ## โœจ Features - **๐Ÿ“… Date-based Scheduling**: Arrange songs by date via `data/date-songs.json`, plan days or weeks ahead - **๐ŸŽต Three Audio Sources**: Local MP3 / Direct URL / Platform embed (YouTube, Bilibili, Spotify, etc.) - **๐ŸŽฎ Custom Player**: Large play button + draggable progress bar + time display + keyboard shortcuts - **๐ŸŽจ Dual Theme System**: 4 backgrounds ร— 7 accent colors = 28 theme combinations - **โšก Zero Dependencies**: Native ES Modules + vanilla JavaScript, no frameworks or bundlers - **๐Ÿ“ฑ Mobile-First**: Responsive design with frosted glass cards and smooth animations - **๐ŸŒ PWA Ready**: Installable to home screen, works offline with Service Worker - **โ™ฟ Accessible**: Full keyboard navigation, ARIA labels, semantic HTML ## ๐ŸŽน Keyboard Shortcuts | Key | Action | |-----|--------| | `Space` / `Enter` | Play / Pause | | `โ†` / `โ†’` | Seek backward / forward 5 seconds | | `T` | Switch accent color theme | | `B` | Switch background theme | | `ESC` | Exit fullscreen | --- ## ๐Ÿ—๏ธ Architecture ![Architecture Diagram](./docs/images/architecture.svg) ### Project Structure ``` daily-song/ โ”œโ”€โ”€ index.html # Entry point (GitHub Pages) โ”œโ”€โ”€ assets/ โ”‚ โ”œโ”€โ”€ css/ # Modular stylesheets (~1100 lines) โ”‚ โ”‚ โ”œโ”€โ”€ base.css # Reset + theme variables + star background โ”‚ โ”‚ โ”œโ”€โ”€ card.css # Card layout + cover + song info โ”‚ โ”‚ โ””โ”€โ”€ player.css # Player controls + progress bar โ”‚ โ”œโ”€โ”€ js/ # ES Modules (~630 lines) โ”‚ โ”‚ โ”œโ”€โ”€ main.js # Entry point, orchestrates all modules โ”‚ โ”‚ โ”œโ”€โ”€ config.js # Global constants โ”‚ โ”‚ โ”œโ”€โ”€ utils.js # Date/time formatting utilities โ”‚ โ”‚ โ”œโ”€โ”€ normalizer.js # Song entry normalization and validation โ”‚ โ”‚ โ”œโ”€โ”€ activeSongLoader.js # Load date-scheduled songs โ”‚ โ”‚ โ”œโ”€โ”€ songSelector.js # Select song from rotation list โ”‚ โ”‚ โ”œโ”€โ”€ audioPlayer.js # Custom HTML5 audio player โ”‚ โ”‚ โ”œโ”€โ”€ embedPlayer.js # Platform iframe embed player โ”‚ โ”‚ โ”œโ”€โ”€ render.js # DOM rendering and animations โ”‚ โ”‚ โ””โ”€โ”€ themeSwitch.js # Theme switching + keyboard shortcuts โ”‚ โ””โ”€โ”€ pwa/ # Progressive Web App files โ”‚ โ”œโ”€โ”€ manifest.json # App manifest for installation โ”‚ โ””โ”€โ”€ sw.js # Service Worker for offline mode โ”œโ”€โ”€ data/ # Configuration (JSON) โ”‚ โ”œโ”€โ”€ date-songs.json # [Priority] Date-to-song mapping โ”‚ โ””โ”€โ”€ default-songs.json # [Fallback] Rotation song list โ”œโ”€โ”€ media/ # Media assets โ”‚ โ”œโ”€โ”€ audio/ # Self-hosted MP3 files โ”‚ โ””โ”€โ”€ covers/ # Album cover images โ”œโ”€โ”€ docs/ # Documentation assets โ”‚ โ”œโ”€โ”€ images/ # SVG diagrams and banners โ”‚ โ””โ”€โ”€ scripts/ # SVG generation scripts โ”œโ”€โ”€ README.md # This file โ”œโ”€โ”€ LICENSE # MIT License โ”œโ”€โ”€ CONTRIBUTING.md # Contribution guidelines โ”œโ”€โ”€ CHANGELOG.md # Version history โ”œโ”€โ”€ CODE_OF_CONDUCT.md # Community guidelines โ”œโ”€โ”€ .gitignore # Git ignore rules โ””โ”€โ”€ .gitattributes # Line ending rules ``` --- ## ๐Ÿš€ Quick Start ### Prerequisites A static file server (any one): - Python 3: `python -m http.server 8080` - Node.js: `npx serve .` - PHP: `php -S localhost:8080` > โš ๏ธ Double-clicking `index.html` won't work due to ES Modules requiring HTTP protocol. ### Local Preview ```bash # Clone the repository git clone https://github.com/LPK3215/daily-song.git cd daily-song # Start local server (choose one) python -m http.server 8080 # Python npx serve . # Node.js # Open browser open http://localhost:8080 ``` ### Deploy to GitHub Pages 1. Fork or clone this repository 2. Push to your GitHub account 3. Go to **Settings** โ†’ **Pages** 4. Select **Source**: `main` branch, `/` (root) 5. Wait for deployment (~1-2 minutes) 6. Visit `https://.github.io/daily-song/` --- ## ๐Ÿ“ Configuration ### Song Scheduling Edit `data/date-songs.json` to schedule specific songs for specific dates: ```json { "2026-06-13": ["Song Title", "Artist Name", "song.mp3"], "2026-06-14": ["Another Song", "Artist", "https://cdn.com/song.mp3", "cover.jpg"], "2026-12-25": ["Christmas Song", "Artist", "xmas.mp3", "xmas.jpg", "Merry Christmas!"] } ``` **Array Format**: - `[0]` Song title (required) - `[1]` Artist name (required) - `[2]` Audio source (required) - local filename or full URL - `[3]` Cover image (optional) - local filename or full URL - `[4]` Daily note (optional) - displayed below song info ### Rotation List Edit `data/default-songs.json` for daily rotation (used when date not in schedule): ```json { "anchor": "2026-06-13", "songs": [ ["Song 1", "Artist 1", "song1.mp3"], ["Song 2", "Artist 2", "song2.mp3", "cover2.jpg"], ["Song 3", "Artist 3", "song3.mp3", "cover3.jpg", "Daily inspiration"] ] } ``` **Loading Priority**: `date-songs.json` โ†’ `default-songs.json` ### Audio Sources | Type | Example | Notes | |------|---------|-------| | **Local** | `song.mp3` | Place in `media/audio/`, auto-prefixed | | **Direct URL** | `https://cdn.com/song.mp3` | Must support CORS and hotlinking | | **Embed** | `https://music.163.com/outchain/...` | Platform iframe player | --- ## ๐ŸŽจ Theme Customization The dual theme system provides 28 combinations: **Backgrounds** (Press `B`): - ๐ŸŒ‘ Dark (default) - โ˜€๏ธ Light - ๐Ÿ”ฅ Warm - ๐Ÿ’œ Purple Night **Accent Colors** (Press `T`): - ๐Ÿ’™ Neon Blue (default) - ๐Ÿ’— Cyber Pink - ๐Ÿ’š Electric Green - ๐Ÿงก Sunset Orange - ๐Ÿฉต Neon Cyan - ๐Ÿ’œ Violet - โค๏ธ Rose Red Themes persist in `localStorage` and sync across page reloads. --- ## ๐Ÿ› ๏ธ Technology Stack | Layer | Technology | |-------|-----------| | **Frontend** | Vanilla JavaScript (ES Modules) | | **Styles** | Pure CSS3 (Custom Properties) | | **Audio** | Native HTML5 `