move theme toggle to own Vue app for better tab order

Relocate the light/dark toggle button out of #app1 and into a new
#app3 mount just before the back-to-top element so keyboard focus
reaches it near the end of the page instead of right after the main
nav. Replace the library logo's reactive :src binding with a plain
src plus data-light-src/data-dark-src so app1 no longer needs any
theme state; app3 now owns toggleTheme, overlay updates, logo swap,
and the OS preference listener.
This commit is contained in:
Mark Eaton
2026-04-13 11:53:20 -04:00
parent ac12d21cac
commit dfbe8875f5
2 changed files with 65 additions and 59 deletions
+13 -9
View File
@@ -80,7 +80,9 @@
id="library-logo"
class="image-fail"
alt="Kibbee Library logo"
:src="isDark ? 'https://d2jv02qf7xgjwx.cloudfront.net/accounts/16298/images/Kibbee_library_logo_inverted2.jpg' : 'https://libapps.s3.amazonaws.com/accounts/16298/images/xsmall-2.jpg'"
src="https://libapps.s3.amazonaws.com/accounts/16298/images/xsmall-2.jpg"
data-light-src="https://libapps.s3.amazonaws.com/accounts/16298/images/xsmall-2.jpg"
data-dark-src="https://d2jv02qf7xgjwx.cloudfront.net/accounts/16298/images/Kibbee_library_logo_inverted2.jpg"
/>
{{content_box_33471502}}
</div>
@@ -94,14 +96,6 @@
<!-- end of col-xs-12 -->
</div>
<!--end of row-->
<button
id="theme-toggle"
@click="toggleTheme"
:aria-label="isDark ? 'Switch to light mode' : 'Switch to dark mode'"
type="button"
>
<i :class="isDark ? 'fas fa-sun' : 'fas fa-moon'" aria-hidden="true"></i>
</button>
</div>
<!--end of Vue app1-->
</div>
@@ -369,6 +363,16 @@
<i class="fas fa-sync fa-spin" aria-hidden="true"></i> Loading...
<button class="btn btn-secondary btn-sm popclose" type="button">Close</button>
</div>
<div id="app3">
<button
id="theme-toggle"
@click="toggleTheme"
:aria-label="isDark ? 'Switch to light mode' : 'Switch to dark mode'"
type="button"
>
<i :class="isDark ? 'fas fa-sun' : 'fas fa-moon'" aria-hidden="true"></i>
</button>
</div>
<div id="s-lib-scroll-top" title="Back to Top">
<span class="fa-stack fa-lg" aria-hidden="true">
<i class="far fa-square fa-stack-2x"></i>