# 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 ๐ต
[](https://opensource.org/licenses/MIT)
[](https://lpk3215.github.io/daily-song/)
[](https://github.com/LPK3215/daily-song)
[](https://github.com/LPK3215/daily-song)
[](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

### 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 `