|
1 | 1 | <% |
2 | | - const toolClass = "mb-1 flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-2xl border border-rd-gray-alpha-400 bg-rd-background-100 text-lg text-rd-gray-1000 shadow-rd last:mb-0 hover:!bg-primary hover:!text-rd-primary-text sm:size-11 sm:text-xl [&_i]:!text-inherit"; |
| 2 | + const toolClass = "flex size-10 shrink-0 items-center justify-center rounded-2xl border border-rd-gray-alpha-400 bg-rd-background-100 text-lg text-rd-gray-1000 shadow-rd hover:!bg-primary hover:!text-rd-primary-text sm:size-11 sm:text-xl [&_i]:!text-inherit"; |
3 | 3 | %> |
4 | | -<div> |
5 | | - <div id="side-tools-menu" data-state="closed" class="translate-x-full opacity-0 transition-[transform,opacity] duration-200 ease-in-out data-[state=open]:translate-x-0 data-[state=open]:opacity-100"> |
6 | | - <button id="theme-toggle" data-side-tool type="button" class="<%= toolClass %>" aria-label="<%= __('theme') %>" title="<%= __('theme') %>"> |
7 | | - <i class="fa-regular fa-moon" aria-hidden="true"></i> |
8 | | - </button> |
| 4 | +<div class="flex flex-col items-end gap-1"> |
| 5 | + <div class="relative"> |
| 6 | + <div id="side-tools-menu" data-state="closed" aria-hidden="true" class="invisible absolute right-0 bottom-full mb-1 flex flex-col gap-1 opacity-0 pointer-events-none transition-opacity duration-200 ease-in-out data-[state=open]:visible data-[state=open]:opacity-100 data-[state=open]:pointer-events-auto motion-reduce:transition-none"> |
| 7 | + <button id="theme-toggle" data-side-tool type="button" class="<%= toolClass %>" aria-label="<%= __('theme') %>" title="<%= __('theme') %>"> |
| 8 | + <i class="fa-regular fa-moon" aria-hidden="true"></i> |
| 9 | + </button> |
9 | 10 |
|
10 | | - <% if (theme.plugins.feed.enable && config.feed) { %> |
11 | | - <a data-side-tool class="<%= toolClass %>" href="<%= url_for(config.feed.path) %>" target="_blank" rel="noopener noreferrer" aria-label="<%= __('rss_feed') %>" title="<%= __('rss_feed') %>"> |
12 | | - <i class="fa-regular fa-rss" aria-hidden="true"></i> |
13 | | - </a> |
14 | | - <% } %> |
| 11 | + <% if (theme.plugins.feed.enable && config.feed) { %> |
| 12 | + <a data-side-tool class="<%= toolClass %>" href="<%= url_for(config.feed.path) %>" target="_blank" rel="noopener noreferrer" aria-label="<%= __('rss_feed') %>" title="<%= __('rss_feed') %>"> |
| 13 | + <i class="fa-regular fa-rss" aria-hidden="true"></i> |
| 14 | + </a> |
| 15 | + <% } %> |
15 | 16 |
|
16 | | - <% if (theme.global.scroll_progress.percentage !== true) { %> |
17 | | - <button id="scroll-top" data-side-tool type="button" class="<%= toolClass %>" aria-label="<%= __('top') %>" title="<%= __('top') %>"> |
18 | | - <i class="fa-regular fa-arrow-up" aria-hidden="true"></i> |
19 | | - </button> |
20 | | - <% } %> |
| 17 | + <% if (theme.global.scroll_progress.percentage !== true) { %> |
| 18 | + <button id="scroll-top" data-side-tool type="button" class="<%= toolClass %>" aria-label="<%= __('top') %>" title="<%= __('top') %>"> |
| 19 | + <i class="fa-regular fa-arrow-up" aria-hidden="true"></i> |
| 20 | + </button> |
| 21 | + <% } %> |
21 | 22 |
|
22 | | - <button id="scroll-bottom" data-side-tool type="button" class="<%= toolClass %>" aria-label="Bottom" title="Bottom"> |
23 | | - <i class="fa-regular fa-arrow-down" aria-hidden="true"></i> |
24 | | - </button> |
25 | | - </div> |
| 23 | + <button id="scroll-bottom" data-side-tool type="button" class="<%= toolClass %>" aria-label="Bottom" title="Bottom"> |
| 24 | + <i class="fa-regular fa-arrow-down" aria-hidden="true"></i> |
| 25 | + </button> |
| 26 | + </div> |
26 | 27 |
|
27 | | - <div> |
28 | 28 | <button id="side-tools-toggle" data-side-tool type="button" class="<%= toolClass %>" aria-controls="side-tools-menu" aria-expanded="false" aria-label="Tools" title="Tools"> |
29 | 29 | <i class="fa-regular fa-cog <% if (theme.global.side_tools && theme.global.side_tools.gear_rotation !== false) { %>fa-spin<% } %>" aria-hidden="true"></i> |
30 | 30 | </button> |
31 | | - <% if (theme.global.scroll_progress.percentage === true) { %> |
32 | | - <button id="scroll-top" data-side-tool type="button" data-state="hidden" class="group <%= toolClass %> data-[state=hidden]:hidden" aria-label="<%= __('top') %>" title="<%= __('top') %>"> |
33 | | - <i data-scroll-arrow class="fas fa-arrow-up !hidden group-hover:!flex" aria-hidden="true"></i> |
34 | | - <span data-scroll-percent class="flex text-base group-hover:!hidden"></span> |
35 | | - </button> |
36 | | - <% } %> |
37 | | - <% if (theme.plugins.aplayer.enable && theme.plugins.aplayer.type === "mini") { %> |
38 | | - <div class="hidden md:block"> |
39 | | - <div data-side-tool class="<%= toolClass %>" aria-hidden="true"></div> |
40 | | - </div> |
41 | | - <% } %> |
42 | 31 | </div> |
| 32 | + |
| 33 | + <% if (theme.global.scroll_progress.percentage === true) { %> |
| 34 | + <button id="scroll-top" data-side-tool type="button" data-state="hidden" class="group <%= toolClass %> data-[state=hidden]:hidden" aria-label="<%= __('top') %>" title="<%= __('top') %>"> |
| 35 | + <i data-scroll-arrow class="fas fa-arrow-up !hidden group-hover:!flex" aria-hidden="true"></i> |
| 36 | + <span data-scroll-percent class="flex text-base group-hover:!hidden"></span> |
| 37 | + </button> |
| 38 | + <% } %> |
| 39 | + |
| 40 | + <% if (theme.plugins.aplayer.enable && theme.plugins.aplayer.type === "mini") { %> |
| 41 | + <div class="hidden size-10 sm:size-11 md:block" aria-hidden="true"></div> |
| 42 | + <% } %> |
43 | 43 | </div> |
0 commit comments