|
| 1 | +<script> |
| 2 | + import { themes } from '$lib/themes'; |
| 3 | + import { themeChange } from 'theme-change'; |
| 4 | +
|
| 5 | + $effect(() => { |
| 6 | + themeChange(false); |
| 7 | + }); |
| 8 | +</script> |
| 9 | + |
| 10 | +<div class="dropdown dropdown-end"> |
| 11 | + <div tabindex="0" class="btn gap-1 normal-case btn-ghost"> |
| 12 | + <svg |
| 13 | + width="20" |
| 14 | + height="20" |
| 15 | + xmlns="http://www.w3.org/2000/svg" |
| 16 | + fill="none" |
| 17 | + viewBox="0 0 24 24" |
| 18 | + class="inline-block h-5 w-5 stroke-current md:h-6 md:w-6"> |
| 19 | + <path |
| 20 | + stroke-linecap="round" |
| 21 | + stroke-linejoin="round" |
| 22 | + stroke-width="2" |
| 23 | + d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01" /> |
| 24 | + </svg> |
| 25 | + <svg |
| 26 | + width="12px" |
| 27 | + height="12px" |
| 28 | + class="ml-1 hidden h-3 w-3 fill-current opacity-60 sm:inline-block" |
| 29 | + xmlns="http://www.w3.org/2000/svg" |
| 30 | + viewBox="0 0 2048 2048"> |
| 31 | + <path d="M1799 349l242 241-1017 1017L7 590l242-241 775 775 775-775z" /> |
| 32 | + </svg> |
| 33 | + </div> |
| 34 | + <div |
| 35 | + tabindex="0" |
| 36 | + class="dropdown-content bg-base-200 text-base-content rounded-t-box rounded-b-box top-px max-h-96 h-[70vh] w-60 overflow-y-auto shadow-2xl mt-16"> |
| 37 | + <div class="grid grid-cols-1 gap-3 p-3"> |
| 38 | + {#each themes as theme} |
| 39 | + <div |
| 40 | + class="outline-base-content overflow-hidden rounded-lg outline-2 outline-offset-2 hover:outline" |
| 41 | + data-set-theme={theme.id} |
| 42 | + data-act-class="[&_svg]:visible"> |
| 43 | + <div |
| 44 | + data-theme={theme.id} |
| 45 | + class="bg-base-100 text-base-content w-full cursor-pointer font-sans"> |
| 46 | + <div class="grid grid-cols-5 grid-rows-3"> |
| 47 | + <div class="col-span-5 row-span-3 row-start-1 flex gap-1 py-3 px-4"> |
| 48 | + <svg |
| 49 | + xmlns="http://www.w3.org/2000/svg" |
| 50 | + width="16" |
| 51 | + height="16" |
| 52 | + viewBox="0 0 24 24" |
| 53 | + fill="currentColor" |
| 54 | + class="invisible h-3 w-3 shrink-0 mt-1"> |
| 55 | + <path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z" /> |
| 56 | + </svg> |
| 57 | + <div class="flex-grow text-sm font-bold">{theme.name}</div> |
| 58 | + <div class="flex flex-shrink-0 flex-wrap gap-1"> |
| 59 | + <div class="bg-primary w-2 rounded" /> |
| 60 | + <div class="bg-secondary w-2 rounded" /> |
| 61 | + <div class="bg-accent w-2 rounded" /> |
| 62 | + <div class="bg-neutral w-2 rounded" /> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + </div> |
| 66 | + </div> |
| 67 | + </div> |
| 68 | + {/each} |
| 69 | + </div> |
| 70 | + </div> |
| 71 | +</div> |
0 commit comments