package Ġcom . ne el k am ath . sir Bur ps AL ot Ċ Ċ import Ġorg . w 3 c . dom .* Ċ import Ġorg . w 3 c . dom . events . Keyboard Event Ċ import Ġkotlin . browser . document Ċ Ċ private Ġfun Ġset Blob Height () Ġ{ ĊĠĠĠ Ġval Ġblob Ġ= Ġdocument . querySelector ("# blob ") Ġas ĠHTML Image Element ĊĠĠĠ Ġval Ġsize Ġ= Ġdocument . querySelector ("# size ") Ġas ĠHTML InputElement ĊĠĠĠ Ġblob . style . height Ġ= Ġ"${ size . value As Number Ġ* Ġ 5 } em " Ċ } Ċ Ċ // ĠCred its : Ġhttps :// stackoverflow . com / questions / 3 5 1 4 7 8 4 / what - is - the - best - way - to - detect - a - mobile - device / 3 5 4 0 2 9 5 # 3 5 4 0 2 9 5 Ċ private Ġfun Ġshould Show Letters () Ġ= Ġjs ( ĊĠĠĠ Ġ""" /( android | bb \ d + | me ego ). + mobile | av ant go | bad a \/ | black berry | bl azer | comp al | ela ine | f enn ec | hi pt op | iem obile | ip ( hone | od )| ip ad | iris | kind le | Android | Sil k | l ge Ġ| ma emo | mid p | m mp | net front | oper a Ġm ( ob | in ) i | pal m ( Ġos )? | phone | p ( ix i | re ) \/ | pl u cker | po cket | p sp | series ( 4 | 6 ) 0 | s ymb ian | tre o | up \. ( browser | link )| vod af one | wap | windows Ġ( ce | phone )| xda | xi ino / i . test ( navigator . userAgent ) ĊĠĠĠ Ġ|| Ġ/ 1 2 0 7 | 6 3 1 0 | 6 5 9 0 | 3 g so | 4 th p | 5 0 [ 1 - 6 ] i | 7 7 0 s | 8 0 2 s | a Ġwa | ab ac | ac ( er | oo | s \- )| ai ( ko | rn )| al ( av | ca | co )| am oi | an ( ex | ny | yw )| apt u | ar ( ch | go )| as ( te | us )| att w | au ( di | \- m | r Ġ| s Ġ) | avan | be ( ck | ll | nq )| bi ( lb | rd )| bl ( ac | az )| br ( e | v ) w | b umb | bw \ -( n | u )| c 5 5 \/ | c api | cc wa | cd m \- | cell | ch tm | cl dc | cmd \- | co ( mp | nd )| c raw | da ( it | ll | ng )| db te | dc \- s | dev i | dic a | d mob | do ( c | p ) o | ds ( 1 2 | \- d )| el ( 4 9 | ai )| em ( l 2 | ul )| er ( ic | k 0 )| es l 8 | ez ([ 4 - 7 ] 0 | os | wa | ze )| f etc | fly (\ -| _ )| g 1 Ġu | g 5 6 0 | gene | gf \- 5 | g \- mo | go (\ . w | od )| gr ( ad | un )| ha ie | hc it | hd \ -( m | p | t )| he i \- | hi ( pt | ta )| hp ( Ġi | ip )| hs \- c | ht ( c (\ -| Ġ|_| a | g | p | s | t )| tp )| hu ( aw | tc )| i \ -( 2 0 | go | ma )| i 2 3 0 | iac ( Ġ| \- |\ /) | ib ro | idea | ig 0 1 | ik om | im 1 k | in no | ip aq | iris | ja ( t | v ) a | j bro | j emu | j igs | k ddi | ke ji | k gt ( Ġ|\ /) | k lon | k pt Ġ| kw c \- | ky o ( c | k )| le ( no | xi )| lg ( Ġg | \/ ( k | l | u )| 5 0 | 5 4 | \- [ a - w ]) | lib w | ly nx | m 1 \- w | m 3 ga | m 5 0 \/ | ma ( te | ui | xo )| mc ( 0 1 | 2 1 | ca )| m \- cr | me ( rc | ri )| mi ( o 8 | oa | ts )| mme f | mo ( 0 1 | 0 2 | bi | de | do | t (\ -| Ġ| o | v )| zz )| mt ( 5 0 | p 1 | v Ġ) | mw bp | my wa | n 1 0 [ 0 - 2 ]| n 2 0 [ 2 - 3 ]| n 3 0 ( 0 | 2 )| n 5 0 ( 0 | 2 | 5 )| n 7 ( 0 ( 0 | 1 )| 1 0 )| ne (( c | m )\ -| on | tf | wf | wg | wt )| nok ( 6 | i )| nz ph | o 2 im | op ( ti | wv )| oran | ow g 1 | p 8 0 0 | pan ( a | d | t )| p dx g | pg ( 1 3 | \- ([ 1 - 8 ]| c )) | phil | p ire | pl ( ay | uc )| pn \- 2 | po ( ck | rt | se )| prox | ps io | pt \- g | qa \- a | qc ( 0 7 | 1 2 | 2 1 | 3 2 | 6 0 | \- [ 2 - 7 ]| i \- )| q tek | r 3 8 0 | r 6 0 0 | r aks | rim 9 | ro ( ve | zo )| s 5 5 \/ | sa ( ge | ma | mm | ms | ny | va )| sc ( 0 1 | h \- | oo | p \- )| sdk \/ | se ( c (\ -| 0 | 1 )| 4 7 | mc | nd | ri )| sg h \- | shar | s ie (\ -| m )| sk \- 0 | sl ( 4 5 | id )| sm ( al | ar | b 3 | it | t 5 )| so ( ft | ny )| sp ( 0 1 | h \- | v \- | v Ġ) | sy ( 0 1 | mb )| t 2 ( 1 8 | 5 0 )| t 6 ( 0 0 | 1 0 | 1 8 )| ta ( gt | lk )| tcl \- | td g \- | tel ( i | m )| tim \- | t \- mo | to ( pl | sh )| ts ( 7 0 | m \- | m 3 | m 5 )| tx \- 9 | up (\ . b | g 1 | si )| ut st | v 4 0 0 | v 7 5 0 | ver i | vi ( rg | te )| vk ( 4 0 | 5 [ 0 - 3 ]| \- v )| vm 4 0 | v oda | vul c | vx ( 5 2 | 5 3 | 6 0 | 6 1 | 7 0 | 8 0 | 8 1 | 8 3 | 8 5 | 9 8 )| w 3 c (\ -| Ġ) | web c | wh it | wi ( g Ġ| nc | nw )| w ml b | won u | x 7 0 0 | y as \- | your | z eto | z te \- / i . test ( navigator . userAgent . substr ( 0 , 4 )) """ Ċ ) Ġas ĠBoolean Ċ Ċ private Ġfun Ġplay ( letter : ĠString ) Ġ= Ġwith ( document . createElement (" AUDIO ") Ġas ĠHTML Audio Element ) Ġ{ ĊĠĠĠ Ġset Attribute (" src ", Ġ" bur ps /$ letter . mp 3 ") ĊĠĠĠ Ġval Ġsize Ġ= Ġdocument . querySelector ("# size ") Ġas ĠHTML InputElement ĊĠĠĠ Ġplayback Rate Ġ= Ġsize . min . toDouble () Ġ+ Ġ( size . max . toDouble () Ġ- Ġsize . value As Number ) ĊĠĠĠ Ġplay () Ċ } Ċ Ċ private Ġfun Ġenable Letters () Ġ{ ĊĠĠĠ Ġ( document . querySelector ("# letters ") Ġas ĠHTML Div Element ). style . display Ġ= Ġ" initial " ĊĠĠĠ Ġfor Ġ( letter Ġin Ġdocument . querySelectorAll (". letter "). asList ()) Ġ{ ĊĠĠĠĠĠĠĠ Ġletter Ġas ĠHTML InputElement ĊĠĠĠĠĠĠĠ Ġletter . addEventListener (" click ", Ġ{ Ġplay ( letter . value ) Ġ}) ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun Ġmain ( args : ĠArray < String >) Ġ{ ĊĠĠĠ Ġif Ġ( should Show Letters ()) Ġenable Letters () ĊĠĠĠ Ġset Blob Height () ĊĠĠĠ Ġdocument . querySelector ("# size ") !!. addEventListener (" input ", Ġ{ Ġset Blob Height () Ġ}) ĊĠĠĠ Ġdocument . addEventListener (" keydown ", Ġ{ Ġwith ( it Ġas ĠKeyboard Event ) Ġ{ Ġif Ġ( keyCode Ġin Ġ 6 5 .. 9 0 ) Ġplay ( key ) Ġ} Ġ}) Ċ } Ċ