lecteur sons

This commit is contained in:
El-yazide MOHAMED 2025-04-13 17:23:03 +02:00
parent 838201bb58
commit 897b244d16
8 changed files with 368 additions and 173 deletions

View File

@ -12,12 +12,12 @@
<body> <body>
<header> <header>
<a href="file:///home/devel/Desktop/loop-code/assets/main.html"><img src="logo.png" class="logo"></a> <a href="main.html"><img src="logo.png" class="logo"></a>
</header> </header>
<div class="music-list"> <div class="music-list">
<a href="file:///home/devel/Desktop/loop-code/assets/muddy_files.html" class="music-card"> <a href="muddy_files.html" class="music-card">
<img src="muddyfiles.jpg" alt="muddyfiles"> <img src="muddyfiles.jpg" alt="muddyfiles">
<div class="music-info"> <div class="music-info">
<h3>Muddy Files</h3> <h3>Muddy Files</h3>
@ -25,7 +25,7 @@
</div> </div>
</a> </a>
<a href="file:///home/devel/Desktop/loop-code/assets/hell_even.html" class="music-card"> <a href="hell_even.html" class="music-card">
<img src="helleven.jpg" alt="helleven"> <img src="helleven.jpg" alt="helleven">
<div class="music-info"> <div class="music-info">
<h3>Hell Even</h3> <h3>Hell Even</h3>
@ -33,7 +33,7 @@
</div> </div>
</a> </a>
<a href="file:///home/devel/Desktop/loop-code/assets/hell_even.html" class="music-card"> <a href="hell_even.html" class="music-card">
<img src="stamina.jpg" alt="stamina"> <img src="stamina.jpg" alt="stamina">
<div class="music-info"> <div class="music-info">
<h3>Stamina</h3> <h3>Stamina</h3>

View File

@ -1,31 +1,30 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Hell Even</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="styleshe.css">
<title>LOOP</title> </head>
<base href="./"> <body>
<script src="https://kit.fontawesome.com/96dcb489df.js" crossorigin="anonymous"></script> <header>
<link rel="stylesheet" href="styleshe.css"> <a href="main.html"><img src="logo.png" alt="Logo" class="logo"></a>
</head> </header>
<body>
<header> <div class="container">
<a href="file:///home/devel/Desktop/loop-code/assets/main.html"><img src="logo.png" class="logo"></a> <div class="vinyl-wrapper">
</header> <div class="vinyl">
<img src="pochette.jpg" alt="Pochette de l'album">
<h1>Let your favorite songs play on LOOP.</h1>
<div class="login-container">
</div> </div>
</div>
<h2>Don't have an account ?<a href="" class="orange"> Sign up now.</a> </span></h2>
<script src="script.js"></script> <div class="audio-player">
<audio id="audio" src="paradisev2.mp3"></audio>
<button id="play-pause">▶️</button>
<input type="range" id="progress" value="0" step="1">
<div id="time">0:00 / 0:00</div>
</div>
</div>
</body> <script src="muddy_files.js"></script>
</body>
</html> </html>

47
assets/hell_even.js Normal file
View File

@ -0,0 +1,47 @@
const audio = document.getElementById('audio');
const playPauseBtn = document.getElementById('play-pause');
const progress = document.getElementById('progress');
const time = document.getElementById('time');
const vinyl = document.querySelector('.vinyl');
let isPlaying = false;
// Play / Pause button
playPauseBtn.addEventListener('click', () => {
if (isPlaying) {
audio.pause();
vinyl.style.animationPlayState = 'paused';
playPauseBtn.textContent = '▶️';
} else {
audio.play();
vinyl.style.animationPlayState = 'running';
playPauseBtn.textContent = '⏸️';
}
isPlaying = !isPlaying;
});
// Update progress and time
audio.addEventListener('timeupdate', () => {
progress.value = audio.currentTime;
updateTimeDisplay();
});
// Set duration when audio loads
audio.addEventListener('loadedmetadata', () => {
progress.max = audio.duration;
updateTimeDisplay();
});
// Seek audio
progress.addEventListener('input', () => {
audio.currentTime = progress.value;
});
function updateTimeDisplay() {
const format = (s) => {
const m = Math.floor(s / 60);
const ss = Math.floor(s % 60);
return `${m}:${ss < 10 ? '0' + ss : ss}`;
};
time.textContent = `${format(audio.currentTime)} / ${format(audio.duration)}`;
}

View File

@ -12,7 +12,7 @@
<body> <body>
<header> <header>
<a href="file:///home/devel/Desktop/loop-code/assets/main.html"><img src="logo.png" class="logo"></a> <a href="main.html"><img src="logo.png" class="logo"></a>
</header> </header>
<h1>Let your favorite songs play on LOOP.</h1> <h1>Let your favorite songs play on LOOP.</h1>
@ -21,7 +21,7 @@
<div class="login-container"> <div class="login-container">
<input type="text" placeholder="Username" required> <input type="text" placeholder="Username" required>
<input type="password" placeholder="Password" required> <input type="password" placeholder="Password" required>
<a href="file:///home/devel/Desktop/loop-code/assets/front.html" class="button">Log In</a> <a href="front.html" class="button">Log In</a>
</div> </div>
<h2>Don't have an account ?<a href="" class="orange"> Sign up now.</a> </span></h2> <h2>Don't have an account ?<a href="" class="orange"> Sign up now.</a> </span></h2>

View File

@ -1,23 +1,30 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Muddy Files</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="stylesmf.css">
<title>LOOP</title> </head>
<base href="./"> <body>
<script src="https://kit.fontawesome.com/96dcb489df.js" crossorigin="anonymous"></script> <header>
<link rel="stylesheet" href="stylesmf.css"> <a href="main.html"><img src="logo.png" alt="Logo" class="logo"></a>
</head> </header>
<body>
<header> <div class="container">
<a href="file:///home/devel/Desktop/loop-code/assets/main.html"><img src="logo.png" class="logo"></a> <div class="vinyl-wrapper">
</header> <div class="vinyl">
<img src="pochette.jpg" alt="Pochette de l'album">
</div>
</div>
<div class="audio-player">
<script src="script.js"></script> <audio id="audio" src="muddy_files.mp3"></audio>
<button id="play-pause">▶️</button>
<input type="range" id="progress" value="0" step="1">
<div id="time">0:00 / 0:00</div>
</div>
</div>
</body> <script src="muddy_files.js"></script>
</body>
</html> </html>

View File

@ -0,0 +1,47 @@
const audio = document.getElementById('audio');
const playPauseBtn = document.getElementById('play-pause');
const progress = document.getElementById('progress');
const time = document.getElementById('time');
const vinyl = document.querySelector('.vinyl');
let isPlaying = false;
// Play / Pause button
playPauseBtn.addEventListener('click', () => {
if (isPlaying) {
audio.pause();
vinyl.style.animationPlayState = 'paused';
playPauseBtn.textContent = '▶️';
} else {
audio.play();
vinyl.style.animationPlayState = 'running';
playPauseBtn.textContent = '⏸️';
}
isPlaying = !isPlaying;
});
// Update progress and time
audio.addEventListener('timeupdate', () => {
progress.value = audio.currentTime;
updateTimeDisplay();
});
// Set duration when audio loads
audio.addEventListener('loadedmetadata', () => {
progress.max = audio.duration;
updateTimeDisplay();
});
// Seek audio
progress.addEventListener('input', () => {
audio.currentTime = progress.value;
});
function updateTimeDisplay() {
const format = (s) => {
const m = Math.floor(s / 60);
const ss = Math.floor(s % 60);
return `${m}:${ss < 10 ? '0' + ss : ss}`;
};
time.textContent = `${format(audio.currentTime)} / ${format(audio.duration)}`;
}

View File

@ -1,109 +1,123 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap');
*{
margin: 0;
padding: 0;
font-family: 'Poppins', sans-serif;
box-sizing: border-box;
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
} }
@media (min-width: 768px) { /* Écran plus large (tablette, PC) */ body {
.container { background: linear-gradient(to bottom, #500000, #000000);
flex-direction: row; color: white;
justify-content: space-around; display: flex;
} flex-direction: column;
} align-items: center;
min-height: 100vh;
/* Par défaut, style mobile */
body {
font-size: 16px;
background: linear-gradient(to bottom, #585858, #000000);
display: grid;
place-items: center; /* Centre horizontalement et verticalement */
height: 100vh;
margin: 0;
}
/* Quand l'écran est large (ex : tablette ou ordinateur) */
@media (min-width: 768px) {
body {
font-size: 18px;
}
}
.logo{
margin-top: 40px;
max-width: 280px;
} }
.logofront{ header {
max-width: 130px; width: 100%;
margin-right: 700px; padding: 15px 30px;
margin-bottom: 880px; display: flex;
justify-content: flex-start;
align-items: center;
position: absolute;
top: 0;
left: 0;
}
.logo {
width: 100px;
height: auto;
} }
.container { .container {
display: flex; margin-top: 120px;
flex-direction: column; display: flex;
align-items: center; flex-direction: column;
} align-items: center;
h1 {
color: #ffffff;
font-size: 70%;
} }
h2 { .vinyl-wrapper {
color: #ffffff; width: 250px;
font-size: 40%; height: 250px;
margin-bottom: 30px;
position: relative;
} }
.orange { .vinyl {
color: #ffa600; width: 100%;
text-decoration: none; height: 100%;
border-radius: 50%;
background: black;
display: flex;
align-items: center;
justify-content: center;
animation: spin 5s linear infinite paused;
overflow: hidden;
} }
.orange:hover { .vinyl img {
text-decoration: underline; width: 100px;
height: 100px;
border-radius: 50%;
object-fit: cover;
z-index: 2;
} }
.login-container { @keyframes spin {
background: white; 0% { transform: rotate(0deg); }
padding: 20px; 100% { transform: rotate(360deg); }
border-radius: 30px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
width: 300px;
height: 400px;
text-align: center
} }
.login-container input { /* Bouton play/pause en blanc */
width: 100%; #play-pause {
padding: 10px; color: white;
margin: 10px 0; font-size: 30px;
border: 1px solid #ccc; background: none;
border-radius: 50px; border: none;
font-size: 16px; cursor: pointer;
} }
.button { #play-pause:hover {
width: 100%; transform: scale(1.1);
padding: 10px; transition: transform 0.2s ease;
background-color:#ffa600;
color: white;
border: none;
border-radius: 50px;
font-size: 18px;
cursor: pointer;
transition: background 0.3s ease;
text-decoration: none;
} }
.button:hover { /* Barre de progression audio blanche */
background-color: #dd3000; #progress {
-webkit-appearance: none;
width: 100%;
height: 6px;
background: white;
border-radius: 3px;
outline: none;
margin: 10px 0;
} }
/* Curseur (thumb) blanc */
#progress::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 15px;
height: 15px;
border-radius: 50%;
background: white;
cursor: pointer;
border: none;
}
#progress::-moz-range-thumb {
width: 15px;
height: 15px;
border-radius: 50%;
background: white;
cursor: pointer;
border: none;
}
/* Texte du timer blanc (déjà par défaut mais pour être sûr) */
#time {
color: white;
}

View File

@ -1,42 +1,123 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap');
*{
margin: 0; * {
padding: 0; margin: 0;
font-family: 'Poppins', sans-serif; padding: 0;
box-sizing: border-box; box-sizing: border-box;
font-family: 'Poppins', sans-serif;
} }
html, body { body {
height: 100%; background: linear-gradient(to bottom, #316997, #18344b);
} color: white;
display: flex;
body { flex-direction: column;
background: linear-gradient(to bottom, #316997, #18344b); align-items: center;
} min-height: 100vh;
}
/* Structure de base */
header { header {
display: flex; width: 100%;
justify-content: flex-start; /* Aligne à gauche */ padding: 15px 30px;
align-items: center; /* Centré verticalement si tu ajoutes du texte à côté */ display: flex;
padding: 10px 20px; justify-content: flex-start;
position: relative; align-items: center;
} position: absolute;
top: 0;
/* Style du logo */ left: 0;
.logo { }
width: 120px; /* Ajuste la taille selon ton design */
height: auto; .logo {
} width: 100px;
height: auto;
/* Responsive pour smartphone */ }
@media (max-width: 768px) {
.logo { .container {
width: 100px; /* Un peu plus petit sur mobile si nécessaire */ margin-top: 120px;
} display: flex;
flex-direction: column;
header { align-items: center;
padding: 10px; }
}
} .vinyl-wrapper {
width: 250px;
height: 250px;
margin-bottom: 30px;
position: relative;
}
.vinyl {
width: 100%;
height: 100%;
border-radius: 50%;
background: black;
display: flex;
align-items: center;
justify-content: center;
animation: spin 5s linear infinite paused;
overflow: hidden;
}
.vinyl img {
width: 100px;
height: 100px;
border-radius: 50%;
object-fit: cover;
z-index: 2;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Bouton play/pause en blanc */
#play-pause {
color: white;
font-size: 30px;
background: none;
border: none;
cursor: pointer;
}
#play-pause:hover {
transform: scale(1.1);
transition: transform 0.2s ease;
}
/* Barre de progression audio blanche */
#progress {
-webkit-appearance: none;
width: 100%;
height: 6px;
background: white;
border-radius: 3px;
outline: none;
margin: 10px 0;
}
/* Curseur (thumb) blanc */
#progress::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 15px;
height: 15px;
border-radius: 50%;
background: white;
cursor: pointer;
border: none;
}
#progress::-moz-range-thumb {
width: 15px;
height: 15px;
border-radius: 50%;
background: white;
cursor: pointer;
border: none;
}
/* Texte du timer blanc (déjà par défaut mais pour être sûr) */
#time {
color: white;
}