re-add theme as ptrs broken fixed ipad theme
This commit is contained in:
@@ -1,20 +1,38 @@
|
||||
<section class="w-full">
|
||||
@include('partials.settings-heading')
|
||||
|
||||
<x-settings.layout :heading="__('Appearance')" :subheading="__('Update the appearance settings for your account')">
|
||||
<div class="hd-native-appearance" data-hd-appearance>
|
||||
<button type="button" data-hd-appearance-value="light" onclick="window.HDTheme && window.HDTheme.set('light')" aria-pressed="false">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 7a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0-5h1v3h-2V2h1zm0 17h1v3h-2v-3h1zM2 11h3v2H2v-2zm17 0h3v2h-3v-2zM4.2 5.6l1.4-1.4 2.1 2.1-1.4 1.4-2.1-2.1zm12.1 12.1 1.4-1.4 2.1 2.1-1.4 1.4-2.1-2.1zM4.2 18.4l2.1-2.1 1.4 1.4-2.1 2.1-1.4-1.4zM16.3 6.3l2.1-2.1 1.4 1.4-2.1 2.1-1.4-1.4z"/></svg>
|
||||
<span>{{ __('Light') }}</span>
|
||||
<flux:heading class="sr-only">{{ __('Appearance settings') }}</flux:heading>
|
||||
|
||||
<x-settings.layout :heading="__('Appearance')" :subheading=" __('Update the appearance settings for your account')">
|
||||
<div class="hd-appearance-switch" role="group" aria-label="{{ __('Appearance') }}">
|
||||
<button type="button" data-hd-appearance-value="light" onclick="if(window.hdSetAppearance){window.hdSetAppearance('light')}" class="hd-appearance-choice">
|
||||
<i class="fa-regular fa-sun" aria-hidden="true"></i><span>{{ __('Light') }}</span>
|
||||
</button>
|
||||
<button type="button" data-hd-appearance-value="dark" onclick="window.HDTheme && window.HDTheme.set('dark')" aria-pressed="false">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M20.2 15.2A8 8 0 0 1 8.8 3.8 9 9 0 1 0 20.2 15.2z"/></svg>
|
||||
<span>{{ __('Dark') }}</span>
|
||||
<button type="button" data-hd-appearance-value="dark" onclick="if(window.hdSetAppearance){window.hdSetAppearance('dark')}" class="hd-appearance-choice">
|
||||
<i class="fa-regular fa-moon" aria-hidden="true"></i><span>{{ __('Dark') }}</span>
|
||||
</button>
|
||||
<button type="button" data-hd-appearance-value="system" onclick="window.HDTheme && window.HDTheme.set('system')" aria-pressed="false">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 4h18v13H3V4zm2 2v9h14V6H5zm4 13h6v2H9v-2z"/></svg>
|
||||
<span>{{ __('System') }}</span>
|
||||
<button type="button" data-hd-appearance-value="system" onclick="if(window.hdSetAppearance){window.hdSetAppearance('system')}" class="hd-appearance-choice">
|
||||
<i class="fa-solid fa-desktop" aria-hidden="true"></i><span>{{ __('System') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
function sync() {
|
||||
var value = document.documentElement.getAttribute('data-hd-appearance') || 'system';
|
||||
var buttons = document.querySelectorAll('[data-hd-appearance-value]');
|
||||
for (var i = 0; i < buttons.length; i++) {
|
||||
if (buttons[i].getAttribute('data-hd-appearance-value') === value) buttons[i].classList.add('is-active');
|
||||
else buttons[i].classList.remove('is-active');
|
||||
}
|
||||
}
|
||||
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', sync, false); else sync();
|
||||
document.addEventListener('click', function (event) {
|
||||
var target = event.target;
|
||||
while (target && target !== document && !target.getAttribute('data-hd-appearance-value')) target = target.parentNode;
|
||||
if (target && target.getAttribute) setTimeout(sync, 0);
|
||||
}, false);
|
||||
document.addEventListener('livewire:navigated', sync, false);
|
||||
}());
|
||||
</script>
|
||||
</x-settings.layout>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user