This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const preload = src => new Promise(function(resolve, reject) { | |
const img = new Image(); | |
img.onload = function() { | |
resolve(img); | |
} | |
img.onerror = reject; | |
img.src = src; | |
}); | |
const preloadAll = sources => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts" setup> | |
import { type Ref, onMounted, ref } from 'vue' | |
const selectors = 'a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])' | |
const wrapper: Ref<HTMLElement | undefined> = ref() | |
const focusableEls: Ref<Array<HTMLElement>> = ref([]) | |
const firstFocusableEl: Ref<HTMLElement | undefined> = ref() | |
const lastFocusableEl: Ref<HTMLElement | undefined> = ref() | |
function handleBackwardMove(event: KeyboardEvent): void { |