@@ -65,10 +65,10 @@ <h1><span class="open-source" data-i18n-key="h1_1">Open Source</span> <span data
6565 < a href ="https://studio.linto.app/ " class ="btn " data-i18n-key ="start_free "> Start Free</ a >
6666 < a href ="https://github.com/linto-ai " class ="btn btn--outline " data-i18n-key ="github "> Github < span class ="icon github " /> </ a >
6767 </ div >
68- < div class ="screenshot " @click =" document.getElementById('video').play(); document.getElementById('playButton').style.display='none'; " >
69- < video id ="video " playsinline muted loop src ="/demo linto.mp4 " poster ="/screenshot.png "> </ video >
68+ < div class ="screenshot ">
69+ < video id ="video " playsinline muted src ="/demo linto.mp4 " poster ="/screenshot.png "> </ video >
7070
71- < button class ="play-button " onclick =" document.getElementById('video').play(); this.style.display='none'; " id ="playButton ">
71+ < button class ="play-button " id ="playButton ">
7272 < span class ="icon play " />
7373 </ button >
7474 <!-- <img src="/screenshot.png" alt="LinTO Studio Screenshot" /> -->
@@ -249,6 +249,30 @@ <h3 data-i18n-key="pricing_premium_title">Premium</h3>
249249 setInterval ( wink , 10000 ) ;
250250 } , 1000 ) ;
251251 }
252+
253+ const video = document . getElementById ( 'video' ) ;
254+ const playButton = document . getElementById ( 'playButton' ) ;
255+ const screenshot = document . querySelector ( '.screenshot' ) ;
256+
257+ video . playbackRate = 0.75 ;
258+
259+ const playVideo = ( ) => {
260+ video . play ( ) ;
261+ playButton . style . display = 'none' ;
262+ screenshot . classList . add ( 'playing' ) ;
263+ } ;
264+
265+ playButton . addEventListener ( 'click' , ( e ) => {
266+ e . stopPropagation ( ) ;
267+ playVideo ( ) ;
268+ } ) ;
269+ screenshot . addEventListener ( 'click' , playVideo ) ;
270+
271+ video . addEventListener ( 'ended' , ( ) => {
272+ playButton . style . display = 'flex' ;
273+ screenshot . classList . remove ( 'playing' ) ;
274+ video . load ( ) ; // Resets to poster
275+ } ) ;
252276 } ) ;
253277 </ script >
254278</ body >
0 commit comments