melodydrop / index.html
PsyEyes's picture
Давай сделаем красивый музыкальный плеер на HTMX и Tailwind визуально похожий на Spotify. Что нужно:
ac1291d verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MelodyDrop - Spotify-like Music Player</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<link rel="stylesheet" href="style.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
<script src="https://unpkg.com/htmx.org/dist/ext/sse.js"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<style>
:root {
--primary-color: #1DB954;
--secondary-color: #191414;
--background-color: #121212;
--sidebar-color: #000000;
--player-color: #181818;
}
body {
background-color: var(--background-color);
color: white;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.track-item:hover {
background-color: rgba(255, 255, 255, 0.1);
}
.track-item.dragging {
opacity: 0.5;
background-color: rgba(29, 185, 84, 0.3);
}
.progress-bar::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 12px;
height: 12px;
border-radius: 50%;
background: var(--primary-color);
cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 12px;
height: 12px;
border-radius: 50%;
background: white;
cursor: pointer;
}
.playlist-container {
max-height: calc(100vh - 300px);
overflow-y: auto;
}
</style>
</head>
<body class="bg-gray-900 text-white h-screen flex flex-col">
<!-- Header -->
<header class="p-4 bg-black bg-opacity-30 flex justify-between items-center">
<div class="flex items-center space-x-4">
<button id="back-btn" class="rounded-full p-2 hover:bg-gray-800">
<i data-feather="arrow-left"></i>
</button>
<button id="forward-btn" class="rounded-full p-2 hover:bg-gray-800">
<i data-feather="arrow-right"></i>
</button>
</div>
<div class="flex items-center space-x-4">
<button id="user-btn" class="rounded-full p-2 hover:bg-gray-800">
<i data-feather="user"></i>
</button>
</div>
</header>
<div class="flex flex-1 overflow-hidden">
<!-- Sidebar -->
<aside class="w-64 bg-black bg-opacity-20 p-4 flex flex-col">
<div class="mb-8">
<h1 class="text-2xl font-bold flex items-center">
<i data-feather="music" class="mr-2"></i>
MelodyDrop
</h1>
</div>
<nav class="space-y-2 mb-8">
<a href="#" class="flex items-center space-x-3 p-2 rounded bg-gray-800 bg-opacity-50">
<i data-feather="home"></i>
<span>Home</span>
</a>
<a href="#" class="flex items-center space-x-3 p-2 rounded hover:bg-gray-800 hover:bg-opacity-50">
<i data-feather="search"></i>
<span>Search</span>
</a>
<a href="#" class="flex items-center space-x-3 p-2 rounded hover:bg-gray-800 hover:bg-opacity-50">
<i data-feather="book-open"></i>
<span>Your Library</span>
</a>
</nav>
<div class="mt-auto">
<button id="install-btn" class="w-full flex items-center space-x-2 p-2 rounded hover:bg-gray-800 hover:bg-opacity-50">
<i data-feather="download"></i>
<span>Install App</span>
</button>
<button id="settings-btn" class="w-full flex items-center space-x-2 p-2 rounded hover:bg-gray-800 hover:bg-opacity-50">
<i data-feather="settings"></i>
<span>Settings</span>
</button>
</div>
</aside>
<!-- Main Content -->
<main class="flex-1 overflow-auto p-6">
<div class="mb-8">
<h2 class="text-3xl font-bold mb-6">Your Music</h2>
<div class="flex items-center justify-between mb-6">
<div>
<button id="select-folder-btn" class="bg-green-500 hover:bg-green-600 text-white px-6 py-2 rounded-full flex items-center">
<i data-feather="folder" class="mr-2"></i>
Select Music Folder
</button>
<input type="file" id="folder-input" webkitdirectory directory multiple class="hidden">
</div>
<div class="flex space-x-2">
<button id="grid-view-btn" class="p-2 rounded-full hover:bg-gray-800">
<i data-feather="grid"></i>
</button>
<button id="list-view-btn" class="p-2 rounded-full hover:bg-gray-800">
<i data-feather="list"></i>
</button>
</div>
</div>
<div id="playlist-container" class="playlist-container rounded-lg bg-gray-800 bg-opacity-30 p-4">
<div id="playlist-header" class="grid grid-cols-12 gap-4 p-3 text-gray-400 border-b border-gray-700">
<div class="col-span-1">#</div>
<div class="col-span-5">Title</div>
<div class="col-span-3">Album</div>
<div class="col-span-2">Duration</div>
<div class="col-span-1"></div>
</div>
<div id="tracks-list" class="divide-y divide-gray-700">
<!-- Tracks will be populated here -->
</div>
</div>
</div>
</main>
</div>
<!-- Player -->
<div id="player" class="bg-gray-800 bg-opacity-90 border-t border-gray-700 p-4">
<div class="max-w-7xl mx-auto grid grid-cols-3 gap-4 items-center">
<!-- Current Track Info -->
<div class="flex items-center space-x-4">
<div id="current-track-cover" class="bg-gray-600 w-16 h-16 rounded shadow-lg"></div>
<div>
<div id="current-track-title" class="font-semibold">No track selected</div>
<div id="current-track-artist" class="text-sm text-gray-400">Unknown artist</div>
</div>
<button id="favorite-btn" class="text-gray-400 hover:text-white">
<i data-feather="heart"></i>
</button>
</div>
<!-- Player Controls -->
<div class="flex flex-col items-center">
<div class="flex items-center space-x-6 mb-2">
<button id="shuffle-btn" class="text-gray-400 hover:text-white">
<i data-feather="shuffle"></i>
</button>
<button id="prev-btn" class="text-white hover:text-green-400">
<i data-feather="skip-back"></i>
</button>
<button id="play-pause-btn" class="bg-white text-black rounded-full p-2 hover:bg-green-400 hover:text-white">
<i data-feather="play"></i>
</button>
<button id="next-btn" class="text-white hover:text-green-400">
<i data-feather="skip-forward"></i>
</button>
<button id="repeat-btn" class="text-gray-400 hover:text-white">
<i data-feather="repeat"></i>
</button>
</div>
<div class="w-full flex items-center space-x-3">
<span id="current-time" class="text-xs text-gray-400">0:00</span>
<input type="range" id="progress-bar" class="progress-bar flex-1 h-1 bg-gray-600 rounded-lg appearance-none cursor-pointer" value="0" min="0" max="100">
<span id="total-time" class="text-xs text-gray-400">0:00</span>
</div>
</div>
<!-- Volume Control -->
<div class="flex items-center justify-end space-x-3">
<button id="lyrics-btn" class="text-gray-400 hover:text-white">
<i data-feather="align-left"></i>
</button>
<button id="queue-btn" class="text-gray-400 hover:text-white">
<i data-feather="list"></i>
</button>
<div class="flex items-center space-x-2">
<button id="volume-btn" class="text-gray-400 hover:text-white">
<i data-feather="volume-2"></i>
</button>
<input type="range" id="volume-slider" class="volume-slider w-24 h-1 bg-gray-600 rounded-lg appearance-none cursor-pointer" value="80" min="0" max="100">
</div>
</div>
</div>
</div>
<script src="script.js"></script>
<script>feather.replace();</script>
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
</body>
</html>