Skip to content

🎧 A responsive Spotify-inspired web music player built using HTML, CSS, and Vanilla JavaScript β€” featuring dynamic playlists, volume control, and smooth playback controls.

Notifications You must be signed in to change notification settings

mscoder-py/spotify-music-player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎡 Spotify Clone – Web Music Player

A responsive Spotify-style web music player built using HTML, CSS, and JavaScript.
This project dynamically loads albums and songs either from a local server or a Cloudflare Worker API, allowing users to play, pause, seek, and adjust volume β€” all in a sleek, modern interface inspired by Spotify.


πŸš€ Features

βœ… Dynamic Music Loading
Fetches songs and album info directly from local directories or via a worker endpoint.

βœ… Play / Pause / Next / Previous Controls
Full playback control with smooth transitions and time tracking.

βœ… Seekbar & Progress Tracking
Users can click the seekbar to jump to any part of the song.

βœ… Volume Control & Mute Toggle
Integrated volume slider and mute/unmute button.

βœ… Responsive UI
Works seamlessly on desktop, tablet, and mobile devices.

βœ… Dynamic Albums Display
Each album is generated from a folder containing songs, a cover image, and an info.json file (with title & description).

βœ… Cloudflare Worker Support (Optional)
Play songs hosted remotely by connecting your Worker endpoint via the WORKER_URL variable.


🧩 Folder Structure

🎡 Project Structure

πŸ“ project-root
┣ πŸ“‚ css
┃ ┣ πŸ“„ style.css          # Main styles
┃ β”— πŸ“„ utility.css        # Utility classes and helper styles
┣ πŸ“‚ js
┃ ┣ πŸ“„ script1.js         # Uses Cloudflare Worker endpoint (WORKER_URL)
┃ β”— πŸ“„ script2.js         # Uses local server (http://localhost:5500)
┣ πŸ“‚ img                  # All icons and image assets
┣ πŸ“‚ songs                # Albums directory
┃ ┣ πŸ“‚ <album-name>       # Each album folder
┃ ┃ ┣ 🎡 <song-files>     # Individual song files
┃ ┃ ┣ πŸ–ΌοΈ cover.jpeg       # Album cover
┃ ┃ β”— πŸ“„ info.json        # Album metadata
┣ πŸ“„ index.html           # Main entry point
β”— πŸ“„ README.md            # Project documentation

βš™οΈ How It Works

  • script1.js β€” Connects to a Cloudflare Worker API
    β†’ Fetches album & song data from the worker link you provide in WORKER_URL.

  • script2.js β€” Works with a Local Server
    β†’ Scans directories like /songs/album-name to list and play songs.

  • Each album folder should contain:

    • cover.jpeg β†’ Album cover
    • info.json β†’ Album info
    • .mp3 files β†’ Songs

Example info.json:

{
  "title": "Chill Vibes",
  "discription": "Relax and enjoy smooth chill beats."
}

πŸ’» Setup & Usage

▢️ Run Locally

  1. Clone this repository:
git clone https://github.com/yourusername/spotify-music-player.git
  1. Start a local server (e.g., with VSCode’s Live Server or Python):
npx serve

or

python -m http.server 5500
  1. Open your browser and go to: http://localhost:5500/

  2. Add your songs and albums inside the /songs folder.

☁️ Connect to Cloudflare Worker (Optional)

If you want to stream songs from a remote server:

  1. Deploy a Worker API that returns:
  • /api/albums

  • /api/songs/{album} and serves song files from /songs/{album}/.

  1. In script1.js, set:
const WORKER_URL = "https://your-worker-link.workers.dev";
  1. Run the web app normally β€” your music will load remotely.

πŸ›  Technologies Used

  • HTML5

  • CSS3 (Responsive Design)

  • JavaScript (ES6)

  • Cloudflare Workers (optional for remote hosting)

πŸ“œ License

  • This project is open-source under the MIT License.
  • You are free to use, modify, and distribute it.

πŸ‘¨β€πŸ’» Author

⭐ If you like this project, don’t forget to star the repository!

About

🎧 A responsive Spotify-inspired web music player built using HTML, CSS, and Vanilla JavaScript β€” featuring dynamic playlists, volume control, and smooth playback controls.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published