Archipelago — open-source initial import

This commit is contained in:
Archipelago
2026-08-12 10:55:50 +00:00
commit b67e1527a2
2068 changed files with 472303 additions and 0 deletions
@@ -0,0 +1,33 @@
import { ref, computed, onMounted, onUnmounted } from 'vue'
export function useLandscape() {
const windowWidth = ref(window.innerWidth)
const windowHeight = ref(window.innerHeight)
const isLandscape = computed(() => windowWidth.value > windowHeight.value)
const isMobile = computed(() => Math.min(windowWidth.value, windowHeight.value) < 768)
const isMobileLandscape = computed(() => isMobile.value && isLandscape.value)
function onResize() {
windowWidth.value = window.innerWidth
windowHeight.value = window.innerHeight
}
onMounted(() => {
window.addEventListener('resize', onResize)
window.addEventListener('orientationchange', onResize)
})
onUnmounted(() => {
window.removeEventListener('resize', onResize)
window.removeEventListener('orientationchange', onResize)
})
return {
isLandscape,
isMobile,
isMobileLandscape,
windowWidth,
windowHeight,
}
}