ajout menu déroulant + bouton +

This commit is contained in:
James BOUTARIC 2024-06-05 11:14:54 +02:00
parent ee261d214e
commit f8cb928280
16 changed files with 230 additions and 51 deletions

View File

@ -14,4 +14,11 @@ class Albums extends CI_Controller {
$this->load->view('layout/footer_chanson'); $this->load->view('layout/footer_chanson');
} }
public function view($AlbumsOfArtistId){
$AlbumsOfArtists = $this->model_music->getAlbumsOfArtist($AlbumsOfArtistId);
$this->load->view('layout/header');
$this->load->view('albums_artist_list',['AlbumsOfArtists'=>$AlbumsOfArtists]);
$this->load->view('layout/footer');
}
} }

View File

@ -0,0 +1,14 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class connexion extends CI_Controller {
public function __construct(){
parent::__construct();
$this->load->model('model_music');
}
public function index(){
$this->load->view('layout/connexion');
}
}

View File

@ -14,13 +14,27 @@
<nav class="menu"> <nav class="menu">
<ul> <ul>
<li><?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/','Home'); ?></li> <li><?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/','Home'); ?></li>
<li><?= anchor('albums','Albums'); ?></li> <li class="menu_déroulant"><?= anchor('albums','Albums'); ?>
<li><?= anchor('artistes','Artistes'); ?></li> <div class="menu_déroulant_content">
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/196','New Masters'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/88','Joe Cocker!'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/213','Dylan'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/142','Mothers Milk'); ?>
</div>
</li>
<li class="menu_déroulant"><?= anchor('artistes','Artistes'); ?>
<div class="menu_déroulant_content">
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/artistes/view/34','Queen'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/21','Slayer'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/63','Muse'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/62','Tool'); ?>
</div>
</li>
<li><?= anchor('playlist','Playlist'); ?></li> <li><?= anchor('playlist','Playlist'); ?></li>
</ul> </ul>
</nav> </nav>
<div class="user"> <div class="user">
<a class="bouton" href="html/Connexion.html">Connexion</a> <a class="bouton" href="connexion.php">Connexion</a>
<a class="bouton" href="html/Inscription.html">S'inscrire</a> <a class="bouton" href="html/Inscription.html">S'inscrire</a>
</div> </div>
</header> </header>

View File

@ -1,5 +1,4 @@
<h5>Liste des albums</h5>
<section class="container"> <section class="container">
<?php <?php
foreach ($AlbumsOfArtists as $AlbumsOfArtist) { foreach ($AlbumsOfArtists as $AlbumsOfArtist) {
@ -8,6 +7,7 @@
echo anchor("albums/view/{$AlbumsOfArtist->id}", "{$AlbumsOfArtist->name}"); echo anchor("albums/view/{$AlbumsOfArtist->id}", "{$AlbumsOfArtist->name}");
echo "<br>"; echo "<br>";
echo "</header>"; echo "</header>";
echo '<img src="data:image/jpeg;base64,' . base64_encode($AlbumsOfArtist->jpeg) . '" alt="' . $AlbumsOfArtist->name . '" />'; echo '<img src="data:image/jpeg;base64,' . base64_encode($AlbumsOfArtist->jpeg) . '" alt="' . $AlbumsOfArtist->name . '" />';
echo "<footer class='short-text'>$AlbumsOfArtist->year</footer>"; echo "<footer class='short-text'>$AlbumsOfArtist->year</footer>";
echo "</article></div>"; echo "</article></div>";

View File

@ -1,4 +1,4 @@
<h5>Liste des albums</h5>
<section class="container"> <section class="container">
<?php <?php
foreach($albums as $album){ foreach($albums as $album){

View File

@ -1,4 +1,4 @@
<h5>Artists list</h5>
<section class="artiste"> <section class="artiste">
<?php <?php
foreach($artistes as $artiste){ foreach($artistes as $artiste){

View File

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Connexion Spotify</title>
<link rel="stylesheet" href="assets/connexion.css">
</head>
<body>
<div class="container">
<div class="login-box">
<h1>Se connecter à Spotify</h1>
<form action="/login" method="post">
<div class="textbox">
<input type="email" placeholder="Adresse e-mail" name="email" required>
</div>
<div class="textbox">
<input type="password" placeholder="Mot de passe" name="password" required>
</div>
<button type="submit" class="btn">Se connecter</button>
</form>
<hr>
<div class="alt-login">
<p>Ou se connecter avec</p>
<button class="btn social-btn apple">Apple</button>
<button class="btn social-btn google">Google</button>
<button class="btn social-btn facebook">Facebook</button>
</div>
</div>
</div>
</body>
</html>

View File

@ -17,20 +17,34 @@
<nav class="menu"> <nav class="menu">
<ul> <ul>
<li><?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/','Home'); ?></li> <li><?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/','Home'); ?></li>
<li><?= anchor('albums','Albums'); ?></li> <li class="menu_déroulant"><?= anchor('albums','Albums'); ?>
<li><?= anchor('artistes','Artistes'); ?></li> <div class="menu_déroulant_content">
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/196','New Masters'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/88','Joe Cocker!'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/213','Dylan'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/142','Mothers Milk'); ?>
</div>
</li>
<li class="menu_déroulant"><?= anchor('artistes','Artistes'); ?>
<div class="menu_déroulant_content">
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/artistes/view/34','Queen'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/21','Slayer'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/63','Muse'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/62','Tool'); ?>
</div>
</li>
<li><?= anchor('playlist','Playlist'); ?></li> <li><?= anchor('playlist','Playlist'); ?></li>
</ul> </ul>
</nav> </nav>
<div class="user"> <div class="user">
<a class="bouton" href="html/Connexion.html">Connexion</a> <a class="bouton" href="connexion.php">Connexion</a>
<a class="bouton" href="html/Inscription.html">S'inscrire</a> <a class="bouton" href="html/Inscription.html">S'inscrire</a>
</div> </div>
</header> </header>
</main>
<script src="../assets/bouton.js"></script> <script src="../assets/bouton.js"></script>
<button id="scrollTopBtn" onclick="scrollToTop()"> <button id="scrollTopBtn" onclick="scrollToTop()">
<span>&#8593;</span> <span>&#8593;</span>
</button>593;</span>
</button> </button>
</body> </body>
</html> </html>

View File

@ -1,12 +1,11 @@
<h5>Song of the album</h5>
<section class="list"> <section class="list">
<?php <?php
foreach($songs as $song){ foreach($songs as $song){
echo "<div><article>"; echo "<div><article>";
echo "<header class='short-text'>"; echo "<header class='short-text'>";
echo /*anchor("albums/view/{$song->id}",*/"{$song->name}"/*)*/; echo "{$song->name}";
echo " <button class='add-to-playlist' data-song='{$song->name}'>+</button>";
echo "<br>"; echo "<br>";
echo "</header>"; echo "</header>";
echo "</article></div>"; echo "</article></div>";

View File

@ -1,4 +1,4 @@
<h5>Song of the playlist</h5>
<section class="list"> <section class="list">
<?php <?php
foreach($songPlaylists as $songPlaylist){ foreach($songPlaylists as $songPlaylist){

View File

@ -10,7 +10,7 @@ body {
/* Conteneur principal */ /* Conteneur principal */
.container { .container {
width: 80%; width: 100%;
margin: auto; margin: auto;
overflow: hidden; overflow: hidden;
} }

View File

@ -14,12 +14,3 @@ document.addEventListener('scroll', function () {
scrollTopBtn.style.display = 'none'; scrollTopBtn.style.display = 'none';
} }
}); });
// Menu burger
document.addEventListener('DOMContentLoaded', function () {
const burgerMenu = document.querySelector('.burger-menu');
const navLinks = document.querySelector('.nav-links');
burgerMenu.addEventListener('click', function () {
navLinks.classList.toggle('show');
});
});

83
ci/assets/connexion.css Normal file
View File

@ -0,0 +1,83 @@
body {
margin: 0;
padding: 0;
font-family: 'Arial', sans-serif;
background-color: #1DB954;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
background-color: #191414;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
}
.login-box {
max-width: 400px;
margin: auto;
color: white;
}
.login-box h1 {
text-align: center;
margin-bottom: 20px;
}
.textbox {
margin-bottom: 20px;
}
.textbox input {
width: 100%;
padding: 10px;
background-color: #333;
border: none;
border-radius: 5px;
color: white;
font-size: 16px;
}
.btn {
width: 100%;
padding: 10px;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
}
.btn:hover {
opacity: 0.9;
}
.btn.social-btn {
display: block;
margin-bottom: 10px;
}
.apple {
background-color: #A3AAAE;
}
.google {
background-color: #DB4437;
}
.facebook {
background-color: #3B5998;
}
.alt-login p {
text-align: center;
margin: 20px 0;
}
hr {
border: none;
border-top: 1px solid #333;
margin: 20px 0;
}

View File

@ -16,7 +16,27 @@
background-color: #f9f9f9; background-color: #f9f9f9;
} }
.short-text { .song-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.song-name {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
} }
.add-to-playlist {
font-size: 16px;
cursor: pointer;
background-color: #4CAF50;
color: white;
border: none;
padding: 5px 10px;
border-radius: 5px;
}
.add-to-playlist:hover {
background-color: #45a049;
}

View File

@ -4,6 +4,7 @@ body {
box-sizing: border-box; box-sizing: border-box;
background-color: white; background-color: white;
font-size: 16px; font-size: 16px;
height: 100%;
} }
.navbar a { .navbar a {
@ -75,17 +76,19 @@ body {
position: relative; position: relative;
} }
.menu_déroulant:hover .menu_déroulant_content {
display: block;
}
.menu_déroulant_content { .menu_déroulant_content {
display: none; display: none;
position: absolute; position: absolute;
top: 100%; top: 100%;
left: 0;
background-color: black; background-color: black;
min-width: 170px; min-width: 170px;
border-radius: 5px; border-radius: 5px;
} z-index: 1;
.menu_déroulant:hover .menu_déroulant_content {
display: block;
} }
.menu_déroulant_content a { .menu_déroulant_content a {
@ -198,11 +201,12 @@ body {
.content-section h2 { .content-section h2 {
color: #1ed860; color: #1ed860;
} }
body {
font-family: 'Arial', sans-serif; html, body {
height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 16px; font-family: 'Arial', sans-serif;
} }
.logo img { .logo img {
padding-left: 10px; padding-left: 10px;
@ -215,6 +219,7 @@ img {
height: auto; height: auto;
} }
.footer { .footer {
background-color: black; background-color: black;
color: white; color: white;