mirror of
https://github.com/TeamPiped/Piped
synced 2025-09-05 21:11:09 +02:00
12 lines
333 B
JavaScript
12 lines
333 B
JavaScript
import { ref } from "vue";
|
|
|
|
const isMobile = ref(false);
|
|
export function useIsMobile() {
|
|
isMobile.value = window.matchMedia("screen and (max-width: 800px)").matches;
|
|
window.addEventListener("resize", () => {
|
|
isMobile.value = window.matchMedia("screen and (max-width: 800px)").matches;
|
|
});
|
|
|
|
return isMobile;
|
|
}
|