File tree Expand file tree Collapse file tree 8 files changed +97
-5
lines changed
Expand file tree Collapse file tree 8 files changed +97
-5
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ if (isExtension) {
7272 }
7373
7474 chrome . storage . local . get ( { ...extensionSettings } , function ( items ) {
75+ if ( ! items . animations ) {
76+ document . body . classList . add ( "no-animations" )
77+ }
78+
7579 // Start by setting language
7680 setLocale ( items . language )
7781 const defaultTime = translate ( items . language , "time.format.default" )
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ function saveOptions(message, css="") {
3232
3333 chrome . storage . local . set ( {
3434 language : document . getElementById ( "language" ) . value ,
35+ animations : document . getElementById ( "animations" ) . checked ,
3536 custombg : custombg ,
3637 show_time : document . getElementById ( "show_time" ) . checked ,
3738 show_date : document . getElementById ( "show_date" ) . checked ,
@@ -86,6 +87,10 @@ function restoreOptions() {
8687 language . value = items . language
8788 language . onchange = ( ) => { saveOptions ( `Language changed: ${ language . value || "default" } ` , "change" ) }
8889
90+ const animations = document . getElementById ( "animations" )
91+ animations . checked = items . animations
92+ animations . onchange = ( ) => { saveOptions ( `Animations set: ${ animations . checked } ` , animations . checked ? "add" : "remove" ) }
93+
8994 const showTime = document . getElementById ( "show_time" )
9095 showTime . checked = items . show_time
9196 showTime . onchange = ( ) => { saveOptions ( `Show time set: ${ showTime . checked } ` , showTime . checked ? "add" : "remove" ) }
Original file line number Diff line number Diff line change 33export const extensionSettings = {
44 language : "" ,
55 searchbar : false ,
6+ animations : true ,
67 custombg : [ ] ,
78 show_time : true ,
89 show_date : true ,
Original file line number Diff line number Diff line change 44 "name" : " AlexFlipnote/Homepage" ,
55 "description" : " A website that gives you a clean homepage." ,
66 "homepage_url" : " https://alexflipnote.dev/homepage/" ,
7- "version" : " 2.4.2 " ,
7+ "version" : " 2.4.3 " ,
88
99 "chrome_url_overrides" : {
1010 "newtab" : " index.html"
Original file line number Diff line number Diff line change @@ -22,10 +22,15 @@ <h1 class="no-margin">General settings</h1>
2222 < option value =""> Default: English (United Kingdom)</ option >
2323 </ select >
2424 </ label >
25- < label > < input type ="checkbox " id ="show-settings "> Show settings button</ label >
26- < label > < input type ="checkbox " id ="searchbar "> Show search bar</ label >
27- < label > < input type ="checkbox " id ="show_time "> Show time</ label >
28- < label > < input type ="checkbox " id ="show_date "> Show date</ label >
25+ < div class ="flex-grid ">
26+ < div class ="col-xs ">
27+ < label > < input type ="checkbox " id ="show-settings "> Show settings button</ label >
28+ < label > < input type ="checkbox " id ="searchbar "> Show search bar</ label >
29+ < label > < input type ="checkbox " id ="show_time "> Show time</ label >
30+ < label > < input type ="checkbox " id ="show_date "> Show date</ label >
31+ < label > < input type ="checkbox " id ="animations "> Enable animations</ label >
32+ </ div >
33+ </ div >
2934 </ div >
3035
3136 < div class ="box-container ">
Original file line number Diff line number Diff line change 1+ @use " sass:list" ;
2+
3+ $grid-list : (
4+ 8.33% , 16.66% , 25% ,
5+ 33.33% , 41.66% , 50% ,
6+ 58.33% , 66.66% , 75% ,
7+ 83.33% , 91.66% , 100%
8+ );
9+
10+ .container {
11+ box-sizing : border-box ;
12+ margin : 0 auto ;
13+ max-width : 1100px ;
14+ padding : 0 2em ;
15+ padding-top : 1.5em ;
16+ position : relative ;
17+ width : 100% ;
18+ }
19+
20+ .flex-grid {
21+ $default-width : .5rem ;
22+ box-sizing : border-box ;
23+ display : flex ;
24+ flex : 0 1 auto ;
25+ flex-direction : row ;
26+ flex-wrap : wrap ;
27+
28+ & .column { flex-direction : column ; }
29+ & .row { flex-direction : row ; }
30+
31+ .col-xs ,
32+ .col-xs-1 , .col-xs-2 , .col-xs-3 ,
33+ .col-xs-4 , .col-xs-5 , .col-xs-6 ,
34+ .col-xs-7 , .col-xs-8 , .col-xs-9 ,
35+ .col-xs-10 , .col-xs-11 , .col-xs-12 {
36+ box-sizing : border-box ;
37+ flex : 0 0 auto ;
38+ padding-left : $default-width ;
39+ padding-right : $default-width ;
40+ }
41+
42+ [class ^= " col-xs" ] {
43+ & :first-child { padding-left : 0 ; }
44+ & :last-child { padding-right : 0 ; }
45+ }
46+
47+ .col-xs {
48+ flex-basis : 0 ;
49+ flex-grow : 1 ;
50+ max-width : 100% ;
51+ }
52+
53+ @each $g in $grid-list {
54+ $i : list .index ($grid-list , $g );
55+
56+ .col-xs-#{$i } {
57+ flex-basis : $g ;
58+ max-width : $g ;
59+ }
60+ }
61+ }
Original file line number Diff line number Diff line change @@ -253,6 +253,18 @@ body {
253253 -webkit-user-select : none ;
254254}
255255
256+ .no-animations {
257+ .time-container ,
258+ #search-form ,
259+ #weather-container ,
260+ #bookmarks ,
261+ #background {
262+ animation : none !important ;
263+ transition : none !important ;
264+ opacity : 1 !important ;
265+ }
266+ }
267+
256268.no-overflow { overflow : hidden ; }
257269.no-margin { margin : 0 ; }
258270.no-padding { padding : 0 ; }
@@ -269,3 +281,4 @@ body {
269281.warning-bg { background-color : var (--warning ) !important ; }
270282.error-bg { background-color : var (--error ) !important ; }
271283.grey-bg { background-color : var (--grey ) !important ; }
284+
Original file line number Diff line number Diff line change 1111@use " components/settings" ;
1212@use " components/timestamp" ;
1313@use " components/weather" ;
14+
15+ // Utils
16+ @use " components/container" ;
You can’t perform that action at this time.
0 commit comments