File tree 4 files changed +17
-4
lines changed
Filter options
4 files changed +17
-4
lines changed
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export default function Layout({
35
35
target = "_blank"
36
36
rel = "noopener noreferrer"
37
37
// here we are using the `isolate` property to create a new stacking context: https://github.com/tailwindlabs/tailwindcss/discussions/5675#discussioncomment-1987063
38
- className = "relative isolate overflow-hidden rounded-full w-32 px-10 py-4 focus:outline-none focus:ring-0 "
38
+ className = "relative isolate overflow-hidden rounded-full w-32 px-10 py-4"
39
39
>
40
40
< span className = "absolute inset-px z-10 grid place-items-center rounded-full bg-black bg-gradient-to-t from-neutral-800 text-neutral-400 text-sm" >
41
41
View the code
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ export default function SlackButton({
38
38
} }
39
39
className = "group-hover:hidden block"
40
40
viewBox = "0 0 122.8 122.8"
41
+ aria-hidden = "true"
41
42
>
42
43
< path
43
44
d = "M25.8 77.6c0 7.1-5.8 12.9-12.9 12.9S0 84.7 0 77.6s5.8-12.9 12.9-12.9h12.9v12.9zm6.5 0c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9v32.3c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V77.6z"
Original file line number Diff line number Diff line change 1
1
import Modal from "./modal" ;
2
2
import {
3
+ useRef ,
4
+ useEffect ,
3
5
useState ,
4
6
Dispatch ,
5
7
SetStateAction ,
@@ -14,14 +16,22 @@ const VideoModal = ({
14
16
showVideoModal : boolean ;
15
17
setShowVideoModal : Dispatch < SetStateAction < boolean > > ;
16
18
} ) => {
19
+ const videoRef = useRef < HTMLVideoElement > ( null ) ;
20
+ useEffect ( ( ) => {
21
+ if ( showVideoModal ) videoRef . current ?. focus ( ) ;
22
+ } , [ showVideoModal ] ) ;
23
+
17
24
return (
18
25
< Modal showModal = { showVideoModal } setShowModal = { setShowVideoModal } >
19
26
< video
27
+ ref = { videoRef }
20
28
className = "w-11/12 max-w-screen-xl aspect-video overflow-hidden shadow-xl rounded-2xl object-fill"
21
29
autoPlay
22
30
controls
23
31
src = "/assets/demo.mp4"
24
32
poster = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABIpJREFUWEeNV4tynEYQ3F24L04sWYKzLSfKT/tYUv2YfSA5FakoDuqge3p6Hpf3P76cyX9nykkXOVV8zriOI/Ez/toD7Q6eiCfxma/wt7Ov9ayv2hfylQBf1YCTiPiYwTtt43USwiJwA8zxSXfNLnUCBNVjBJyi10OnXzxIRj1Cl/kcSnwWuV+Et+5/Pvl9fjzjXBqBZCIfCFwTd8aNINRVaJ/47jERGQSeHXhIo+hBAuApF8XoxI75lyFw57yce7Ii/s9IkMr+5euFgIBzLikVkyCZwVl84uQ/CcSBO2e1S00Vp3g2nDFc5/3ptRHIjjjAeQYZEKEKYSRCp0QwgIJENXhcB8FQXd4ShyEV+/M2ECiMHIA6Fp1DkW5eg3bgs4qAzlKF/z1nTm1Pp1LwfBcxgxQDl0UEeE1SiB6pcUSMPAB9rocJiASPRiKqSEo2M25fv52KUFIDsAB48RGE/B1mwsaboq5HqocIVBOrFxVk7osC28sP3hcBgJa0lJUEloFEgQL2AF4jsylyAR+pmkR1OkiAh3ypPiIFmBm8b3t94/0W/bISeFlBQJ+lSkmFKrj0+GJHTAIPEjkOE5lICNy5JgeVNghsP0/mtmRKH8DraiKhxAcCNl0AHiJQj0c6qIRSIRVmBcZU5G37Sx4okL6kBcDrmkBgpRKr7i9WQN1HLqfplPuDBB5SAJ9rTYcrQl6ACtHSeznmbf/bJgSIFCB4IwElBgJMgXpAJ/BIx8PRk4QI8KAKocDY7iMF+3tXYAF4ELilG9VYpAR90BvRaEBGDOCHwEXgoAJTCkKFoRrydn+nB2AyKbCm2y0UuInQhQA83HrAKP/jlwmEGU0gnanGpG3gnhLb/R9WAQlcol+DyH8q8DF6KCEPHCzDnoJehionVMFEAJEjBbdBBZsxUuBGFApIfkT8q6Wgl6MUqBpb3in61OWdDwosa0Lkt/XGM+QHKXmg9KWsNaFw/+iB3gtmD7gNRytG9e37+wk5wgPh/u4DkVAzUiNCK24KsAxtvGZCG9BlqJnQy1Av8WwRAXuA0fYSVBX8XwJjGUKBKMNhIo4GtAp5Rx9gJ1StTz2AZDwTpjKMPgCQAI5mhOh7J4xZ0PaAgQRx9086YSeBElQjwpDCLKB0MeU4gDCMogMCHJ5Q9EyTW3G4PqSPkZx3zwLmmB3PUVN6NSINpJwK9gKWr6ccZe5TUJEPw6jG5tS3IpZe80BK+f76JhPmIKBm1OZAG0baEycCaLNBwsCYBRzRzYAGb8uMx3r0ARJwI2rdMIbQtBOMD8acHwg0In0h0Wo2EpDzexqgwMsPVQEUYBoked8HtCFpRxyXUkxDdLlIg85z9J2A1rkLATSi+8v3eSHBTuBNCCS0nrkJMXeKSOYa1q8ou7acxm+Ftv15pxx6AO7ch50wFOBiEusYwWXCMI/biiZdjFwAt32wr+ZqwFJOKqCbKhBeiwDSolWcLTcUaB0QKfgNgWZElV2F8/17IfIf8IRuaWgE7m0lAwl6IGSfNmP9PogfNz0F8sGc+/htMP5Elw7cK4cfOf8CzsEZUbNybRAAAAAASUVORK5CYII="
33
+ tabIndex = { showVideoModal ? 0 : - 1 }
34
+ aria-label = "Slacker Introduction Video"
25
35
/>
26
36
</ Modal >
27
37
) ;
Original file line number Diff line number Diff line change @@ -32,13 +32,13 @@ export default function Home() {
32
32
< div className = "relative my-10" >
33
33
< button
34
34
onClick = { ( ) => setShowVideoModal ( true ) }
35
- className = "group flex justify-center items-center absolute z-10 w-[350px] h-[350px] sm:w-[500px] sm:h-[500px] rounded-full hover:backdrop-blur-sm hover:bg-black/20 focus:outline-none focus:ring-0 transition-all overflow-hidden"
35
+ className = "group flex justify-center items-center absolute z-10 w-[350px] h-[350px] sm:w-[500px] sm:h-[500px] rounded-full hover:backdrop-blur-sm hover:bg-black/20 transition-all overflow-hidden"
36
36
>
37
37
< div className = "flex justify-center items-center w-14 h-14 rounded-full bg-white shadow-lg" >
38
- < Play size = { 20 } fill = "#27272A" />
38
+ < Play size = { 20 } fill = "#27272A" aria-hidden = "true" />
39
39
</ div >
40
40
< p className = "font-mono text-white absolute -bottom-10 group-hover:bottom-5 transition-all ease-in-out duration-300" >
41
- 1:03
41
+ < span className = "sr-only" > Play Video. Length of Video is </ span > 1:03
42
42
</ p >
43
43
</ button >
44
44
< video
@@ -47,6 +47,8 @@ export default function Home() {
47
47
muted
48
48
src = "/assets/demo-preview.mp4"
49
49
className = "w-[350px] h-[350px] sm:w-[500px] sm:h-[500px] rounded-full object-cover"
50
+ tabIndex = { - 1 }
51
+ aria-label = "Looping video preview"
50
52
/>
51
53
</ div >
52
54
< div className = "flex flex-col text-center space-y-2" >
You can’t perform that action at this time.
0 commit comments