feat: add no animations setting back, text shadow/border option

This commit is contained in:
David Ralph
2021-08-25 12:01:48 +01:00
parent 3ed2171a34
commit 4a4e4604e8
8 changed files with 42 additions and 0 deletions

View File

@@ -55,6 +55,8 @@ export default function AppearanceSettings() {
</Dropdown> </Dropdown>
<h3>{appearance.accessibility.title}</h3> <h3>{appearance.accessibility.title}</h3>
<Checkbox text='Widget Text Border' name='textBorder' category='other'/>
<Checkbox text='Animations' name='animations' category='other'/>
<Slider title={appearance.accessibility.toast_duration} name='toastDisplayTime' default='2500' step='100' min='500' max='5000' toast={true} display={' ' + appearance.accessibility.milliseconds} /> <Slider title={appearance.accessibility.toast_duration} name='toastDisplayTime' default='2500' step='100' min='500' max='5000' toast={true} display={' ' + appearance.accessibility.milliseconds} />
</> </>
); );

View File

@@ -3,4 +3,5 @@
font-size: 1.6em; font-size: 1.6em;
cursor: initial; cursor: initial;
user-select: none; user-select: none;
--shadow-shift: 0.2rem;
} }

View File

@@ -5,6 +5,7 @@
text-shadow: 0 0 10px rgba(0, 0, 0, 0.3); text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
cursor: initial; cursor: initial;
user-select: none; user-select: none;
--shadow-shift: 0.125rem;
} }
@media screen and (min-width: 600px) { @media screen and (min-width: 600px) {
@@ -18,6 +19,7 @@
font-size: 0.9em; font-size: 0.9em;
letter-spacing: 0.5px; letter-spacing: 0.5px;
user-select: none; user-select: none;
--shadow-shift: 0.125rem;
svg { svg {
margin-left: 10px; margin-left: 10px;

View File

@@ -5,6 +5,7 @@
margin: 0; margin: 0;
cursor: initial; cursor: initial;
user-select: none; user-select: none;
--shadow-shift: 0.4rem;
} }
.ampm { .ampm {

View File

@@ -238,5 +238,9 @@
{ {
"name": "offlineMode", "name": "offlineMode",
"value": false "value": false
},
{
"name": "animations",
"value": true
} }
] ]

View File

@@ -57,6 +57,28 @@ export function loadSettings(hotreload) {
}); });
} }
if (localStorage.getItem('animations') === 'false') {
document.body.classList.add('no-animations');
} else {
document.body.classList.remove('no-animations');
}
if (localStorage.getItem('textBorder') === 'true') {
const elements = ['greeting', 'clock', 'quote', 'quoteauthor'];
elements.forEach((element) => {
try {
document.querySelector('.' + element).classList.add('textBorder')
} catch (e) {}
});
} else {
const elements = ['greeting', 'clock', 'quote', 'quoteauthor'];
elements.forEach((element) => {
try {
document.querySelector('.' + element).classList.remove('textBorder')
} catch (e) {}
});
}
const css = localStorage.getItem('customcss'); const css = localStorage.getItem('customcss');
if (css) { if (css) {
document.head.insertAdjacentHTML('beforeend', '<style id="customcss">' + css + '</style>'); document.head.insertAdjacentHTML('beforeend', '<style id="customcss">' + css + '</style>');

View File

@@ -35,3 +35,9 @@ $modal-link-dark: map-get($modal, 'modal-link-dark');
--photo-info: #{$photo-info-dark}; --photo-info: #{$photo-info-dark};
--modal-link: #{$modal-link-dark}; --modal-link: #{$modal-link-dark};
} }
.no-animations {
.ReactModal__Content, button, svg, input[type=text], .MuiSwitch-switchBase {
transition: none !important;
}
}

View File

@@ -34,6 +34,10 @@ body {
text-shadow: 0 0 25px rgba(0, 0, 0, 0.3); text-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
} }
.textBorder {
filter: drop-shadow(var(--shadow-shift) var(--shadow-shift) 0 #111111CC);
}
::placeholder { ::placeholder {
color: map-get($theme-colours, 'main'); color: map-get($theme-colours, 'main');
opacity: 1; opacity: 1;