2020 .logo-btn : active { transform : scale (0.95 ); }
2121 .logo-btn .rolling { animation : shake 0.5s ease; }
2222 .start-hint { margin-top : 24px ; font-size : 14px ; color : # 666 ; letter-spacing : 3px ; text-transform : uppercase; }
23- # result-screen { display : none; flex-direction : column; align-items : center; text-align : center; padding : 20px ; max-width : 500px ; width : 100% ; }
24- .result-card { background : linear-gradient (145deg , # 1a1a2e, # 0f0f1a ); border : 1px solid rgba (255 , 255 , 255 , 0.08 ); border-radius : 24px ; padding : 40px 30px ; width : 100% ; margin-bottom : 20px ; opacity : 0 ; transform : translateY (30px ); }
23+ # result-screen { display : none; flex-direction : column; align-items : center; text-align : center; padding : 20px ; max-width : 900px ; width : 100% ; }
24+ .cards-row { display : flex; gap : 20px ; width : 100% ; justify-content : center; flex-wrap : wrap; }
25+ .result-card { background : linear-gradient (145deg , # 1a1a2e, # 0f0f1a ); border : 1px solid rgba (255 , 255 , 255 , 0.08 ); border-radius : 24px ; padding : 40px 30px ; flex : 1 ; min-width : 280px ; max-width : 420px ; opacity : 0 ; transform : translateY (30px ); }
2526 .result-card .show { animation : slideUp 0.6s ease forwards; }
2627 .result-card .delay { animation-delay : 0.2s ; }
2728 .card-emoji { font-size : 48px ; margin-bottom : 16px ; }
2829 .card-label { font-size : 12px ; color : # 667eea ; letter-spacing : 3px ; text-transform : uppercase; margin-bottom : 12px ; font-weight : 700 ; }
2930 .card-title { font-size : 24px ; font-weight : 700 ; margin-bottom : 10px ; line-height : 1.4 ; }
3031 .card-desc { font-size : 14px ; color : # 999 ; line-height : 1.7 ; }
31- .music-link { display : inline-block; margin-top : 14px ; padding : 10px 24px ; background : rgba (102 , 126 , 234 , 0.15 ); border : 1px solid rgba (102 , 126 , 234 , 0.3 ); border-radius : 50px ; color : # 667eea ; text-decoration : none; font-size : 13px ; font-weight : 700 ; transition : all 0.3s ease; }
32- .music-link : hover { background : rgba (102 , 126 , 234 , 0.3 ); }
33- .reroll-btn { margin-top : 10px ; padding : 16px 40px ; border-radius : 50px ; background : transparent; border : 1.5px solid rgba (255 , 255 , 255 , 0.2 ); color : # fff ; font-family : 'Noto Sans KR' , sans-serif; font-size : 15px ; font-weight : 700 ; cursor : pointer; transition : all 0.3s ease; letter-spacing : 1px ; opacity : 0 ; animation : fadeIn 0.5s ease 0.5s forwards; }
32+ .music-artist { font-size : 14px ; color : # 999 ; margin-top : 4px ; }
33+ .bottom-area { margin-top : 30px ; opacity : 0 ; animation : fadeIn 0.5s ease 0.6s forwards; display : flex; flex-direction : column; align-items : center; gap : 16px ; }
34+ .add-prompt { font-size : 14px ; color : # 888 ; letter-spacing : 0.5px ; line-height : 1.6 ; padding : 14px 28px ; border : 1px dashed rgba (255 , 255 , 255 , 0.15 ); border-radius : 16px ; background : rgba (255 , 255 , 255 , 0.03 ); }
35+ .reroll-btn { padding : 16px 40px ; border-radius : 50px ; background : transparent; border : 1.5px solid rgba (255 , 255 , 255 , 0.2 ); color : # fff ; font-family : 'Noto Sans KR' , sans-serif; font-size : 15px ; font-weight : 700 ; cursor : pointer; transition : all 0.3s ease; letter-spacing : 1px ; }
3436 .reroll-btn : hover { border-color : # 667eea ; color : # 667eea ; transform : scale (1.05 ); }
3537 .reroll-btn : active { transform : scale (0.95 ); }
3638 .bg-glow { position : fixed; width : 300px ; height : 300px ; border-radius : 50% ; filter : blur (120px ); opacity : 0.08 ; pointer-events : none; z-index : 0 ; }
3941 @keyframes fadeIn { from { opacity : 0 ; } to { opacity : 1 ; } }
4042 @keyframes slideUp { from { opacity : 0 ; transform : translateY (30px ); } to { opacity : 1 ; transform : translateY (0 ); } }
4143 @keyframes shake { 0% , 100%{transform : rotate (0 )} 20% {transform : rotate (-15deg ) scale (1.1 )} 40% {transform : rotate (15deg ) scale (1.1 )} 60% {transform : rotate (-10deg ) scale (1.05 )} 80% {transform : rotate (10deg ) scale (1.05 )} }
42- @media (min-width : 768px ) and (orientation : landscape) { body {overflow-y : auto} .tagline {font-size : 32px ;margin-bottom : 40px } .logo-btn {width : 180px ;height : 180px } # result-screen {flex-direction : row; flex-wrap : wrap; justify-content : center; gap : 20 px ; max-width : 900 px ; padding : 15px } .result-card {flex : 1 ; min-width : 300 px ; max-width : 420 px ; margin-bottom : 10 px ; padding : 30 px 25 px } . reroll-btn { width : 100 % ; max-width : 300 px ; padding : 18 px 50 px ; font-size : 17 px } .start-hint {font-size : 16px ;margin-top : 30px } }
43- @media (max-width : 600px ) { .tagline {font-size : 20px ;margin-bottom : 35px } .logo-btn {width : 120px ;height : 120px } .card-title {font-size : 20px } .result-card {padding : 30px 24px } }
44+ @media (min-width : 768px ) and (orientation : landscape) { body {overflow-y : auto} .tagline {font-size : 32px ;margin-bottom : 40px } .logo-btn {width : 180px ;height : 180px } # result-screen {padding : 15px } .cards-row {flex-wrap : nowrap } .start-hint {font-size : 16px ;margin-top : 30px } }
45+ @media (max-width : 600px ) { .tagline {font-size : 20px ;margin-bottom : 35px } .logo-btn {width : 120px ;height : 120px } .card-title {font-size : 20px } .result-card {padding : 30px 24px } . cards-row { flex-direction : column; align-items : center} }
4446 </ style >
4547</ head >
4648< body >
4749 < div class ="logo "> OFF '< br > REST</ div >
4850 < div class ="bg-glow glow-1 "> </ div > < div class ="bg-glow glow-2 "> </ div >
4951 < div id ="start-screen ">
50- < div class ="tagline "> ์ค๋์ ํด์์ < br > ์ถ์ฒํด ๋๋ฆฝ๋๋ค. </ div >
52+ < div class ="tagline "> ์ค๋์ ํด์ < br > ์ ํ๊ธฐ </ div >
5153 < button class ="logo-btn " id ="diceBtn " onclick ="roll() "> < img src ="/icons/icon-512.png " alt ="OFFREST "> </ button >
52- < div class ="start-hint "> tap to start </ div >
54+ < div class ="start-hint "> TAP TO OFFREST </ div >
5355 </ div >
5456 < div id ="result-screen ">
55- < div class ="result-card " id ="restCard "> < div class ="card-emoji " id ="restEmoji "> </ div > < div class ="card-label "> ์ค๋์ ํด์</ div > < div class ="card-title " id ="restTitle "> </ div > < div class ="card-desc " id ="restDesc "> </ div > </ div >
56- < div class ="result-card delay " id ="musicCard "> < div class ="card-emoji "> ๐ต</ div > < div class ="card-label "> ์ถ์ฒ ์์
</ div > < div class ="card-title " id ="musicTitle "> </ div > < div class ="card-desc " id ="musicArtist "> </ div > < a class ="music-link " id ="musicLink " href ="# " target ="_blank "> โถ ๋ฃ๊ธฐ</ a > </ div >
57- < button class ="reroll-btn " onclick ="reroll() "> ๐ฒ ํ๋ฒ ๋ ๋๋ฆฌ๊ธฐ</ button >
57+ < div class ="cards-row ">
58+ < div class ="result-card " id ="restCard "> < div class ="card-emoji " id ="restEmoji "> </ div > < div class ="card-label "> ์ค๋์ ํด์</ div > < div class ="card-title " id ="restTitle "> </ div > < div class ="card-desc " id ="restDesc "> </ div > </ div >
59+ < div class ="result-card delay " id ="musicCard "> < div class ="card-emoji "> ๐ต</ div > < div class ="card-label "> ์ถ์ฒ ์์
</ div > < div class ="card-title " id ="musicTitle "> </ div > < div class ="music-artist " id ="musicArtist "> </ div > </ div >
60+ </ div >
61+ < div class ="bottom-area ">
62+ < div class ="add-prompt "> ํด์๋ฐฉ๋ฒ๊ณผ ์์
์ ์นด๋์ ์ ์ด ์ถ๊ฐํด์ฃผ์ธ์</ div >
63+ < button class ="reroll-btn " onclick ="reroll() "> ๐ฒ ํ๋ฒ ๋ ๋๋ฆฌ๊ธฐ</ button >
64+ </ div >
5865 </ div >
59- < script > const R = [ { e :"๐ง" , t :"5๋ถ ๋ช
์ํ๊ธฐ" , d :"๋์ ๊ฐ๊ณ ํธํก์ ์ง์คํด๋ณด์ธ์. ๋ค์จ๊ณผ ๋ ์จ์ ์ฒ์ฒํ ๋๋ผ๋ฉฐ ๋ง์์ ๋น์๋ณด์ธ์." } , { e :"๐ถ" , t :"์ฐ์ฑ
๋๊ฐ๊ธฐ" , d :"๊ฐ๊น์ด ๊ณต์์ด๋ ๊ณจ๋ชฉ๊ธธ์ ๊ฑธ์ด๋ณด์ธ์. ๋ฐ๋๊ณผ ํ์ด์ด ๊ธฐ๋ถ์ ์ ํ์์ผ ์ค ๊ฑฐ์์." } , { e :"โ" , t :"๋ฐ๋ปํ ์ฐจ ํ ์" , d :"์ข์ํ๋ ์ฐจ๋ฅผ ์ฒ์ฒํ ์ฐ๋ ค๋ด๋ฉฐ ์ฌ์ ๋ฅผ ์ฆ๊ฒจ๋ณด์ธ์." } , { e :"๐" , t :"์ฑ
ํ ํ์ด์ง ์ฝ๊ธฐ" , d :"์ด๋ ต์ง ์์ ์ฑ
์ ํด๊ณ ํ ํ์ด์ง๋ง ์ฝ์ด๋ณด์ธ์." } , { e :"๐จ" , t :"๋์ ๊ทธ๋ฆฌ๊ธฐ" , d :"์ข
์ด ์์ ์์ ๋กญ๊ฒ ๊ทธ๋ฆผ์ ๊ทธ๋ ค๋ณด์ธ์." } , { e :"๐ฟ" , t :"์๋ฌผ ๋๋ณด๊ธฐ" , d :"ํ๋ถ์ ๋ฌผ์ ์ฃผ๊ณ ์์ ๋ฆ์์ฃผ์ธ์." } , { e :"๐" , t :"๋ฐ๋ปํ ์ค์ํ๊ธฐ" , d :"๋ฐ๋ปํ ๋ฌผ๋ก ๋ชธ์ ๊ฐ์ธ๋ฉฐ ํ๋ฃจ์ ํผ๋ก๋ฅผ ์ฌ์ด๋ด ๋ณด์ธ์." } , { e :"๐
" , t :"ํ๋ ๋ฐ๋ผ๋ณด๊ธฐ" , d :"์ฐฝ๋ฌธ ๋ฐ ํ๋์ 5๋ถ๋ง ๋ฐ๋ผ๋ณด์ธ์." } , { e :"๐ด" , t :"10๋ถ ๋ฎ์ ์๊ธฐ" , d :"์๋์ 10๋ถ ํ๋ก ๋ง์ถ๊ณ ํธํ๊ฒ ๋์ ๊ฐ์๋ณด์ธ์." } , { e :"๐ง" , t :"์ข์ํ๋ ๋
ธ๋ ๋ฐ๋ผ ๋ถ๋ฅด๊ธฐ" , d :"์ด์ดํฐ์ ๋ผ๊ณ ์ข์ํ๋ ๋
ธ๋๋ฅผ ์๊ฒ ๋ฐ๋ผ ๋ถ๋ฌ๋ณด์ธ์." } , { e :"โ๏ธ" , t :"๊ฐ์ฌํ ๊ฒ 3๊ฐ์ง ์ ๊ธฐ" , d :"์์ ๊ฒ์ด๋ผ๋ ๊ด์ฐฎ์์. ๊ฐ์ฌํ ๊ฒ์ ์ ๋ค ๋ณด๋ฉด ๋ง์์ด ๋ฐ๋ปํด์ง๋๋ค." } , { e :"๐งธ" , t :"์ข์ํ๋ ์์ ๋ณด๊ธฐ" , d :"์งง์ ํ๋ง ์์์ ๋ณด๋ฉฐ ์ ์ ์์ด๋ณด์ธ์." } , { e :"๐" , t :"์
ํ ๋ง์ฌ์งํ๊ธฐ" , d :"๊ด์๋์ด์ ๋ชฉ, ์ด๊นจ๋ฅผ ์ฒ์ฒํ ๋๋ฌ์ฃผ์ธ์." } , { e :"๐" , t :"์กฐ์ฉํ ์์
๋ฃ๊ธฐ" , d :"์๋ฌด ์๊ฐ ์์ด ์กฐ์ฉํ ์์
์ ๊ท๋ฅผ ๊ธฐ์ธ์ฌ๋ณด์ธ์." } ] ; const M = [ { t :"Weightless" , a :"Marconi Union" , u :"https://www.youtube.com/results?search_query=Marconi+Union+Weightless" } , { t :"Clair de Lune" , a :"Debussy" , u :"https://www.youtube.com/results?search_query=Debussy+Clair+de+Lune" } , { t :"Sunset Lover" , a :"Petit Biscuit" , u :"https://www.youtube.com/results?search_query=Petit+Biscuit+Sunset+Lover" } , { t :"River Flows in You" , a :"Yiruma" , u :"https://www.youtube.com/results?search_query=Yiruma+River+Flows+in+You" } , { t :"Experience" , a :"Ludovico Einaudi" , u :"https://www.youtube.com/results?search_query=Ludovico+Einaudi+Experience" } , { t :"Bloom" , a :"The Paper Kites" , u :"https://www.youtube.com/results?search_query=The+Paper+Kites+Bloom" } , { t :"Gymnop\u00e9die No.1" , a :"Erik Satie" , u :"https://www.youtube.com/results?search_query=Erik+Satie+Gymnopedie" } , { t :"Kiss the Rain" , a :"Yiruma" , u :"https://www.youtube.com/results?search_query=Yiruma+Kiss+the+Rain" } , { t :"Nuvole Bianche" , a :"Ludovico Einaudi" , u :"https://www.youtube.com/results?search_query=Ludovico+Einaudi+Nuvole+Bianche" } , { t :"Blue" , a :"Keshi" , u :"https://www.youtube.com/results?search_query=Keshi+Blue" } , { t :"Snowfall" , a :"\u00d8neheart" , u :"https://www.youtube.com/results?search_query=Oneheart+Snowfall" } , { t :"Dandelions" , a :"Ruth B." , u :"https://www.youtube.com/results?search_query=Ruth+B+Dandelions" } , { t :"\uBD04\uB0A0" , a :"BTS" , u :"https://www.youtube.com/results?search_query=BTS+%EB%B4%84%EB%82%A0" } , { t :"Through the Night" , a :"IU" , u :"https://www.youtube.com/results?search_query=IU+%EB%B0%A4%ED%8E%B8%EC%A7%80" } ] ; let lr = - 1 , lm = - 1 , iT = null ; function rT ( ) { if ( iT ) clearTimeout ( iT ) ; iT = setTimeout ( ( ) => { const s = document . getElementById ( 'start-screen' ) , r = document . getElementById ( 'result-screen' ) ; if ( r . style . display === 'flex' ) { r . style . display = 'none' ; s . style . display = 'flex' ; s . style . animation = 'none' ; void s . offsetWidth ; s . style . animation = 'fadeIn 1s ease' } } , 30000 ) } [ 'click' , 'touchstart' , 'keydown' , 'mousemove' , 'scroll' ] . forEach ( e => document . addEventListener ( e , rT , { passive :true } ) ) ; function gi ( a , l ) { let i ; do { i = Math . floor ( Math . random ( ) * a . length ) } while ( i === l && a . length > 1 ) ; return i } function roll ( ) { const b = document . getElementById ( 'diceBtn' ) ; b . classList . add ( 'rolling' ) ; setTimeout ( ( ) => { b . classList . remove ( 'rolling' ) ; show ( ) } , 500 ) } function show ( ) { const s = document . getElementById ( 'start-screen' ) , r = document . getElementById ( 'result-screen' ) ; const i = gi ( R , lr ) , j = gi ( M , lm ) ; lr = i ; lm = j ; const re = R [ i ] , mu = M [ j ] ; document . getElementById ( 'restEmoji' ) . textContent = re . e ; document . getElementById ( 'restTitle' ) . textContent = re . t ; document . getElementById ( 'restDesc' ) . textContent = re . d ; document . getElementById ( 'musicTitle' ) . textContent = mu . t ; document . getElementById ( 'musicArtist' ) . textContent = mu . a ; document . getElementById ( 'musicLink' ) . href = mu . u ; s . style . display = 'none' ; r . style . display = 'flex' ; rT ( ) ; r . querySelectorAll ( '.result-card' ) . forEach ( c => { c . classList . remove ( 'show' ) ; void c . offsetWidth ; c . classList . add ( 'show' ) } ) ; const rb = r . querySelector ( '.reroll-btn' ) ; rb . style . animation = 'none' ; void rb . offsetWidth ; rb . style . animation = 'fadeIn 0.5s ease 0.5s forwards' ; rb . style . opacity = '0' } function reroll ( ) { const r = document . getElementById ( 'result-screen' ) ; const i = gi ( R , lr ) , j = gi ( M , lm ) ; lr = i ; lm = j ; const re = R [ i ] , mu = M [ j ] ; rT ( ) ; const cards = r . querySelectorAll ( '.result-card' ) ; cards . forEach ( c => c . classList . remove ( 'show' ) ) ; setTimeout ( ( ) => { document . getElementById ( 'restEmoji' ) . textContent = re . e ; document . getElementById ( 'restTitle' ) . textContent = re . t ; document . getElementById ( 'restDesc' ) . textContent = re . d ; document . getElementById ( 'musicTitle' ) . textContent = mu . t ; document . getElementById ( 'musicArtist' ) . textContent = mu . a ; document . getElementById ( 'musicLink' ) . href = mu . u ; cards . forEach ( c => { void c . offsetWidth ; c . classList . add ( 'show' ) } ) } , 300 ) } </ script >
66+ < script > const R = [ { e :"๐ง" , t :"5๋ถ ๋ช
์ํ๊ธฐ" , d :"๋์ ๊ฐ๊ณ ํธํก์ ์ง์คํด๋ณด์ธ์. ๋ค์จ๊ณผ ๋ ์จ์ ์ฒ์ฒํ ๋๋ผ๋ฉฐ ๋ง์์ ๋น์๋ณด์ธ์." } , { e :"๐ถ" , t :"์ฐ์ฑ
๋๊ฐ๊ธฐ" , d :"๊ฐ๊น์ด ๊ณต์์ด๋ ๊ณจ๋ชฉ๊ธธ์ ๊ฑธ์ด๋ณด์ธ์. ๋ฐ๋๊ณผ ํ์ด์ด ๊ธฐ๋ถ์ ์ ํ์์ผ ์ค ๊ฑฐ์์." } , { e :"โ" , t :"๋ฐ๋ปํ ์ฐจ ํ ์" , d :"์ข์ํ๋ ์ฐจ๋ฅผ ์ฒ์ฒํ ์ฐ๋ ค๋ด๋ฉฐ ์ฌ์ ๋ฅผ ์ฆ๊ฒจ๋ณด์ธ์." } , { e :"๐" , t :"์ฑ
ํ ํ์ด์ง ์ฝ๊ธฐ" , d :"์ด๋ ต์ง ์์ ์ฑ
์ ํด๊ณ ํ ํ์ด์ง๋ง ์ฝ์ด๋ณด์ธ์." } , { e :"๐จ" , t :"๋์ ๊ทธ๋ฆฌ๊ธฐ" , d :"์ข
์ด ์์ ์์ ๋กญ๊ฒ ๊ทธ๋ฆผ์ ๊ทธ๋ ค๋ณด์ธ์." } , { e :"๐ฟ" , t :"์๋ฌผ ๋๋ณด๊ธฐ" , d :"ํ๋ถ์ ๋ฌผ์ ์ฃผ๊ณ ์์ ๋ฆ์์ฃผ์ธ์." } , { e :"๐" , t :"๋ฐ๋ปํ ์ค์ํ๊ธฐ" , d :"๋ฐ๋ปํ ๋ฌผ๋ก ๋ชธ์ ๊ฐ์ธ๋ฉฐ ํ๋ฃจ์ ํผ๋ก๋ฅผ ์ฌ์ด๋ด ๋ณด์ธ์." } , { e :"๐
" , t :"ํ๋ ๋ฐ๋ผ๋ณด๊ธฐ" , d :"์ฐฝ๋ฌธ ๋ฐ ํ๋์ 5๋ถ๋ง ๋ฐ๋ผ๋ณด์ธ์." } , { e :"๐ด" , t :"10๋ถ ๋ฎ์ ์๊ธฐ" , d :"์๋์ 10๋ถ ํ๋ก ๋ง์ถ๊ณ ํธํ๊ฒ ๋์ ๊ฐ์๋ณด์ธ์." } , { e :"๐ง" , t :"์ข์ํ๋ ๋
ธ๋ ๋ฐ๋ผ ๋ถ๋ฅด๊ธฐ" , d :"์ด์ดํฐ์ ๋ผ๊ณ ์ข์ํ๋ ๋
ธ๋๋ฅผ ์๊ฒ ๋ฐ๋ผ ๋ถ๋ฌ๋ณด์ธ์." } , { e :"โ๏ธ" , t :"๊ฐ์ฌํ ๊ฒ 3๊ฐ์ง ์ ๊ธฐ" , d :"์์ ๊ฒ์ด๋ผ๋ ๊ด์ฐฎ์์. ๊ฐ์ฌํ ๊ฒ์ ์ ๋ค ๋ณด๋ฉด ๋ง์์ด ๋ฐ๋ปํด์ง๋๋ค." } , { e :"๐งธ" , t :"์ข์ํ๋ ์์ ๋ณด๊ธฐ" , d :"์งง์ ํ๋ง ์์์ ๋ณด๋ฉฐ ์ ์ ์์ด๋ณด์ธ์." } , { e :"๐" , t :"์
ํ ๋ง์ฌ์งํ๊ธฐ" , d :"๊ด์๋์ด์ ๋ชฉ, ์ด๊นจ๋ฅผ ์ฒ์ฒํ ๋๋ฌ์ฃผ์ธ์." } , { e :"๐" , t :"์กฐ์ฉํ ์์
๋ฃ๊ธฐ" , d :"์๋ฌด ์๊ฐ ์์ด ์กฐ์ฉํ ์์
์ ๊ท๋ฅผ ๊ธฐ์ธ์ฌ๋ณด์ธ์." } ] ; const M = [ { t :"Weightless" , a :"Marconi Union" } , { t :"Clair de Lune" , a :"Debussy" } , { t :"Sunset Lover" , a :"Petit Biscuit" } , { t :"River Flows in You" , a :"Yiruma" } , { t :"Experience" , a :"Ludovico Einaudi" } , { t :"Bloom" , a :"The Paper Kites" } , { t :"Gymnopรฉdie No.1" , a :"Erik Satie" } , { t :"Kiss the Rain" , a :"Yiruma" } , { t :"Nuvole Bianche" , a :"Ludovico Einaudi" } , { t :"Blue" , a :"Keshi" } , { t :"Snowfall" , a :"รneheart" } , { t :"Dandelions" , a :"Ruth B." } , { t :"๋ด๋ " , a :"BTS" } , { t :"Through the Night" , a :"IU" } ] ; let lr = - 1 , lm = - 1 , iT = null ; function rT ( ) { if ( iT ) clearTimeout ( iT ) ; iT = setTimeout ( ( ) => { const s = document . getElementById ( 'start-screen' ) , r = document . getElementById ( 'result-screen' ) ; if ( r . style . display === 'flex' ) { r . style . display = 'none' ; s . style . display = 'flex' ; s . style . animation = 'none' ; void s . offsetWidth ; s . style . animation = 'fadeIn 1s ease' } } , 30000 ) } [ 'click' , 'touchstart' , 'keydown' , 'mousemove' , 'scroll' ] . forEach ( e => document . addEventListener ( e , rT , { passive :true } ) ) ; function gi ( a , l ) { let i ; do { i = Math . floor ( Math . random ( ) * a . length ) } while ( i === l && a . length > 1 ) ; return i } function roll ( ) { const b = document . getElementById ( 'diceBtn' ) ; b . classList . add ( 'rolling' ) ; setTimeout ( ( ) => { b . classList . remove ( 'rolling' ) ; show ( ) } , 500 ) } function show ( ) { const s = document . getElementById ( 'start-screen' ) , r = document . getElementById ( 'result-screen' ) ; const i = gi ( R , lr ) , j = gi ( M , lm ) ; lr = i ; lm = j ; const re = R [ i ] , mu = M [ j ] ; document . getElementById ( 'restEmoji' ) . textContent = re . e ; document . getElementById ( 'restTitle' ) . textContent = re . t ; document . getElementById ( 'restDesc' ) . textContent = re . d ; document . getElementById ( 'musicTitle' ) . textContent = mu . t ; document . getElementById ( 'musicArtist' ) . textContent = mu . a ; s . style . display = 'none' ; r . style . display = 'flex' ; rT ( ) ; r . querySelectorAll ( '.result-card' ) . forEach ( c => { c . classList . remove ( 'show' ) ; void c . offsetWidth ; c . classList . add ( 'show' ) } ) ; const ba = r . querySelector ( '.bottom-area' ) ; ba . style . animation = 'none' ; void ba . offsetWidth ; ba . style . animation = 'fadeIn 0.5s ease 0.6s forwards' ; ba . style . opacity = '0' } function reroll ( ) { const r = document . getElementById ( 'result-screen' ) ; const i = gi ( R , lr ) , j = gi ( M , lm ) ; lr = i ; lm = j ; const re = R [ i ] , mu = M [ j ] ; rT ( ) ; const cards = r . querySelectorAll ( '.result-card' ) ; cards . forEach ( c => c . classList . remove ( 'show' ) ) ; setTimeout ( ( ) => { document . getElementById ( 'restEmoji' ) . textContent = re . e ; document . getElementById ( 'restTitle' ) . textContent = re . t ; document . getElementById ( 'restDesc' ) . textContent = re . d ; document . getElementById ( 'musicTitle' ) . textContent = mu . t ; document . getElementById ( 'musicArtist' ) . textContent = mu . a ; cards . forEach ( c => { void c . offsetWidth ; c . classList . add ( 'show' ) } ) } , 300 ) } </ script >
6067</ body >
61- </ html >
68+ </ html >
0 commit comments