diff --git a/k-9_url b/k-9_url index 3a34cf5..cef9b64 100644 --- a/k-9_url +++ b/k-9_url @@ -1,26 +1,26 @@ -https://www.shoutfactorytv.com/k-9/k-9-s1-e1-regeneration/54d111ea69702d0707150800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e2-liberation/54d1122969702d04c9700800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e3-the-korven/54d1124369702d04ca100800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e4-the-bounty-hunter/54d1127e69702d04c9740800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e5-sirens-of-ceres/54d1129669702d07071c0800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e6-fear-itself/54d113a069702d04c9830800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e7-the-fall-of-the-house-of-gryffen/54d1142f69702d04c98b0800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e8-jaws-of-orthrus/54d1144169702d07072f0800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e9-dream-eaters/54d1145769702d04c98d0800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e10-curse-of-anubis/54d1146969702d04c9910800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e11-oroborus/54d1147c69702d04ca2c0800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e12-alien-avatar/54d1148e69702d04ca2f0800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e13-aeolian/54d114ac69702d0707380800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e14-the-last-oak-tree/54d114c069702d04ca390800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e15-black-hunger/54d114e769702d04c99a0800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e16-the-cambridge-spy/54d1151269702d04ca3e0800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e17-lost-library-of-ukko/54d1152469702d04c99f0800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e18-mutant-copper/54d1153769702d0707420800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e19-the-custodians/54d1154969702d04c9a40800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e20-taphony-and-the-time-loop/54d1155c69702d04ca450800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e21-robot-gladiators/54d1157069702d0707460800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e22-mind-snap/54d1158469702d0707490800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e23-angel-of-the-north/54d115a669702d07074c0800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e24-the-last-precinct/54d115bb69702d04c9ac0800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e25-hound-of-the-korven/54d115cf69702d04ca4a0800 -https://www.shoutfactorytv.com/k-9/k-9-s1-e26-the-eclipse-of-the-korven/54d115e969702d04c9ae0800 \ No newline at end of file +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e1-regeneration/54d111ea69702d0707150800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e2-liberation/54d1122969702d04c9700800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e3-the-korven/54d1124369702d04ca100800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e4-the-bounty-hunter/54d1127e69702d04c9740800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e5-sirens-of-ceres/54d1129669702d07071c0800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e6-fear-itself/54d113a069702d04c9830800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e7-the-fall-of-the-house-of-gryffen/54d1142f69702d04c98b0800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e8-jaws-of-orthrus/54d1144169702d07072f0800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e9-dream-eaters/54d1145769702d04c98d0800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e10-curse-of-anubis/54d1146969702d04c9910800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e11-oroborus/54d1147c69702d04ca2c0800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e12-alien-avatar/54d1148e69702d04ca2f0800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e13-aeolian/54d114ac69702d0707380800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e14-the-last-oak-tree/54d114c069702d04ca390800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e15-black-hunger/54d114e769702d04c99a0800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e16-the-cambridge-spy/54d1151269702d04ca3e0800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e17-lost-library-of-ukko/54d1152469702d04c99f0800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e18-mutant-copper/54d1153769702d0707420800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e19-the-custodians/54d1154969702d04c9a40800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e20-taphony-and-the-time-loop/54d1155c69702d04ca450800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e21-robot-gladiators/54d1157069702d0707460800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e22-mind-snap/54d1158469702d0707490800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e23-angel-of-the-north/54d115a669702d07074c0800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e24-the-last-precinct/54d115bb69702d04c9ac0800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e25-hound-of-the-korven/54d115cf69702d04ca4a0800 +youtube-dl https://www.shoutfactorytv.com/k-9/k-9-s1-e26-the-eclipse-of-the-korven/54d115e969702d04c9ae0800 \ No newline at end of file diff --git a/migrations/2022-07-20-084320_create_users/up.sql b/migrations/2022-07-20-084320_create_users/up.sql index 4cf6866..cf93438 100644 --- a/migrations/2022-07-20-084320_create_users/up.sql +++ b/migrations/2022-07-20-084320_create_users/up.sql @@ -7,7 +7,7 @@ create table users( email VARCHAR(255) NOT NULL DEFAULT '', google VARCHAR(255) NOT NULL DEFAULT '', email_valid VARCHAR(255) NOT NULL DEFAULT '', - email_valid VARCHAR(255) NOT NULL DEFAULT '' + data VARCHAR(255) NOT NULL DEFAULT '' ); insert into users(username, password, salt) values ('adminkey', '', ''); diff --git a/static/js/modal.js b/static/js/modal.js new file mode 100644 index 0000000..05fac37 --- /dev/null +++ b/static/js/modal.js @@ -0,0 +1,95 @@ +/* + * Modal + * + * Pico.css - https://picocss.com + * Copyright 2019-2022 - Licensed under MIT + */ + +// Config +const isOpenClass = 'modal-is-open'; +const openingClass = 'modal-is-opening'; +const closingClass = 'modal-is-closing'; +const animationDuration = 400; // ms +let visibleModal = null; + + +// Toggle modal +const toggleModal = event => { + event.preventDefault(); + const modal = document.getElementById(event.currentTarget.getAttribute('data-target')); + (typeof(modal) != 'undefined' && modal != null) + && isModalOpen(modal) ? closeModal(modal) : openModal(modal) +} + +// Is modal open +const isModalOpen = modal => { + return modal.hasAttribute('open') && modal.getAttribute('open') != 'false' ? true : false; +} + +// Open modal +const openModal = modal => { + if (isScrollbarVisible()) { + document.documentElement.style.setProperty('--scrollbar-width', `${getScrollbarWidth()}px`); + } + document.documentElement.classList.add(isOpenClass, openingClass); + setTimeout(() => { + visibleModal = modal; + document.documentElement.classList.remove(openingClass); + }, animationDuration); + modal.setAttribute('open', true); +} + +// Close modal +const closeModal = modal => { + visibleModal = null; + document.documentElement.classList.add(closingClass); + setTimeout(() => { + document.documentElement.classList.remove(closingClass, isOpenClass); + document.documentElement.style.removeProperty('--scrollbar-width'); + modal.removeAttribute('open'); + }, animationDuration); +} + +// Close with a click outside +document.addEventListener('click', event => { + if (visibleModal != null) { + const modalContent = visibleModal.querySelector('article'); + const isClickInside = modalContent.contains(event.target); + !isClickInside && closeModal(visibleModal); + } +}); + +// Close with Esc key +document.addEventListener('keydown', event => { + if (event.key === 'Escape' && visibleModal != null) { + closeModal(visibleModal); + } +}); + +// Get scrollbar width +const getScrollbarWidth = () => { + + // Creating invisible container + const outer = document.createElement('div'); + outer.style.visibility = 'hidden'; + outer.style.overflow = 'scroll'; // forcing scrollbar to appear + outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps + document.body.appendChild(outer); + + // Creating inner element and placing it in the container + const inner = document.createElement('div'); + outer.appendChild(inner); + + // Calculating difference between container's full width and the child width + const scrollbarWidth = (outer.offsetWidth - inner.offsetWidth); + + // Removing temporary elements from the DOM + outer.parentNode.removeChild(outer); + + return scrollbarWidth; +} + +// Is scrollbar visible +const isScrollbarVisible = () => { + return document.body.scrollHeight > screen.height; +} diff --git a/templates/header.html.twig b/templates/header.html.twig index de0226c..9a11139 100644 --- a/templates/header.html.twig +++ b/templates/header.html.twig @@ -1,5 +1,7 @@ + + @@ -12,59 +14,54 @@ K-9 and Company Class + + {% if user is defined %} + + + + + + Profil + Deconnexion + + + {% else %} + Inscription + Connexion + {# Inscription + Connexion #} + {% endif %} + + + + + + + + {% include 'forms/user/login.html.twig' %} + + + + + + + {% include 'forms/user/register.html.twig' %} + + - - - - - - - - - - - - COMMENCER - - - FONCTIONNALITES - - - EXEMPLES - - - {# - - #} - - {% if user is defined %} - Tableaux de bord - - - - - - Profil - - Deconnexion - - - {% else %} - Inscription - Connexion - {% endif %} - - - - - - {# #} - {% if user is not defined %} {# Modal pour LogIn #} - +{# @@ -77,10 +74,10 @@ - + #} {# Modal pour SignUp #} - +{# @@ -93,5 +90,5 @@ - + #} {% endif %} \ No newline at end of file diff --git a/templates/includecss.html.twig b/templates/includecss.html.twig index baa7735..1289fa2 100644 --- a/templates/includecss.html.twig +++ b/templates/includecss.html.twig @@ -15,4 +15,5 @@ - \ No newline at end of file + + \ No newline at end of file