mirror of
https://github.com/hyprwm/hyprland-website.git
synced 2024-11-16 18:35:59 +01:00
Disable autoplay on Firefox (#46)
* previewRice: disable firefox auto-play * fix some aria hidden attr
This commit is contained in:
parent
e974a9e234
commit
0e4cd97802
3 changed files with 11 additions and 9 deletions
|
@ -98,7 +98,7 @@
|
||||||
x <= clientX && y <= clientY && x + width > clientX && y + height > clientY
|
x <= clientX && y <= clientY && x + width > clientX && y + height > clientY
|
||||||
isMouseOver$.next(isMouseStillOver)
|
isMouseOver$.next(isMouseStillOver)
|
||||||
}}
|
}}
|
||||||
aria-hidden
|
aria-hidden="true"
|
||||||
bind:this={wrapperElement}
|
bind:this={wrapperElement}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
Smooth transitions. Great animations. High performance. Instant input.
|
Smooth transitions. Great animations. High performance. Instant input.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="_wrapper absolute inset-0 select-none" aria-hidden>
|
<div class="_wrapper absolute inset-0 select-none" aria-hidden="true">
|
||||||
<div class="feature-image">
|
<div class="feature-image">
|
||||||
<img
|
<img
|
||||||
src={smoothDefaultImage}
|
src={smoothDefaultImage}
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
Live reloading config. Easy plain-text format. Sensible defaults. Great documentation.
|
Live reloading config. Easy plain-text format. Sensible defaults. Great documentation.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="_wrapper absolute inset-0 select-none" aria-hidden>
|
<div class="_wrapper absolute inset-0 select-none" aria-hidden="true">
|
||||||
<div class="feature-image">
|
<div class="feature-image">
|
||||||
<img
|
<img
|
||||||
src={configDefaultImage}
|
src={configDefaultImage}
|
||||||
|
@ -113,7 +113,7 @@
|
||||||
<p class="max-w-[60ch]">
|
<p class="max-w-[60ch]">
|
||||||
Automatic tiling that just works. Supports multiple fine-tuneable layouts.
|
Automatic tiling that just works. Supports multiple fine-tuneable layouts.
|
||||||
</p>
|
</p>
|
||||||
<div class="_wrapper absolute inset-0 select-none" aria-hidden>
|
<div class="_wrapper absolute inset-0 select-none" aria-hidden="true">
|
||||||
<div class="feature-image">
|
<div class="feature-image">
|
||||||
<img
|
<img
|
||||||
src={tileDefaultImage}
|
src={tileDefaultImage}
|
||||||
|
|
|
@ -10,9 +10,12 @@
|
||||||
let isManuallyPaused = false
|
let isManuallyPaused = false
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
// Only autoplay on Chrome, because Firefox struggles with decoding the video
|
||||||
|
if (navigator.userAgent.toLowerCase().includes('chrome')) {
|
||||||
// The inview_leave event fires at the start and Chromium reports the video as paused, even with autoplay on.
|
// The inview_leave event fires at the start and Chromium reports the video as paused, even with autoplay on.
|
||||||
// This fixes it. Catch in case autoplay is blocked
|
// This fixes it. Catch in case autoplay is blocked
|
||||||
videoElement.play().catch(() => {})
|
videoElement.play().catch(() => {})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -35,7 +38,6 @@
|
||||||
>
|
>
|
||||||
<div class="video">
|
<div class="video">
|
||||||
<Video
|
<Video
|
||||||
autoplay
|
|
||||||
muted
|
muted
|
||||||
sources={['/videos/end_4_rice_intro.mp4']}
|
sources={['/videos/end_4_rice_intro.mp4']}
|
||||||
bind:videoElement
|
bind:videoElement
|
||||||
|
@ -56,7 +58,7 @@
|
||||||
|
|
||||||
<style lang="postcss">
|
<style lang="postcss">
|
||||||
section {
|
section {
|
||||||
@apply relative z-10 -mb-4 w-full max-w-[1400px] px-1 animate-in fade-in-0 slide-in-from-bottom-10 fill-mode-backwards [animation-delay:1700ms] [animation-duration:2000ms] md:-mt-8 lg:px-8;
|
@apply animate-in fade-in-0 slide-in-from-bottom-10 fill-mode-backwards relative z-10 -mb-4 w-full max-w-[1400px] px-1 [animation-delay:1700ms] [animation-duration:2000ms] md:-mt-8 lg:px-8;
|
||||||
|
|
||||||
contain: layout style content;
|
contain: layout style content;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue