Compare commits

..

No commits in common. "2209b410f1265ad8311d849f114cdadf0e5e7d75" and "5b0f5a69c4cdaed4606218e5ca56b3445a166da5" have entirely different histories.

13 changed files with 243 additions and 469 deletions

View file

@ -1,16 +0,0 @@
.ajouter-un-album {
span.item {
margin-right: 0.6rem;
&::after {
content: ",";
}
&:last-child {
margin-right: 0;
&::after {
content: "";
}
}
}
}

View file

@ -1,48 +0,0 @@
.button {
cursor: pointer;
justify-content: center;
padding-bottom: calc(0.5em - 1px);
padding-left: 1em;
padding-right: 1em;
padding-top: calc(0.5em - 1px);
text-align: center;
white-space: nowrap;
border-width: 1px;
margin-bottom: .5rem;
background-color: #fff;
border-color: #dbdbdb;
&.is-danger {
background-color: #f14668;
border-color: transparent;
color: #fff;
&:hover {
background-color: #f03a5f;
border-color: transparent;
color: #fff;
}
}
&.is-link {
background-color: #485fc7;
border-color: transparent;
color: #fff;
&:hover {
background-color: #3e56c4;
border-color: transparent;
color: #fff;
}
}
&.is-primary {
background-color: #48c78e;
border-color: transparent;
color: #fff;
&:hover {
background-color: #3ec487;
}
}
}

View file

@ -1,14 +0,0 @@
.flash {
background-color: #f14668;
border-radius: 6px;
box-shadow: 0 .5em 1em -.125em rgba(10,10,10,.1),0 0 0 1px rgba(10,10,10,.02);
color: #fff;
display: block;
padding: 1.25rem;
width: calc(100% - 6rem);
margin: 2rem auto;
.header {
font-weight: 800;
}
}

View file

@ -1,15 +1,5 @@
.field { .field {
padding-top: .6rem; padding-top: .6rem;
&.has-addons {
display: flex;
justify-content: flex-start;
.button {
margin-bottom: 0;
}
}
label { label {
font-weight: 800; font-weight: 800;
} }
@ -22,3 +12,40 @@
color: #363636; color: #363636;
} }
} }
.button {
cursor: pointer;
justify-content: center;
padding-bottom: calc(0.5em - 1px);
padding-left: 1em;
padding-right: 1em;
padding-top: calc(0.5em - 1px);
text-align: center;
white-space: nowrap;
border-width: 1px;
margin-bottom: .5rem;
&.is-danger {
background-color: #f14668;
border-color: transparent;
color: #fff;
&:hover {
background-color: #f03a5f;
border-color: transparent;
color: #fff;
}
}
&.is-link {
background-color: #485fc7;
border-color: transparent;
color: #fff;
&:hover {
background-color: #3e56c4;
border-color: transparent;
color: #fff;
}
}
}

View file

@ -15,6 +15,5 @@ body {
a { a {
color: #485fc7; color: #485fc7;
cursor: pointer;
} }
} }

View file

@ -1,4 +1,3 @@
.home {
.header { .header {
margin-bottom: 3.25rem; margin-bottom: 3.25rem;
@include respond-to("small-up") { @include respond-to("small-up") {
@ -7,4 +6,3 @@
background-size: cover; background-size: cover;
} }
} }
}

View file

@ -28,12 +28,5 @@
@import './global'; @import './global';
@import './navbar'; @import './navbar';
@import './forms'; @import './forms';
@import './button.scss';
@import './table';
@import './modal';
@import './toast';
@import './flash';
@import './home'; @import './home';
@import './connexion'; @import './connexion';
@import './ajouter-un-album';

View file

@ -1,124 +0,0 @@
.modal {
bottom: 0;
left: 0;
right: 0;
top: 0;
align-items: center;
display: none;
flex-direction: column;
justify-content: center;
overflow: hidden;
position: fixed;
z-index: 40;
&.is-visible {
display: flex;
}
.modal-background {
background-color: rgba(10,10,10,.86);
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.modal-card {
position: relative;
width: 300px;
margin: 0 auto;
display: flex;
flex-direction: column;
max-height: calc(100vh - 40px);
overflow: hidden;
@include respond-to("small-up") {
width: 560px;
}
@include respond-to("medium-up") {
width: 980px;
}
@include respond-to("large-up") {
width: 1200;
}
header,
footer {
align-items: center;
background-color: #f5f5f5;
display: flex;
flex-shrink: 0;
justify-content: flex-start;
padding: 20px;
position: relative;
}
header {
border-bottom: 1px solid #dbdbdb;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
justify-content: space-between;
font-size: 1.5rem;
button {
user-select: none;
background-color: rgba(10,10,10,.2);
border: none;
border-radius: 9999px;
cursor: pointer;
pointer-events: auto;
display: inline-block;
flex-grow: 0;
flex-shrink: 0;
font-size: 0;
height: 20px;
max-height: 20px;
max-width: 20px;
min-height: 20px;
min-width: 20px;
outline: none;
position: relative;
width: 20px;
&::before,
&::after {
background-color: #fff;
content: "";
display: block;
left: 50%;
position: absolute;
top: 50%;
transform: translateX(-50%) translateY(-50%) rotate(45deg);
transform-origin: center center;
}
&::before {
height: 2px;
width: 50%;
}
&::after {
height: 50%;
width: 2px;
}
}
}
section {
background-color: #fff;
flex-grow: 1;
flex-shrink: 1;
overflow: auto;
padding: 20px;
}
footer {
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
border-top: 1px solid #dbdbdb;
.button:not(:last-child) {
margin-right: .5em;
}
}
}
}

View file

@ -1,24 +0,0 @@
table {
color: #363636;
th, td {
padding: .5em .75em;
border-bottom: 1px solid #dbdbdb;
}
th {
border-bottom-width: 2px;
}
tr:nth-child(2n) {
background-color: #fafafa;
}
tbody {
tr {
&:hover {
background-color: #f5f5f5;
}
}
}
}

View file

@ -8,59 +8,10 @@
top: 30px; top: 30px;
font-size: 17px; font-size: 17px;
padding: 1.25rem 2.5rem 1.25rem 1.5rem;
background-color: #f14668;
color: #fff;
&.show { &.show {
visibility: visible; visibility: visible;
animation: toastrFadein 0.5s, toastrFadeout 0.5s 2.5s; animation: toastrFadein 0.5s, toastrFadeout 0.5s 2.5s;
} }
button {
width: 20px;
font-size: 0;
height: 20px;
max-height: 20px;
max-width: 20px;
min-height: 20px;
min-width: 20px;
outline: 0;
border: none;
border-radius: 9999px;
cursor: pointer;
pointer-events: auto;
display: inline-block;
user-select: none;
right: .5rem;
position: absolute;
top: .5rem;
background-color: rgba(10, 10, 10, 0.2);
&:hover {
background-color: rgba(10,10,10,.3);
}
&::before,
&::after {
background-color: #fff;
content: "";
display: block;
left: 50%;
position: absolute;
top: 50%;
transform: translateX(-50%) translateY(-50%) rotate(45deg);
transform-origin: center center;
}
&::before {
height: 2px;
width: 50%;
}
&::after {
height: 50%;
width: 2px;
}
}
} }
@keyframes toastrFadein { @keyframes toastrFadein {

View file

@ -26,7 +26,7 @@
<script> <script>
function showToastr(message) { function showToastr(message) {
let x = document.getElementById("toastr"); var x = document.getElementById("toastr");
if ( message ) { if ( message ) {
x.getElementsByTagName("SPAN")[0].innerHTML = message; x.getElementsByTagName("SPAN")[0].innerHTML = message;
} }
@ -35,12 +35,6 @@
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
}; };
function hideToastr() {
let x = document.getElementById("toastr");
x.className = x.className.replace("show", "");
}
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0); const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
if ($navbarBurgers.length > 0) { if ($navbarBurgers.length > 0) {
@ -126,37 +120,52 @@
</div> </div>
</nav> </nav>
<div id="toastr"> <!-- <div id="toastr" class="notification is-danger">
<button class="delete" onclick="hideToastr()"></button> <button class="delete"></button>
<span></span> <span></span>
</div> </div> -->
<!-- <main class="layout-maxed">
<% if ( page.failureFlash || (error && error.length > 0 ) ) {%> <% if ( page.failureFlash || (error && error.length > 0 ) ) {%>
<div class="flash"> <div class="columns is-mobile">
<div class="
column
is-10-mobile is-offset-1-mobile
is-8-tablet is-offset-2-tablet
is-6-desktop is-offset-3-desktop
is-4-widescreen is-offset-4-widescreen
">
<% if ( page.failureFlash ) {%> <% if ( page.failureFlash ) {%>
<div class="header"> <article class="message is-danger">
Erreur <div class="message-header">
<p>Erreur</p>
</div> </div>
<div class="body"> <div class="message-body">
<%= page.failureFlash %> <%= page.failureFlash %>
</div> </div>
</article>
<% } %> <% } %>
<% <%
if (error && error.length > 0) { if (error && error.length > 0) {
for( let i = 0 ; i < error.length ; i += 1 ) { for( let i = 0 ; i < error.length ; i += 1 ) {
%> %>
<div class="header"> <article class="message is-danger">
Erreur <div class="message-header">
<p>Erreur</p>
<button class="delete" aria-label="delete"></button>
</div> </div>
<div class="body"> <div class="message-body">
<%= error %> <%= error %>
</div> </div>
</article>
<% <%
} }
} }
%> %>
</div> </div>
</div>
<% } %> <% } %>
</main> -->
<%- include(viewname) %> <%- include(viewname) %>

View file

@ -1,109 +1,19 @@
<section class="layout-maxed ajouter-un-album" id="app"> <div class="container" id="app">
<div class="modal" :class="{'is-visible': modalIsVisible}" id="addAlbum">
<div class="modal-background"></div>
<div class="modal-card">
<header>
<div>{{details.artists_sort}} - {{details.title}}</div>
<button aria-label="close" @click="toggleModal"></button>
</header>
<section>
<div class="grid grid-cols-2 gap-16">
<div>
<div class="text-center">
<img :src="details.thumb %>" alt="Miniature" />
<hr />
<img v-for="image in details.images" :src="image.uri150" alt="Miniature" style="max-width: 60px;" />
<hr />
</div>
<ol class="ml-4">
<li v-for="track in details.tracklist">{{ track.title }} ({{track.duration}})</li>
</ol>
</div>
<div>
<div class="grid grid-cols-2 gap-10">
<div>
<strong>Genres</strong>
<br />
<span class="item" v-for="genre in details.genres">{{genre}}</span>
</div>
<div>
<strong>Styles</strong>
<br />
<span class="item" v-for="style in details.styles">{{style}}</span>
</div>
</div>
<hr />
<div class="grid grid-cols-3 gap-10">
<div>
<strong>Pays</strong>
<br />
<span>{{details.country}}</span>
</div>
<div>
<strong>Année</strong>
<br />
<span>{{details.year}}</span>
</div>
<div>
<strong>Date de sortie</strong>
<br />
<span>{{details.released}}</span>
</div>
</div>
<hr />
<div class="grid grid-cols-2 gap-10">
<div>
<strong>Format</strong>
<br />
<span v-for="format in details.formats">{{format.name}}</span>
</div>
</div>
<hr />
<div class="grid grid-cols-2 gap-10">
<div>
<strong>Codes barres</strong>
<ol>
<li v-for="identifier in details.identifiers">
{{identifier.value}} ({{identifier.type}})
</li>
</ol>
</div>
<div>
<strong>Label</strong>
<ol>
<li v-for="label in details.labels">
{{label.name}}
</li>
</ol>
<strong>Société</strong>
<ol>
<li v-for="company in details.companie">
{{company.name}}
</li>
</ol>
</div>
</div>
</div>
</div>
</section>
<footer>
<button class="button is-primary" @click="add">Ajouter</button>
<button class="button" @click="toggleModal">Annuler</button>
</footer>
</div>
</div>
<div class="layout-hero">
<form @submit="search"> <form @submit="search">
<div class="field has-addons"> <div class="field has-addons">
<input type="text" name="q" v-model="q" placeholder="Nom de l'album ou code barre (ex : Hybrid Theory)"> <div class="control">
<input class="input" type="text" name="q" v-model="q" placeholder="Nom de l'album ou code barre (ex : Hybrid Theory">
</div>
<div class="control">
<button class="button is-link" :disabled="loading"> <button class="button is-link" :disabled="loading">
<span class="icon"> <span class="icon">
<i class="fas fa-search"></i> <i class="fas fa-search"></i>
</span> </span>
</button> </button>
</div> </div>
</div>
</form> </form>
<table class="mt-20"> <table class="table is-striped is-hoverable is-fullwidth">
<thead> <thead>
<tr> <tr>
<th>Pochette</th> <th>Pochette</th>
@ -127,6 +37,7 @@
</td> </td>
<td> <td>
<a @click="loadDetails(item.id)">{{ item.title }}</a> <a @click="loadDetails(item.id)">{{ item.title }}</a>
<!-- <a :href="'/ajouter-un-album/' + item.id">{{ item.title }}</a> -->
</td> </td>
<td>{{ item.year }}</td> <td>{{ item.year }}</td>
<td>{{ item.country }}</td> <td>{{ item.country }}</td>
@ -148,9 +59,121 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="modal" :class="{'is-active': modalIsVisible}" id="addAlbum">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">{{details.artists_sort}} - {{details.title}}</p>
<button class="delete" aria-label="close" @click="toggleModal"></button>
</header>
<section class="modal-card-body">
<div class="columns is-mobile">
<div class="column is-12-mobile is-4-desktop">
<div class="has-text-centered">
<img :src="details.thumb %>" alt="Miniature" />
<hr />
<img v-for="image in details.images" :src="image.uri150" alt="Miniature" style="max-width: 60px;" />
<hr />
</div>
<ol class="ml-4">
<li v-for="track in details.tracklist">{{ track.title }} ({{track.duration}})</li>
</ol>
</div>
<div class="column is-12-mobile is-8-desktop">
<div class="column is-12">
<div class="columns is-mobile is-multiline">
<div class="column is-12-mobile is-6-desktop" v-for="genre in details.genres">
<div class="field">
<label class="label" for="company">Genre</label>
<div class="control">
<input type="text" id="genres" name="genres" class="input" v-model="genre" disabled />
</div>
</div>
</div>
<div class="column is-12-mobile is-6-desktop" v-for="style in details.styles">
<div class="field">
<label class="label" for="company">Style</label>
<div class="control">
<input type="text" id="style" name="style" class="input" v-model="style" disabled />
</div>
</div>
</div>
</div>
<hr />
<div class="columns is-mobile">
<div class="column is-12-mobile is-6-desktop">
<div class="field">
<label class="label" for="year">Année</label>
<div class="control">
<input type="text" id="year" name="year" class="input" v-model="details.year" disabled />
</div>
</div>
</div>
<div class="column is-12-mobile is-6-desktop">
<div class="field">
<label class="label" for="released">Date de sortie</label>
<div class="control">
<input type="text" id="released" name="released" class="input" v-model="details.released" disabled />
</div>
</div>
</div>
</div>
<hr />
<div class="columns is-mobile">
<div class="column is-12-mobile is-6-desktop">
<div class="field">
<label class="label" for="country">Pays</label>
<div class="control">
<input type="text" id="country" name="country" class="input" v-model="details.country" disabled />
</div>
</div>
</div>
<div class="column is-12-mobile is-6-desktop" v-for="format in details.formats">
<div class="field">
<label class="label" for="format">Format</label>
<div class="control">
<input type="text" id="format" name="format" class="input" v-model="format.name" disabled />
</div>
</div>
</div>
</div>
<hr />
<div class="columns is-mobile">
<div class="column is-12-mobile is-6-desktop">
<span class="label">Codes barres</span>
<ol>
<li v-for="identifier in details.identifiers">
{{identifier.value}} ({{identifier.type}})
</li>
</ol>
</div>
<div class="column is-12-mobile is-6-desktop">
<span class="label">Label</span>
<div class="field" v-for="label in details.labels">
<div class="control">
<input type="text" name="label" class="input" v-model="label.name" disabled />
</div>
</div>
<span class="label">Société</span>
<div class="field" v-for="company in details.companies">
<div class="control">
<input type="text" name="company" class="input" v-model="company.name" disabled />
</div>
</div>
</div>
</div>
</div>
</div>
</div> </div>
</section> </section>
<footer class="modal-card-foot">
<button class="button is-success" @click="add">Ajouter</button>
<button class="button" @click="toggleModal">Annuler</button>
</footer>
</div>
<button class="modal-close is-large" aria-label="close" @click="toggleModal"></button>
</div>
</div>
<script> <script>
Vue.createApp({ Vue.createApp({
data() { data() {

View file

@ -1,4 +1,4 @@
<main class="layout-maxed home"> <main class="layout-maxed">
<div class="header layout-hero"></div> <div class="header layout-hero"></div>
<h1> <h1>
My Music Library My Music Library