File tree 4 files changed +64
-0
lines changed
4 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 13
13
{{ with $script.js }}
14
14
< script src ="{{ relURL . }} "> </ script >
15
15
{{ end }}
16
+ < script >
17
+ const d = new Date ( ) ;
18
+ // Show April Fools' joke
19
+ if ( d . getMonth ( ) === 3 && d . getDate ( ) === 1 ) {
20
+ $ . getScript ( "/js/april.js" ) ;
21
+ }
22
+ </ script >
16
23
</ body >
17
24
</ html >
Original file line number Diff line number Diff line change
1
+
2
+ ( async function ( $ ) {
3
+
4
+ $ ( "body" ) . append ( "<a href='#' id='disable-spotlight' class='btn dark'>Désactiver le mode sombre</a><div id='spotlight'></div>" ) ;
5
+
6
+ const spotlightEl = $ ( "#spotlight" ) ;
7
+
8
+ function handleMouseMove ( event ) {
9
+ const { clientX, clientY} = event ;
10
+
11
+ spotlightEl [ 0 ] . style . background = `radial-gradient(circle at ${ clientX } px ${ clientY } px, #00000000 10px, #000000FF 100px)` ;
12
+ }
13
+
14
+ $ ( "body" ) . on ( "mousemove" , handleMouseMove ) ;
15
+
16
+ $ ( "#disable-spotlight" ) . on ( "click" , ( ) => {
17
+ disableApril ( ) ;
18
+ localStorage . setItem ( "disable-april" , "true" ) ;
19
+ } ) ;
20
+
21
+ if ( localStorage . getItem ( "disable-april" ) === "true" ) {
22
+ disableApril ( ) ;
23
+ }
24
+
25
+ function disableApril ( ) {
26
+ $ ( "#spotlight" ) [ 0 ] . style . display = "none" ;
27
+ $ ( "#disable-spotlight" ) [ 0 ] . style . display = "none" ;
28
+ $ ( "body" ) . off ( "mousemove" , handleMouseMove ) ;
29
+ }
30
+ } ) ( jQuery ) ;
Original file line number Diff line number Diff line change
1
+
2
+
3
+ #spotlight {
4
+ position : fixed ;
5
+ background : black ;
6
+ opacity : 1 ;
7
+ width : 100vw ;
8
+ height : 100vh ;
9
+ top : 0 ;
10
+ left : 0 ;
11
+ z-index : 1000 ;
12
+ pointer-events : none ;
13
+ @media screen and (max-width : 1024px ) {
14
+ display : none ;
15
+ }
16
+ }
17
+
18
+ #disable-spotlight {
19
+ position : fixed ;
20
+ z-index : 999 ;
21
+ right : 50px ;
22
+ bottom : 20px ;
23
+ @media screen and (max-width : 1024px ) {
24
+ display : none ;
25
+ }
26
+ }
Original file line number Diff line number Diff line change 18
18
@import ' swiper' ;
19
19
@import ' legals' ;
20
20
@import ' cloud' ;
21
+ @import ' april' ;
21
22
22
23
:root {
23
24
scroll-behavior : smooth ;
You can’t perform that action at this time.
0 commit comments