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>
<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} />
</>
);

View File

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

View File

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

View File

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

View File

@@ -238,5 +238,9 @@
{
"name": "offlineMode",
"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');
if (css) {
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};
--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);
}
.textBorder {
filter: drop-shadow(var(--shadow-shift) var(--shadow-shift) 0 #111111CC);
}
::placeholder {
color: map-get($theme-colours, 'main');
opacity: 1;