11import { html } from "lit" ;
2- import { customElement , state } from "lit/decorators.js" ;
3- import { translateText } from "../client/Utils" ;
2+ import { customElement , query , state } from "lit/decorators.js" ;
3+ import { translateText , TUTORIAL_VIDEO_URL } from "../client/Utils" ;
44import { BaseModal } from "./components/BaseModal" ;
55import "./components/Difficulties" ;
66import { modalHeader } from "./components/ui/ModalHeader" ;
@@ -9,6 +9,7 @@ import { TroubleshootingModal } from "./TroubleshootingModal";
99@customElement ( "help-modal" )
1010export class HelpModal extends BaseModal {
1111 @state ( ) private keybinds : Record < string , string > = this . getKeybinds ( ) ;
12+ @query ( "#tutorial-video-iframe" ) private videoIframe ?: HTMLIFrameElement ;
1213
1314 private isKeybindObject ( v : unknown ) : v is { value : string } {
1415 return (
@@ -120,6 +121,47 @@ export class HelpModal extends BaseModal {
120121 [&_p]:text-gray-300 [&_p]:mb-3 [&_strong]:text-white [&_strong]:font-bold
121122 scrollbar-thin scrollbar-thumb-white/20 scrollbar-track-transparent "
122123 >
124+ <!-- Video Tutorial Section -->
125+ < div class ="flex items-center gap-3 mb-3 ">
126+ < div class ="text-blue-400 ">
127+ < svg
128+ xmlns ="http://www.w3.org/2000/svg "
129+ class ="w-5 h-5 "
130+ viewBox ="0 0 24 24 "
131+ fill ="none "
132+ stroke ="currentColor "
133+ stroke-width ="2 "
134+ stroke-linecap ="round "
135+ stroke-linejoin ="round "
136+ >
137+ < polygon points ="5 3 19 12 5 21 5 3 "> </ polygon >
138+ </ svg >
139+ </ div >
140+ < h3
141+ class ="text-xl font-bold uppercase tracking-widest text-white/90 "
142+ >
143+ ${ translateText ( "help_modal.video_tutorial" ) }
144+ </ h3 >
145+ < div
146+ class ="flex-1 h-px bg-gradient-to-r from-blue-500/50 to-transparent "
147+ > </ div >
148+ </ div >
149+ < section
150+ class ="bg-white/5 rounded-xl border border-white/10 overflow-hidden mb-8 "
151+ >
152+ < div class ="relative w-full h-0 pb-[56.25%] ">
153+ < iframe
154+ id ="tutorial-video-iframe "
155+ class ="absolute top-0 left-0 w-full h-full "
156+ src ="${ TUTORIAL_VIDEO_URL } "
157+ title ="${ translateText ( "help_modal.video_tutorial_title" ) } "
158+ frameborder ="0 "
159+ allow ="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share "
160+ allowfullscreen
161+ > </ iframe >
162+ </ div >
163+ </ section >
164+
123165 <!-- Troubleshooting Section -->
124166 < div class ="flex items-center gap-3 mb-3 ">
125167 < div class ="text-blue-400 ">
@@ -1200,5 +1242,16 @@ export class HelpModal extends BaseModal {
12001242
12011243 protected onOpen ( ) : void {
12021244 this . keybinds = this . getKeybinds ( ) ;
1245+ // Restore the video src when modal opens
1246+ if ( this . videoIframe ) {
1247+ this . videoIframe . src = TUTORIAL_VIDEO_URL ;
1248+ }
1249+ }
1250+
1251+ protected onClose ( ) : void {
1252+ // Clear the iframe src to stop video playback
1253+ if ( this . videoIframe ) {
1254+ this . videoIframe . src = "" ;
1255+ }
12031256 }
12041257}
0 commit comments