New feature: cloak mode
This commit is contained in:
parent
472e1c8e22
commit
4281a91e48
|
@ -208,6 +208,12 @@ function App() {
|
|||
}
|
||||
}, [snapStates.settings.shortcutsViewMode]);
|
||||
|
||||
// Add/Remove cloak class to body
|
||||
useEffect(() => {
|
||||
const $body = document.body;
|
||||
$body.classList.toggle('cloak', snapStates.settings.cloakMode);
|
||||
}, [snapStates.settings.cloakMode]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Routes location={nonRootLocation || location}>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
body.cloak .name-text,
|
||||
body.cloak .status .content-container,
|
||||
body.cloak .account-container :is(header, main > *:not(.actions)) {
|
||||
body.cloak .account-container :is(header, main > *:not(.actions)),
|
||||
body.cloak .header-account,
|
||||
body.cloak .account-block {
|
||||
text-decoration-thickness: 1.1em;
|
||||
text-decoration-line: line-through;
|
||||
text-rendering: optimizeSpeed;
|
||||
|
|
|
@ -259,6 +259,18 @@ function Settings({ onClose }) {
|
|||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={snapStates.settings.cloakMode}
|
||||
onChange={(e) => {
|
||||
states.settings.cloakMode = e.target.checked;
|
||||
}}
|
||||
/>{' '}
|
||||
Cloak mode
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
type="button"
|
||||
|
|
|
@ -51,6 +51,7 @@ const states = proxy({
|
|||
store.account.get('settings-contentTranslationTargetLanguage') || null,
|
||||
contentTranslationHideLanguages:
|
||||
store.account.get('settings-contentTranslationHideLanguages') || [],
|
||||
cloakMode: store.account.get('settings-cloakMode') ?? false,
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -88,6 +89,9 @@ subscribe(states, (changes) => {
|
|||
if (path?.[0] === 'shortcuts') {
|
||||
store.account.set('shortcuts', states.shortcuts);
|
||||
}
|
||||
if (path.join('.') === 'settings.cloakMode') {
|
||||
store.account.set('settings-cloakMode', !!value);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue