// Animation d’apparition des titres
[Link](‘.titre’).[Link] = ‘0’ ;
[Link](‘.titre’).[Link] = ‘opacity 1s’ ;
[Link](‘.titre’).[Link] = ‘1’ ;
// Animation de disparition des titres par opacité
[Link](‘.titre’).[Link] = ‘0’ ;
// Animation de disparition par opacité de la page actuelle et d’apparition de la suivante
Function changerTheme() {
[Link] = ‘0’ ;
setTimeout(() => {
if ([Link] === ‘white’) {
[Link] = ‘black’ ;
[Link] = ‘white’ ;
[Link](‘.formulaire’).[Link] = ‘yellow’ ;
[Link](‘input’).forEach(input => [Link] = ‘red’) ;
[Link](‘button’).[Link] = ‘yellow’ ;
[Link](‘h1’).forEach(titre => {
[Link] = ‘white’ ;
[Link] = ‘green’ ;
}) ;
} else {
[Link] = ‘white’ ;
[Link] = ‘black’ ;
[Link](‘.formulaire’).[Link] = ‘green’ ;
[Link](‘input’).forEach(input => [Link] = ‘yellow’) ;
[Link](‘button’).[Link] = ‘red’ ;
[Link](‘h1’).forEach(titre => {
[Link] = ‘black’ ;
[Link] = ‘white’ ;
}) ;
[Link] = ‘1’ ;
}, 1000) ;
// Stocker le choix du thème dans un cookie
Function setCookie(cname, cvalue, exdays) {
Const d = new Date() ;
[Link]([Link]() + (exdays * 24 * 60 * 60 * 1000)) ;
const expires = « expires= »+[Link]() ;
[Link] = cname + « = » + cvalue + « ; » + expires + « ;path=/ » ;
Function getCookie(cname) {
Const name = cname + « = » ;
Const decodedCookie = decodeURIComponent([Link]) ;
Const ca = [Link](‘ ;’) ;
For(let i = 0 ; i <[Link] ; i++) {
Let c = ca[i] ;
While ([Link](0) == ‘ ‘) {
C = [Link](1) ;
If ([Link](name) == 0) {
Return [Link]([Link], [Link]) ;
Return « « ;
If ( !getCookie(« theme »)) {
setCookie(« theme », « white », 365) ;
If (getCookie(« theme ») === « dark ») {
changerTheme() ;
// Animation d’apparition des titres
[Link](‘.titre’).[Link] = ‘0’ ;
[Link](‘.titre’).[Link] = ‘opacity 1s’ ;
[Link](‘.titre’).[Link] = ‘1’ ;
// Animation de disparition des titres par opacité
[Link](‘.titre’).[Link] = ‘0’ ;
// Animation de disparition par opacité de la page actuelle et d’apparition de la suivante
Function changerTheme() {
[Link] = ‘0’ ;
setTimeout(() => {
if ([Link] === ‘white’) {
[Link] = ‘black’ ;
[Link] = ‘white’ ;
[Link](‘.formulaire’).[Link] = ‘yellow’ ;
[Link](‘input’).forEach(input => [Link] = ‘red’) ;
[Link](‘button’).[Link] = ‘yellow’ ;
[Link](‘h1’).forEach(titre => {
[Link] = ‘white’ ;
[Link] = ‘green’ ;
}) ;
} else {
[Link] = ‘white’ ;
[Link] = ‘black’ ;
[Link](‘.formulaire’).[Link] = ‘green’ ;
[Link](‘input’).forEach(input => [Link] = ‘yellow’) ;
[Link](‘button’).[Link] = ‘red’ ;
[Link](‘h1’).forEach(titre => {
[Link] = ‘black’ ;
[Link] = ‘white’ ;
}) ;
[Link] = ‘1’ ;
}, 1000) ;
// Stocker le choix du thème dans un cookie
Function setCookie(cname, cvalue, exdays) {
Const d = new Date() ;
[Link]([Link]() + (exdays * 24 * 60 * 60 * 1000)) ;
const expires = « expires= »+[Link]() ;
[Link] = cname + « = » + cvalue + « ; » + expires + « ;path=/ » ;
Function getCookie(cname) {
Const name = cname + « = » ;
Const decodedCookie = decodeURIComponent([Link]) ;
Const ca = [Link](‘ ;’) ;
For(let i = 0 ; i <[Link] ; i++) {
Let c = ca[i] ;
While ([Link](0) == ‘ ‘) {
C = [Link](1) ;
If ([Link](name) == 0) {
Return [Link]([Link], [Link]) ;
}
Return « « ;
If ( !getCookie(« theme »)) {
setCookie(« theme », « white », 365) ;
If (getCookie(« theme ») === « dark ») {
changerTheme() ;
// Animation d’apparition des titres
[Link](‘.titre’).[Link] = ‘0’ ;
[Link](‘.titre’).[Link] = ‘opacity 1s’ ;
[Link](‘.titre’).[Link] = ‘1’ ;
// Animation de disparition des titres par opacité
[Link](‘.titre’).[Link] = ‘0’ ;
// Animation de disparition par opacité de la page actuelle et d’apparition de la suivante
Function changerTheme() {
[Link] = ‘0’ ;
setTimeout(() => {
if ([Link] === ‘white’) {
[Link] = ‘black’ ;
[Link] = ‘white’ ;
[Link](‘.formulaire’).[Link] = ‘yellow’ ;
[Link](‘input’).forEach(input => [Link] = ‘red’) ;
[Link](‘button’).[Link] = ‘yellow’ ;
[Link](‘h1’).forEach(titre => {
[Link] = ‘white’ ;
[Link] = ‘green’ ;
}) ;
} else {
[Link] = ‘white’ ;
[Link] = ‘black’ ;
[Link](‘.formulaire’).[Link] = ‘green’ ;
[Link](‘input’).forEach(input => [Link] = ‘yellow’) ;
[Link](‘button’).[Link] = ‘red’ ;
[Link](‘h1’).forEach(titre => {
[Link] = ‘black’ ;
[Link] = ‘white’ ;
}) ;
[Link] = ‘1’ ;
}, 1000) ;
// Stocker le choix du thème dans un cookie
Function setCookie(cname, cvalue, exdays) {
Const d = new Date() ;
[Link]([Link]() + (exdays * 24 * 60 * 60 * 1000)) ;
const expires = « expires= »+[Link]() ;
[Link] = cname + « = » + cvalue + « ; » + expires + « ;path=/ » ;
Function getCookie(cname) {
Const name = cname + « = » ;
Const decodedCookie = decodeURIComponent([Link]) ;
Const ca = [Link](‘ ;’) ;
For(let i = 0 ; i <[Link] ; i++) {
Let c = ca[i] ;
While ([Link](0) == ‘ ‘) {
C = [Link](1) ;
If ([Link](name) == 0) {
Return [Link]([Link], [Link]) ;
Return « « ;
If ( !getCookie(« theme »)) {
setCookie(« theme », « white », 365) ;
If (getCookie(« theme ») === « dark ») {
changerTheme() ;