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');
}
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

@ -14,4 +14,4 @@ class Song extends CI_Controller {
$this->load->view('song_album_list',['songs'=>$songs]);
$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

@ -7,22 +7,36 @@
</head>
<body>
<main class='container'>
<header class="navbar">
<header class="navbar">
<div class="logo">
<img src="assets/img/Logo1.png" alt="SpotiFly">
</div>
<nav class="menu">
<ul>
<li><?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/','Home'); ?></li>
<li><?= anchor('albums','Albums'); ?></li>
<li><?= anchor('artistes','Artistes'); ?></li>
<li class="menu_déroulant"><?= anchor('albums','Albums'); ?>
<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>
</ul>
</nav>
<div class="user">
<a class="bouton" href="html/Connexion.html">Connexion</a>
<a class="bouton" href="html/Inscription.html">S'inscrire</a>
</div>
<a class="bouton" href="connexion.php">Connexion</a>
<a class="bouton" href="html/Inscription.html">S'inscrire</a>
</div>
</header>
<div id="Page">
<div class="content">

View File

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

View File

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

View File

@ -1,4 +1,4 @@
<h5>Artists list</h5>
<section class="artiste">
<?php
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">
<ul>
<li><?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/','Home'); ?></li>
<li><?= anchor('albums','Albums'); ?></li>
<li><?= anchor('artistes','Artistes'); ?></li>
<li class="menu_déroulant"><?= anchor('albums','Albums'); ?>
<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>
</ul>
</nav>
<div class="user">
<a class="bouton" href="html/Connexion.html">Connexion</a>
<a class="bouton" href="html/Inscription.html">S'inscrire</a>
</div>
</header>
<a class="bouton" href="connexion.php">Connexion</a>
<a class="bouton" href="html/Inscription.html">S'inscrire</a>
</div>
</header>
</main>
<script src="../assets/bouton.js"></script>
<button id="scrollTopBtn" onclick="scrollToTop()">
<span>&#8593;</span>
</button>593;</span>
</button>
</body>
</html>
<button id="scrollTopBtn" onclick="scrollToTop()">
<span>&#8593;</span>
</button>
</body>
</html>

View File

@ -1,15 +1,14 @@
<h5>Song of the album</h5>
<section class="list">
<?php
foreach($songs as $song){
echo "<div><article>";
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 "</header>";
echo "</article></div>";
}
?>
</section>
</section>

View File

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

View File

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

View File

@ -14,12 +14,3 @@ document.addEventListener('scroll', function () {
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;
}
.short-text {
.song-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.song-name {
font-size: 18px;
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;
background-color: white;
font-size: 16px;
height: 100%;
}
.navbar a {
@ -75,19 +76,21 @@ body {
position: relative;
}
.menu_déroulant_content {
display: none;
position: absolute;
top: 100%;
background-color: black;
min-width: 170px;
border-radius: 5px;
}
.menu_déroulant:hover .menu_déroulant_content {
display: block;
}
.menu_déroulant_content {
display: none;
position: absolute;
top: 100%;
left: 0;
background-color: black;
min-width: 170px;
border-radius: 5px;
z-index: 1;
}
.menu_déroulant_content a {
color: #fff;
padding: 10px;
@ -198,11 +201,12 @@ body {
.content-section h2 {
color: #1ed860;
}
body {
font-family: 'Arial', sans-serif;
html, body {
height: 100%;
margin: 0;
padding: 0;
font-size: 16px;
font-family: 'Arial', sans-serif;
}
.logo img {
padding-left: 10px;
@ -215,6 +219,7 @@ img {
height: auto;
}
.footer {
background-color: black;
color: white;