Disable heymlz loading

This commit is contained in:
marzban-dev
2025-05-12 12:42:16 +03:30
parent 65b77d1ac2
commit 2ea4025e5d
+15 -15
View File
@@ -5,7 +5,7 @@ const { $gsap: gsap } = useNuxtApp();
const isSiteLoadingDisabled = useCookie("is-site-loading-disabled", {
default: () => false,
expires: new Date(Date.now() + 24 * 60 * 60 * 1000),
expires: new Date(Date.now() + 15 * 60 * 1000),
});
const shouldRenderLoadingOverlay = ref(true);
@@ -27,12 +27,12 @@ const progressStyle = computed(() => {
// methods
const onAssetLoaded = () => {
clearInterval(progressInterval.value!);
criticalLoad.value = false;
assetLoadingProgress.value = 100;
isAssetLoaded.value = true;
};
// const onAssetLoaded = () => {
// clearInterval(progressInterval.value!);
// criticalLoad.value = false;
// assetLoadingProgress.value = 100;
// isAssetLoaded.value = true;
// };
const onAssetFinished = () => {
gsap.to("#loading-overlay", {
@@ -59,15 +59,15 @@ onMounted(() => {
if (!isSiteLoadingDisabled.value) {
isWindowScrollLocked.value = true;
const heymlzLoadingAnimation = document.querySelector("#heymlz-loading-animation") as HTMLVideoElement;
// const heymlzLoadingAnimation = document.querySelector("#heymlz-loading-animation") as HTMLVideoElement;
if (heymlzLoadingAnimation?.readyState >= HTMLMediaElement.HAVE_ENOUGH_DATA) {
onAssetLoaded();
}
// if (heymlzLoadingAnimation?.readyState >= HTMLMediaElement.HAVE_ENOUGH_DATA) {
// onAssetLoaded();
// }
progressInterval.value = setInterval(() => {
assetLoadingProgress.value += Math.random() * 10;
}, 250);
assetLoadingProgress.value += Math.random() * 50;
}, 150);
gsap.to("#loading-overlay", {
opacity: 1,
@@ -100,7 +100,7 @@ onMounted(() => {
</div>
</div>
<video
<!-- <video
id="heymlz-loading-animation"
muted
autoplay
@@ -114,6 +114,6 @@ onMounted(() => {
:style="{
mask: 'linear-gradient(to bottom, rgba(0,0,0,0) 0%, black 20%, black 80%, rgba(0,0,0,0) 100%)',
}"
/>
/> -->
</div>
</template>