123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066 |
- <template>
- <div>
- <page-metadata
- v-if="exists && !loading"
- :title="`${station.displayName}`"
- />
- <page-metadata v-else-if="!exists && !loading" :title="`Not found`" />
- <div id="page-loader-container" v-if="loading">
- <content-loader
- width="1920"
- height="1080"
- :primary-color="nightmode ? '#222' : '#fff'"
- :secondary-color="nightmode ? '#444' : '#ddd'"
- preserve-aspect-ratio="none"
- id="page-loader-content"
- >
- <rect x="55" y="105" rx="5" ry="5" width="670" height="149" />
- <rect x="55" y="283" rx="5" ry="5" width="670" height="640" />
- <rect x="745" y="108" rx="5" ry="5" width="1120" height="672" />
- <rect x="745" y="810" rx="5" ry="5" width="1120" height="110" />
- </content-loader>
- <content-loader
- width="1920"
- height="1080"
- :primary-color="nightmode ? '#222' : '#fff'"
- :secondary-color="nightmode ? '#444' : '#ddd'"
- preserve-aspect-ratio="none"
- id="page-loader-layout"
- >
- <rect x="0" y="0" rx="0" ry="0" width="1920" height="64" />
- <rect x="0" y="980" rx="0" ry="0" width="1920" height="100" />
- </content-loader>
- </div>
- <!-- More simplistic loading animation for mobile users -->
- <div v-show="loading" id="mobile-progress-animation" />
- <ul
- v-if="
- currentSong &&
- (currentSong.youtubeId === 'l9PxOanFjxQ' ||
- currentSong.youtubeId === 'xKVcVSYmesU' ||
- currentSong.youtubeId === '60ItHLz5WEA' ||
- currentSong.youtubeId === 'e6vkFbtSGm0')
- "
- class="bg-bubbles"
- >
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- </ul>
- <div v-show="!loading && exists">
- <main-header />
- <div id="station-outer-container">
- <div
- id="station-inner-container"
- :class="{ 'nothing-here': noSong }"
- >
- <div id="station-left-column" class="column">
- <div id="about-station-container" class="quadrant">
- <div id="station-info">
- <div class="row" id="station-name">
- <h1>{{ station.displayName }}</h1>
- <i
- v-if="station.type === 'official'"
- class="material-icons verified-station"
- content="Verified Station"
- v-tippy
- >
- check_circle
- </i>
- <a>
- <!-- Favorite Station Button -->
- <i
- v-if="
- loggedIn && station.isFavorited
- "
- @click.prevent="unfavoriteStation()"
- content="Unfavorite Station"
- v-tippy
- class="material-icons"
- >star</i
- >
- <i
- v-if="
- loggedIn && !station.isFavorited
- "
- @click.prevent="favoriteStation()"
- class="material-icons"
- content="Favorite Station"
- v-tippy
- >star_border</i
- >
- </a>
- <i
- class="material-icons stationMode"
- :content="
- station.partyMode
- ? 'Station in Party mode'
- : 'Station in Playlist mode'
- "
- v-tippy="{ theme: 'info' }"
- >{{
- station.partyMode
- ? "emoji_people"
- : "playlist_play"
- }}</i
- >
- </div>
- <p>{{ station.description }}</p>
- </div>
- <div id="admin-buttons" v-if="isOwnerOrAdmin()">
- <!-- (Admin) Pause/Resume Button -->
- <button
- class="button is-danger"
- v-if="stationPaused"
- @click="resumeStation()"
- >
- <i class="material-icons icon-with-button"
- >play_arrow</i
- >
- <span> Resume Station </span>
- </button>
- <button
- class="button is-danger"
- @click="pauseStation()"
- v-else
- >
- <i class="material-icons icon-with-button"
- >pause</i
- >
- <span> Pause Station </span>
- </button>
- <!-- (Admin) Skip Button -->
- <button
- class="button is-danger"
- @click="skipStation()"
- >
- <i class="material-icons icon-with-button"
- >skip_next</i
- >
- <span> Force Skip </span>
- </button>
- <!-- (Admin) Station Settings Button -->
- <button
- class="button is-primary"
- @click="openModal('manageStation')"
- >
- <i class="material-icons icon-with-button"
- >settings</i
- >
- <span> Manage Station </span>
- </button>
- </div>
- </div>
- <div id="sidebar-container" class="quadrant">
- <station-sidebar />
- </div>
- </div>
- <div id="station-right-column" class="column">
- <div class="player-container quadrant" v-show="!noSong">
- <div id="video-container">
- <div
- id="stationPlayer"
- style="
- width: 100%;
- height: 100%;
- min-height: 200px;
- "
- />
- <div
- class="player-cannot-autoplay"
- v-if="!canAutoplay"
- @click="
- increaseVolume() && decreaseVolume()
- "
- >
- <p>
- Please click anywhere on the screen for
- the video to start
- </p>
- </div>
- </div>
- <div id="seeker-bar-container">
- <div
- id="seeker-bar"
- :style="{
- width: `${seekerbarPercentage}%`
- }"
- :class="{
- nyan:
- currentSong &&
- currentSong.youtubeId ===
- 'QH2-TGUlwu4'
- }"
- />
- <img
- v-if="
- currentSong &&
- currentSong.youtubeId === 'QH2-TGUlwu4'
- "
- src="https://freepngimg.com/thumb/nyan_cat/1-2-nyan-cat-free-download-png.png"
- :style="{
- position: 'absolute',
- top: `-10px`,
- left: `${seekerbarPercentage}%`,
- width: '50px'
- }"
- />
- <img
- v-if="
- currentSong &&
- (currentSong.youtubeId ===
- 'DtVBCG6ThDk' ||
- currentSong.youtubeId ===
- 'sI66hcu9fIs' ||
- currentSong.youtubeId ===
- 'iYYRH4apXDo' ||
- currentSong.youtubeId ===
- 'tRcPA7Fzebw')
- "
- src="/assets/rocket.svg"
- :style="{
- position: 'absolute',
- top: `-21px`,
- left: `calc(${seekerbarPercentage}% - 35px)`,
- width: '50px',
- transform: 'rotate(45deg)'
- }"
- />
- <img
- v-if="
- currentSong &&
- currentSong.youtubeId === 'jofNR_WkoCE'
- "
- src="/assets/fox.svg"
- :style="{
- position: 'absolute',
- top: `-21px`,
- left: `calc(${seekerbarPercentage}% - 35px)`,
- width: '50px',
- transform: 'scaleX(-1)',
- opacity: 1
- }"
- />
- <img
- v-if="
- currentSong &&
- (currentSong.youtubeId ===
- 'l9PxOanFjxQ' ||
- currentSong.youtubeId ===
- 'xKVcVSYmesU' ||
- currentSong.youtubeId ===
- '60ItHLz5WEA' ||
- currentSong.youtubeId ===
- 'e6vkFbtSGm0')
- "
- src="/assets/old_logo.png"
- :style="{
- position: 'absolute',
- top: `-9px`,
- left: `calc(${seekerbarPercentage}% - 22px)`,
- 'background-color': 'rgb(96, 199, 169)',
- width: '25px',
- height: '25px',
- 'border-radius': '25px'
- }"
- />
- </div>
- <div id="control-bar-container">
- <div id="left-buttons">
- <!-- Debug Box -->
- <button
- v-if="frontendDevMode === 'development'"
- class="button is-primary"
- @click="togglePlayerDebugBox()"
- @dblclick="resetPlayerDebugBox()"
- content="Debug"
- v-tippy
- >
- <i
- class="
- material-icons
- icon-with-button
- "
- >
- bug_report
- </i>
- </button>
- <!-- Local Pause/Resume Button -->
- <button
- class="button is-primary"
- @click="resumeLocalStation()"
- id="local-resume"
- v-if="localPaused"
- content="Unpause Playback"
- v-tippy
- >
- <i class="material-icons">play_arrow</i>
- </button>
- <button
- class="button is-primary"
- @click="pauseLocalStation()"
- id="local-pause"
- v-else
- content="Pause Playback"
- v-tippy
- >
- <i class="material-icons">pause</i>
- </button>
- <!-- Vote to Skip Button -->
- <button
- v-if="!skipVotesLoaded"
- class="button is-primary disabled"
- content="Skip votes have not been loaded yet"
- v-tippy
- >
- <i
- class="
- material-icons
- icon-with-button
- "
- >skip_next</i
- >
- </button>
- <button
- v-else-if="loggedIn"
- class="button is-primary"
- @click="voteSkipStation()"
- content="Vote to Skip Song"
- v-tippy
- >
- <i
- class="
- material-icons
- icon-with-button
- "
- >skip_next</i
- >
- {{ currentSong.skipVotes }}
- </button>
- <button
- v-else
- class="button is-primary disabled"
- content="Log in to vote to skip songs"
- v-tippy="{ theme: 'info' }"
- >
- <i
- class="
- material-icons
- icon-with-button
- "
- >skip_next</i
- >
- {{ currentSong.skipVotes }}
- </button>
- </div>
- <div id="duration">
- <p>
- {{ timeElapsed }} /
- {{
- utils.formatTime(
- currentSong.duration
- )
- }}
- </p>
- </div>
- <p id="volume-control" v-if="!isApple">
- <i
- v-if="muted"
- class="material-icons"
- @click="toggleMute()"
- content="Unmute"
- v-tippy
- >volume_mute</i
- >
- <i
- v-else
- class="material-icons"
- @click="toggleMute()"
- content="Mute"
- v-tippy
- >volume_down</i
- >
- <input
- v-model="volumeSliderValue"
- type="range"
- min="0"
- max="10000"
- class="volume-slider active"
- @change="changeVolume()"
- @input="changeVolume()"
- />
- <i
- class="material-icons"
- @click="increaseVolume()"
- content="Increase Volume"
- v-tippy
- >volume_up</i
- >
- </p>
- <div id="right-buttons" v-if="loggedIn">
- <!-- Ratings (Like/Dislike) Buttons -->
- <div
- id="ratings"
- v-if="ratingsLoaded && ownRatingsLoaded"
- :class="{
- liked: currentSong.liked,
- disliked: currentSong.disliked
- }"
- >
- <!-- Like Song Button -->
- <button
- class="button is-success like-song"
- id="like-song"
- @click="toggleLike()"
- content="Like Song"
- v-tippy
- >
- <i
- class="
- material-icons
- icon-with-button
- "
- :class="{
- liked: currentSong.liked
- }"
- >thumb_up_alt</i
- >{{ currentSong.likes }}
- </button>
- <!-- Dislike Song Button -->
- <button
- class="
- button
- is-danger
- dislike-song
- "
- id="dislike-song"
- @click="toggleDislike()"
- content="Dislike Song"
- v-tippy
- >
- <i
- class="
- material-icons
- icon-with-button
- "
- :class="{
- disliked:
- currentSong.disliked
- }"
- >thumb_down_alt</i
- >{{ currentSong.dislikes }}
- </button>
- </div>
- <div id="ratings" class="disabled" v-else>
- <!-- Like Song Button -->
- <button
- class="
- button
- is-success
- like-song
- disabled
- "
- id="like-song"
- content="Ratings have not been loaded yet"
- v-tippy
- >
- <i
- class="
- material-icons
- icon-with-button
- "
- >thumb_up_alt</i
- >
- </button>
- <!-- Dislike Song Button -->
- <button
- class="
- button
- is-danger
- dislike-song
- disabled
- "
- id="dislike-song"
- content="Ratings have not been loaded yet"
- v-tippy
- >
- <i
- class="
- material-icons
- icon-with-button
- "
- >thumb_down_alt</i
- >
- </button>
- </div>
- <!-- Add Song To Playlist Button & Dropdown -->
- <add-to-playlist-dropdown
- :song="currentSong"
- placement="top-end"
- >
- <template #button>
- <div
- id="add-song-to-playlist"
- content="Add Song to Playlist"
- v-tippy
- >
- <div class="control has-addons">
- <button
- class="
- button
- is-primary
- "
- >
- <i
- class="
- material-icons
- "
- >
- playlist_add
- </i>
- </button>
- <button
- class="button"
- id="dropdown-toggle"
- >
- <i
- class="
- material-icons
- "
- >
- {{
- showPlaylistDropdown
- ? "expand_more"
- : "expand_less"
- }}
- </i>
- </button>
- </div>
- </div>
- </template>
- </add-to-playlist-dropdown>
- </div>
- <div id="right-buttons" v-else>
- <!-- Disabled Ratings (Like/Dislike) Buttons -->
- <div id="ratings" v-if="ratingsLoaded">
- <!-- Disabled Like Song Button -->
- <button
- class="button is-success disabled"
- id="like-song"
- content="Log in to like songs"
- v-tippy="{ theme: 'info' }"
- >
- <i
- class="
- material-icons
- icon-with-button
- "
- >thumb_up_alt</i
- >{{ currentSong.likes }}
- </button>
- <!-- Disabled Dislike Song Button -->
- <button
- class="button is-danger disabled"
- id="dislike-song"
- content="Log in to dislike songs"
- v-tippy="{ theme: 'info' }"
- >
- <i
- class="
- material-icons
- icon-with-button
- "
- >thumb_down_alt</i
- >{{ currentSong.dislikes }}
- </button>
- </div>
- <div id="ratings" v-else>
- <!-- Disabled Like Song Button -->
- <button
- class="button is-success disabled"
- id="like-song"
- content="Ratings have not been loaded yet"
- v-tippy="{ theme: 'info' }"
- >
- <i
- class="
- material-icons
- icon-with-button
- "
- >thumb_up_alt</i
- >
- </button>
- <!-- Disabled Dislike Song Button -->
- <button
- class="button is-danger disabled"
- id="dislike-song"
- content="Ratings have not been loaded yet"
- v-tippy="{ theme: 'info' }"
- >
- <i
- class="
- material-icons
- icon-with-button
- "
- >thumb_down_alt</i
- >
- </button>
- </div>
- <!-- Disabled Add Song To Playlist Button & Dropdown -->
- <div id="add-song-to-playlist">
- <div class="control has-addons">
- <button
- class="
- button
- is-primary
- disabled
- "
- content="Log in to add songs to playlist"
- v-tippy="{ theme: 'info' }"
- >
- <i class="material-icons"
- >queue</i
- >
- </button>
- </div>
- </div>
- </div>
- </div>
- </div>
- <p
- class="player-container nothing-here-text"
- v-if="noSong"
- >
- No song is currently playing
- </p>
- <div v-if="!noSong" id="current-next-row">
- <div
- id="currently-playing-container"
- class="quadrant"
- :class="{ 'no-currently-playing': noSong }"
- >
- <song-item
- :song="currentSong"
- :duration="false"
- :requested-by="
- station.type === 'community' &&
- station.partyMode === true
- "
- header="Currently Playing.."
- />
- </div>
- <div
- v-if="nextSong"
- id="next-up-container"
- class="quadrant"
- >
- <song-item
- :song="nextSong"
- :duration="false"
- :requested-by="
- station.type === 'community' &&
- station.partyMode === true
- "
- header="Next Up.."
- />
- </div>
- </div>
- </div>
- </div>
- <request-song v-if="modals.requestSong" />
- <edit-playlist v-if="modals.editPlaylist" />
- <create-playlist v-if="modals.createPlaylist" />
- <manage-station
- v-if="modals.manageStation"
- :station-id="station._id"
- sector="station"
- />
- <edit-song
- v-if="modals.editSong"
- song-type="songs"
- sector="station"
- />
- <report v-if="modals.report" />
- </div>
- <main-footer />
- </div>
- <floating-box id="player-debug-box" ref="playerDebugBox">
- <template #body>
- <span><b>No song</b>: {{ noSong }}</span>
- <span><b>Song id</b>: {{ currentSong._id }}</span>
- <span><b>YouTube id</b>: {{ currentSong.youtubeId }}</span>
- <span><b>Duration</b>: {{ currentSong.duration }}</span>
- <span
- ><b>Skip duration</b>: {{ currentSong.skipDuration }}</span
- >
- <span><b>Loading</b>: {{ loading }}</span>
- <span><b>Can autoplay</b>: {{ canAutoplay }}</span>
- <span><b>Player ready</b>: {{ playerReady }}</span>
- <span
- ><b>Attempts to play video</b>:
- {{ attemptsToPlayVideo }}</span
- >
- <span
- ><b>Last time requested if can autoplay</b>:
- {{ lastTimeRequestedIfCanAutoplay }}</span
- >
- <span><b>Seeking</b>: {{ seeking }}</span>
- <span><b>Playback rate</b>: {{ playbackRate }}</span>
- <span><b>System difference</b>: {{ systemDifference }}</span>
- <span><b>Time before paused</b>: {{ timeBeforePause }}</span>
- <span><b>Time paused</b>: {{ timePaused }}</span>
- <span><b>Time elapsed</b>: {{ timeElapsed }}</span>
- <span><b>Volume slider value</b>: {{ volumeSliderValue }}</span>
- <span><b>Local paused</b>: {{ localPaused }}</span>
- <span><b>Station paused</b>: {{ stationPaused }}</span>
- <span
- ><b>Party playlists selected</b>: {{ partyPlaylists }}</span
- >
- <span><b>Skip votes loaded</b>: {{ skipVotesLoaded }}</span>
- <span
- ><b>Skip votes current</b>:
- {{
- currentSong.skipVotesCurrent === true ||
- currentSong.skipVotesCurrent === false
- ? currentSong.skipVotesCurrent
- : "N/A"
- }}</span
- >
- <span
- ><b>Skip votes</b>:
- {{ skipVotesLoaded ? currentSong.skipVotes : "N/A" }}</span
- >
- <span><b>Ratings loaded</b>: {{ ratingsLoaded }}</span>
- <span
- ><b>Ratings</b>:
- {{
- ratingsLoaded
- ? `${currentSong.likes} / ${currentSong.dislikes}`
- : "N/A"
- }}</span
- >
- <span><b>Own ratings loaded</b>: {{ ownRatingsLoaded }}</span>
- <span
- ><b>Own ratings</b>:
- {{
- ownRatingsLoaded
- ? `${currentSong.liked} / ${currentSong.disliked}`
- : "N/A"
- }}</span
- >
- </template>
- </floating-box>
- <floating-box
- id="keyboardShortcutsHelper"
- ref="keyboardShortcutsHelper"
- >
- <template #body>
- <div>
- <div v-if="isOwnerOrAdmin()">
- <span class="biggest"><b>Admin/owner</b></span>
- <span><b>Ctrl + Space</b> - Pause/resume station</span>
- <span><b>Ctrl + Numpad right</b> - Skip station</span>
- </div>
- <hr v-if="isOwnerOrAdmin()" />
- <div>
- <span class="biggest"><b>Volume</b></span>
- <span
- ><b>Ctrl + Numpad up/down</b> - Volume up/down
- 10%</span
- >
- <span
- ><b>Ctrl + Shift + Numpad up/down</b> - Volume
- up/down 10%</span
- >
- </div>
- <hr />
- <div>
- <span class="biggest"><b>Misc</b></span>
- <span><b>Ctrl + D</b> - Toggles debug box</span>
- <span><b>Ctrl + Shift + D</b> - Resets debug box</span>
- <span
- ><b>Ctrl + /</b> - Toggles keyboard shortcuts
- box</span
- >
- <span
- ><b>Ctrl + Shift + /</b> - Resets keyboard shortcuts
- box</span
- >
- </div>
- </div>
- </template>
- </floating-box>
- <Z404 v-if="!exists"></Z404>
- </div>
- </template>
- <script>
- import { mapState, mapActions, mapGetters } from "vuex";
- import { defineAsyncComponent } from "vue";
- import Toast from "toasters";
- import { ContentLoader } from "vue-content-loader";
- import aw from "@/aw";
- import ws from "@/ws";
- import keyboardShortcuts from "@/keyboardShortcuts";
- import MainHeader from "@/components/layout/MainHeader.vue";
- import MainFooter from "@/components/layout/MainFooter.vue";
- import FloatingBox from "@/components/FloatingBox.vue";
- import AddToPlaylistDropdown from "@/components/AddToPlaylistDropdown.vue";
- import SongItem from "@/components/SongItem.vue";
- import Z404 from "../404.vue";
- import utils from "../../../js/utils";
- import StationSidebar from "./Sidebar/index.vue";
- export default {
- components: {
- ContentLoader,
- MainHeader,
- MainFooter,
- RequestSong: defineAsyncComponent(() =>
- import("@/components/modals/RequestSong.vue")
- ),
- EditPlaylist: defineAsyncComponent(() =>
- import("@/components/modals/EditPlaylist")
- ),
- CreatePlaylist: defineAsyncComponent(() =>
- import("@/components/modals/CreatePlaylist.vue")
- ),
- ManageStation: defineAsyncComponent(() =>
- import("@/components/modals/ManageStation/index.vue")
- ),
- Report: defineAsyncComponent(() =>
- import("@/components/modals/Report.vue")
- ),
- Z404,
- FloatingBox,
- StationSidebar,
- AddToPlaylistDropdown,
- EditSong: defineAsyncComponent(() =>
- import("@/components/modals/EditSong")
- ),
- SongItem
- },
- data() {
- return {
- utils,
- isApple:
- navigator.platform.match(/iPhone|iPod|iPad/) ||
- navigator.vendor === "Apple Computer, Inc.",
- title: "Station",
- loading: true,
- exists: true,
- playerReady: false,
- player: undefined,
- timePaused: 0,
- muted: false,
- timeElapsed: "0:00",
- timeBeforePause: 0,
- systemDifference: 0,
- attemptsToPlayVideo: 0,
- canAutoplay: true,
- lastTimeRequestedIfCanAutoplay: 0,
- seeking: false,
- playbackRate: 1,
- volumeSliderValue: 0,
- showPlaylistDropdown: false,
- theme: "var(--primary-color)",
- seekerbarPercentage: 0,
- frontendDevMode: "production",
- activityWatchVideoDataInterval: null,
- activityWatchVideoLastStatus: "",
- activityWatchVideoLastYouTubeId: "",
- activityWatchVideoLastStartDuration: "",
- nextCurrentSong: null,
- editSongModalWatcher: null,
- beforeEditSongModalLocalPaused: null,
- socketConnected: null,
- persistentToastCheckerInterval: null,
- persistentToasts: [],
- partyPlaylistLock: false
- };
- },
- computed: {
- skipVotesLoaded() {
- return (
- !this.noSong &&
- Number.isInteger(this.currentSong.skipVotes) &&
- this.currentSong.skipVotes >= 0
- );
- },
- ratingsLoaded() {
- return (
- !this.noSong &&
- Number.isInteger(this.currentSong.likes) &&
- Number.isInteger(this.currentSong.dislikes) &&
- this.currentSong.likes >= 0 &&
- this.currentSong.dislikes >= 0
- );
- },
- ownRatingsLoaded() {
- return (
- !this.noSong &&
- typeof this.currentSong.liked === "boolean" &&
- typeof this.currentSong.disliked === "boolean"
- );
- },
- aModalIsOpen() {
- return Object.keys(this.currentlyActive).length > 0;
- },
- currentUserQueueSongs() {
- return this.songsList.filter(
- queueSong => queueSong.requestedBy === this.userId
- ).length;
- },
- ...mapState("modalVisibility", {
- modals: state => state.modals,
- currentlyActive: state => state.currentlyActive
- }),
- ...mapState("modals/editSong", {
- video: state => state.video
- }),
- ...mapState("station", {
- station: state => state.station,
- currentSong: state => state.currentSong,
- nextSong: state => state.nextSong,
- songsList: state => state.songsList,
- stationPaused: state => state.stationPaused,
- localPaused: state => state.localPaused,
- noSong: state => state.noSong,
- partyPlaylists: state => state.partyPlaylists,
- includedPlaylists: state => state.includedPlaylists,
- excludedPlaylists: state => state.excludedPlaylists
- }),
- ...mapState({
- loggedIn: state => state.user.auth.loggedIn,
- userId: state => state.user.auth.userId,
- role: state => state.user.auth.role,
- nightmode: state => state.user.preferences.nightmode,
- autoSkipDisliked: state => state.user.preferences.autoSkipDisliked
- }),
- ...mapGetters({
- socket: "websockets/getSocket"
- })
- },
- async mounted() {
- this.editSongModalWatcher = this.$store.watch(
- state => state.modals.editSong.video.paused,
- paused => {
- if (paused && !this.beforeEditSongModalLocalPaused) {
- this.resumeLocalStation();
- } else if (!paused) {
- this.beforeEditSongModalLocalPaused = this.localPaused;
- this.pauseLocalStation();
- }
- }
- );
- window.scrollTo(0, 0);
- Date.currently = () => new Date().getTime() + this.systemDifference;
- this.stationIdentifier = this.$route.params.id;
- window.stationInterval = 0;
- this.activityWatchVideoDataInterval = setInterval(() => {
- this.sendActivityWatchVideoData();
- }, 1000);
- this.persistentToastCheckerInterval = setInterval(() => {
- this.persistentToasts.filter(
- persistentToast => !persistentToast.checkIfCanRemove()
- );
- }, 1000);
- if (this.socket.readyState === 1) this.join();
- ws.onConnect(() => {
- this.socketConnected = true;
- clearTimeout(window.stationNextSongTimeout);
- this.join();
- });
- ws.onDisconnect(true, () => {
- this.socketConnected = false;
- const { currentSong } = this.currentSong;
- if (this.nextSong)
- this.setNextCurrentSong(
- {
- currentSong: this.nextSong,
- startedAt: Date.now() + this.getTimeRemaining(),
- paused: false,
- timePaused: 0
- },
- true
- );
- else
- this.setNextCurrentSong(
- {
- currentSong: null,
- startedAt: 0,
- paused: false,
- timePaused: 0,
- pausedAt: 0
- },
- true
- );
- window.stationNextSongTimeout = setTimeout(() => {
- if (!this.noSong && this.currentSong._id === currentSong._id)
- this.skipSong("window.stationNextSongTimeout 2");
- }, this.getTimeRemaining());
- });
- this.frontendDevMode = await lofig.get("mode");
- this.socket.dispatch(
- "stations.existsByName",
- this.stationIdentifier,
- res => {
- if (res.status === "error" || !res.data.exists) {
- // station identifier may be using stationid instead
- this.socket.dispatch(
- "stations.existsById",
- this.stationIdentifier,
- res => {
- if (res.status === "error" || !res.data.exists) {
- this.loading = false;
- this.exists = false;
- }
- }
- );
- }
- }
- );
- this.socket.on("event:station.nextSong", res => {
- const { currentSong, startedAt, paused, timePaused } = res.data;
- this.setCurrentSong({
- currentSong,
- startedAt,
- paused,
- timePaused,
- pausedAt: 0
- });
- });
- this.socket.on("event:station.pause", res => {
- this.pausedAt = res.data.pausedAt;
- this.updateStationPaused(true);
- this.pauseLocalPlayer();
- clearTimeout(window.stationNextSongTimeout);
- });
- this.socket.on("event:station.resume", res => {
- this.timePaused = res.data.timePaused;
- this.updateStationPaused(false);
- if (!this.localPaused) this.resumeLocalPlayer();
- });
- this.socket.on("event:station.deleted", () => {
- window.location.href = "/?msg=The station you were in was deleted.";
- return true;
- });
- this.socket.on("event:song.liked", res => {
- if (!this.noSong) {
- if (res.data.youtubeId === this.currentSong.youtubeId) {
- this.updateCurrentSongRatings(res.data);
- }
- }
- });
- this.socket.on("event:song.disliked", res => {
- if (!this.noSong) {
- if (res.data.youtubeId === this.currentSong.youtubeId) {
- this.updateCurrentSongRatings(res.data);
- }
- }
- });
- this.socket.on("event:song.unliked", res => {
- if (!this.noSong) {
- if (res.data.youtubeId === this.currentSong.youtubeId) {
- this.updateCurrentSongRatings(res.data);
- }
- }
- });
- this.socket.on("event:song.undisliked", res => {
- if (!this.noSong) {
- if (res.data.youtubeId === this.currentSong.youtubeId) {
- this.updateCurrentSongRatings(res.data);
- }
- }
- });
- this.socket.on("event:song.ratings.updated", res => {
- if (!this.noSong) {
- if (res.data.youtubeId === this.currentSong.youtubeId) {
- this.updateOwnCurrentSongRatings(res.data);
- }
- }
- });
- this.socket.on("event:station.queue.updated", res => {
- this.updateSongsList(res.data.queue);
- let nextSong = null;
- if (this.songsList[0])
- nextSong = this.songsList[0].youtubeId
- ? this.songsList[0]
- : null;
- this.updateNextSong(nextSong);
- this.addPartyPlaylistSongToQueue();
- });
- this.socket.on("event:station.queue.song.repositioned", res => {
- this.repositionSongInList(res.data.song);
- let nextSong = null;
- if (this.songsList[0])
- nextSong = this.songsList[0].youtubeId
- ? this.songsList[0]
- : null;
- this.updateNextSong(nextSong);
- });
- this.socket.on("event:station.voteSkipSong", () => {
- if (this.currentSong)
- this.updateCurrentSongSkipVotes({
- skipVotes: this.currentSong.skipVotes + 1,
- skipVotesCurrent: null
- });
- });
- this.socket.on("event:privatePlaylist.selected", res => {
- if (this.station.type === "community")
- this.station.privatePlaylist = res.data.playlistId;
- });
- this.socket.on("event:privatePlaylist.deselected", () => {
- if (this.station.type === "community")
- this.station.privatePlaylist = null;
- });
- this.socket.on("event:station.partyMode.updated", res => {
- if (this.station.type === "community")
- this.station.partyMode = res.data.partyMode;
- });
- this.socket.on("event:station.theme.updated", res => {
- const { theme } = res.data;
- this.station.theme = theme;
- document.body.style.cssText = `--primary-color: var(--${theme})`;
- });
- this.socket.on("event:station.name.updated", async res => {
- this.station.name = res.data.name;
- await this.$router.push(
- `${res.data.name}?${Object.keys(this.$route.query)
- .map(
- key =>
- `${encodeURIComponent(key)}=${encodeURIComponent(
- this.$route.query[key]
- )}`
- )
- .join("&")}`
- );
- // eslint-disable-next-line no-restricted-globals
- history.replaceState({ ...history.state, ...{} }, null);
- });
- this.socket.on("event:station.displayName.updated", res => {
- this.station.displayName = res.data.displayName;
- });
- this.socket.on("event:station.description.updated", res => {
- this.station.description = res.data.description;
- });
- this.socket.on("event:station.users.updated", res =>
- this.updateUsers(res.data.users)
- );
- this.socket.on("event:station.userCount.updated", res =>
- this.updateUserCount(res.data.userCount)
- );
- this.socket.on("event:station.queue.lock.toggled", res => {
- this.station.locked = res.data.locked;
- });
- this.socket.on("event:user.station.favorited", res => {
- if (res.data.stationId === this.station._id)
- this.updateIfStationIsFavorited({ isFavorited: true });
- });
- this.socket.on("event:user.station.unfavorited", res => {
- if (res.data.stationId === this.station._id)
- this.updateIfStationIsFavorited({ isFavorited: false });
- });
- if (JSON.parse(localStorage.getItem("muted"))) {
- this.muted = true;
- this.player.setVolume(0);
- this.volumeSliderValue = 0 * 100;
- } else {
- let volume = parseFloat(localStorage.getItem("volume"));
- volume =
- typeof volume === "number" && !Number.isNaN(volume)
- ? volume
- : 20;
- localStorage.setItem("volume", volume);
- this.volumeSliderValue = volume * 100;
- }
- },
- beforeUnmount() {
- document.body.style.cssText = "";
- /** Reset Songslist */
- this.updateSongsList([]);
- const shortcutNames = [
- "station.pauseResume",
- "station.skipStation",
- "station.lowerVolumeLarge",
- "station.lowerVolumeSmall",
- "station.increaseVolumeLarge",
- "station.increaseVolumeSmall",
- "station.toggleDebug"
- ];
- shortcutNames.forEach(shortcutName => {
- keyboardShortcuts.unregisterShortcut(shortcutName);
- });
- this.editSongModalWatcher(); // removes the watcher
- clearInterval(this.activityWatchVideoDataInterval);
- clearTimeout(window.stationNextSongTimeout);
- clearTimeout(this.persistentToastCheckerInterval);
- this.persistentToasts.forEach(persistentToast => {
- persistentToast.toast.destroy();
- });
- this.socket.dispatch("stations.leave", this.station._id, () => {});
- this.leaveStation();
- },
- methods: {
- isOwnerOnly() {
- return this.loggedIn && this.userId === this.station.owner;
- },
- isAdminOnly() {
- return this.loggedIn && this.role === "admin";
- },
- isOwnerOrAdmin() {
- return this.isOwnerOnly() || this.isAdminOnly();
- },
- removeFromQueue(youtubeId) {
- window.socket.dispatch(
- "stations.removeFromQueue",
- this.station._id,
- youtubeId,
- res => {
- if (res.status === "success") {
- new Toast("Successfully removed song from the queue.");
- } else new Toast(res.message);
- }
- );
- },
- setNextCurrentSong(nextCurrentSong, skipSkipCheck = false) {
- this.nextCurrentSong = nextCurrentSong;
- // If skipSkipCheck is true, it won't try to skip the song
- if (this.getTimeRemaining() <= 0 && !skipSkipCheck) {
- this.skipSong();
- }
- },
- skipSong() {
- if (this.nextCurrentSong && this.nextCurrentSong.currentSong) {
- const songsList = this.songsList.concat([]);
- if (
- songsList.length > 0 &&
- songsList[0].youtubeId ===
- this.nextCurrentSong.currentSong.youtubeId
- ) {
- songsList.splice(0, 1);
- this.updateSongsList(songsList);
- }
- this.setCurrentSong(this.nextCurrentSong);
- } else {
- this.setCurrentSong({
- currentSong: null,
- startedAt: 0,
- paused: this.stationPaused,
- timePaused: 0,
- pausedAt: 0
- });
- }
- },
- setCurrentSong(data) {
- const { currentSong, startedAt, paused, timePaused, pausedAt } =
- data;
- if (currentSong) {
- if (!currentSong.skipDuration || currentSong.skipDuration < 0)
- currentSong.skipDuration = 0;
- if (!currentSong.duration || currentSong.duration < 0)
- currentSong.duration = 0;
- }
- this.updateCurrentSong(currentSong || {});
- let nextSong = null;
- if (this.songsList[0])
- nextSong = this.songsList[0].youtubeId
- ? this.songsList[0]
- : null;
- this.updateNextSong(nextSong);
- this.setNextCurrentSong(
- {
- currentSong: null,
- startedAt: 0,
- paused,
- timePaused: 0,
- pausedAt: 0
- },
- true
- );
- clearTimeout(window.stationNextSongTimeout);
- this.startedAt = startedAt;
- this.updateStationPaused(paused);
- this.timePaused = timePaused;
- this.pausedAt = pausedAt;
- if (currentSong) {
- this.updateNoSong(false);
- if (!this.playerReady) this.youtubeReady();
- else this.playVideo();
- // If the station is playing and the backend is not connected, set the next song to skip to after this song and set a timer to skip
- if (!this.stationPaused && !this.socketConnected) {
- if (this.nextSong)
- this.setNextCurrentSong(
- {
- currentSong: this.nextSong,
- startedAt: Date.now() + this.getTimeRemaining(),
- paused: false,
- timePaused: 0
- },
- true
- );
- else
- this.setNextCurrentSong(
- {
- currentSong: null,
- startedAt: 0,
- paused: false,
- timePaused: 0,
- pausedAt: 0
- },
- true
- );
- window.stationNextSongTimeout = setTimeout(() => {
- if (
- !this.noSong &&
- this.currentSong._id === currentSong._id
- )
- this.skipSong("window.stationNextSongTimeout 1");
- }, this.getTimeRemaining());
- }
- const currentSongId = this.currentSong._id;
- this.socket.dispatch(
- "stations.getSkipVotes",
- this.station._id,
- currentSongId,
- res => {
- if (res.status === "success") {
- const { skipVotes, skipVotesCurrent } = res.data;
- if (
- !this.noSong &&
- this.currentSong._id === currentSongId
- ) {
- this.updateCurrentSongSkipVotes({
- skipVotes,
- skipVotesCurrent
- });
- }
- }
- }
- );
- this.socket.dispatch(
- "songs.getSongRatings",
- currentSong._id,
- res => {
- if (currentSong._id === this.currentSong._id) {
- const { likes, dislikes } = res.data;
- this.updateCurrentSongRatings({ likes, dislikes });
- }
- }
- );
- if (this.loggedIn) {
- this.socket.dispatch(
- "songs.getOwnSongRatings",
- currentSong.youtubeId,
- res => {
- console.log("getOwnSongRatings", res);
- if (
- res.status === "success" &&
- this.currentSong.youtubeId ===
- res.data.youtubeId
- ) {
- this.updateOwnCurrentSongRatings(res.data);
- if (
- this.autoSkipDisliked &&
- res.data.disliked === true
- ) {
- this.voteSkipStation();
- new Toast(
- "Automatically voted to skip disliked song."
- );
- }
- }
- }
- );
- }
- } else {
- if (this.playerReady) this.player.pauseVideo();
- this.updateNoSong(true);
- }
- this.calculateTimeElapsed();
- this.resizeSeekerbar();
- },
- youtubeReady() {
- if (!this.player) {
- this.player = new window.YT.Player("stationPlayer", {
- height: 270,
- width: 480,
- videoId: this.currentSong.youtubeId,
- host: "https://www.youtube-nocookie.com",
- startSeconds:
- this.getTimeElapsed() / 1000 +
- this.currentSong.skipDuration,
- playerVars: {
- controls: 0,
- iv_load_policy: 3,
- rel: 0,
- showinfo: 0,
- disablekb: 1,
- playsinline: 1
- },
- events: {
- onReady: () => {
- this.playerReady = true;
- let volume = parseInt(
- localStorage.getItem("volume")
- );
- volume = typeof volume === "number" ? volume : 20;
- this.player.setVolume(volume);
- if (volume > 0) this.player.unMute();
- if (this.muted) this.player.mute();
- this.playVideo();
- // on ios, playback will be forcibly paused locally
- if (this.isApple) {
- this.updateLocalPaused(true);
- new Toast(
- "Please click play manually to use Musare on iOS."
- );
- }
- },
- onError: err => {
- console.log("error with youtube video", err);
- if (err.data === 150 && this.loggedIn) {
- new Toast(
- "Automatically voted to skip as this song isn't available for you."
- );
- // automatically vote to skip
- this.voteSkipStation();
- // persistent message while song is playing
- const persistentToast = new Toast({
- content:
- "This song is unavailable for you, but is playing for everyone else.",
- persistent: true
- });
- // save current song id
- const erroredYoutubeId =
- this.currentSong.youtubeId;
- this.persistentToasts.push({
- toast: persistentToast,
- checkIfCanRemove: () => {
- if (
- this.currentSong.youtubeId !==
- erroredYoutubeId
- ) {
- persistentToast.destroy();
- return true;
- }
- return false;
- }
- });
- } else {
- new Toast(
- "There has been an error with the YouTube Embed"
- );
- }
- },
- onStateChange: event => {
- if (
- event.data === window.YT.PlayerState.PLAYING &&
- this.videoLoading === true
- ) {
- this.videoLoading = false;
- this.player.seekTo(
- this.getTimeElapsed() / 1000 +
- this.currentSong.skipDuration,
- true
- );
- this.canAutoplay = true;
- if (this.localPaused || this.stationPaused)
- this.player.pauseVideo();
- } else if (
- event.data === window.YT.PlayerState.PLAYING &&
- (this.localPaused || this.stationPaused)
- ) {
- this.player.seekTo(
- this.timeBeforePause / 1000,
- true
- );
- this.player.pauseVideo();
- } else if (
- event.data === window.YT.PlayerState.PLAYING &&
- this.seeking === true
- )
- this.seeking = false;
- if (
- event.data === window.YT.PlayerState.PAUSED &&
- !this.localPaused &&
- !this.stationPaused &&
- !this.noSong &&
- this.player.getDuration() / 1000 <
- this.currentSong.duration
- ) {
- this.player.seekTo(
- this.getTimeElapsed() / 1000 +
- this.currentSong.skipDuration,
- true
- );
- this.player.playVideo();
- }
- }
- }
- });
- }
- },
- getTimeElapsed() {
- if (this.currentSong) {
- let { timePaused } = this;
- if (this.stationPaused)
- timePaused += Date.currently() - this.pausedAt;
- return Date.currently() - this.startedAt - timePaused;
- }
- return 0;
- },
- getTimeRemaining() {
- if (this.currentSong) {
- return this.currentSong.duration * 1000 - this.getTimeElapsed();
- }
- return 0;
- },
- playVideo() {
- if (this.playerReady) {
- this.videoLoading = true;
- this.player.loadVideoById(
- this.currentSong.youtubeId,
- this.getTimeElapsed() / 1000 + this.currentSong.skipDuration
- );
- if (window.stationInterval !== 0)
- clearInterval(window.stationInterval);
- window.stationInterval = setInterval(() => {
- if (!this.stationPaused) {
- this.resizeSeekerbar();
- this.calculateTimeElapsed();
- }
- }, 150);
- }
- },
- resizeSeekerbar() {
- this.seekerbarPercentage = parseFloat(
- (this.getTimeElapsed() / 1000 / this.currentSong.duration) * 100
- );
- },
- calculateTimeElapsed() {
- if (
- this.playerReady &&
- !this.noSong &&
- this.currentSong &&
- this.player.getPlayerState() === -1
- ) {
- if (!this.canAutoplay) {
- if (
- Date.now() - this.lastTimeRequestedIfCanAutoplay >
- 2000
- ) {
- this.lastTimeRequestedIfCanAutoplay = Date.now();
- window.canAutoplay.video().then(({ result }) => {
- if (result) {
- this.attemptsToPlayVideo = 0;
- this.canAutoplay = true;
- } else {
- this.canAutoplay = false;
- }
- });
- }
- } else {
- this.player.playVideo();
- this.attemptsToPlayVideo += 1;
- }
- }
- if (
- !this.stationPaused &&
- !this.localPaused &&
- this.playerReady &&
- !this.isApple
- ) {
- const timeElapsed = this.getTimeElapsed();
- const currentPlayerTime =
- Math.max(
- this.player.getCurrentTime() -
- this.currentSong.skipDuration,
- 0
- ) * 1000;
- const difference = timeElapsed - currentPlayerTime;
- let playbackRate = 1;
- if (difference < -2000) {
- if (!this.seeking) {
- this.seeking = true;
- this.player.seekTo(
- this.getTimeElapsed() / 1000 +
- this.currentSong.skipDuration
- );
- }
- } else if (difference < -200) {
- playbackRate = 0.8;
- } else if (difference < -50) {
- playbackRate = 0.9;
- } else if (difference < -25) {
- playbackRate = 0.95;
- } else if (difference > 2000) {
- if (!this.seeking) {
- this.seeking = true;
- this.player.seekTo(
- this.getTimeElapsed() / 1000 +
- this.currentSong.skipDuration
- );
- }
- } else if (difference > 200) {
- playbackRate = 1.2;
- } else if (difference > 50) {
- playbackRate = 1.1;
- } else if (difference > 25) {
- playbackRate = 1.05;
- } else if (this.player.getPlaybackRate !== 1.0) {
- this.player.setPlaybackRate(1.0);
- }
- if (this.playbackRate !== playbackRate) {
- this.player.setPlaybackRate(playbackRate);
- this.playbackRate = playbackRate;
- }
- }
- let { timePaused } = this;
- if (this.stationPaused)
- timePaused += Date.currently() - this.pausedAt;
- const duration =
- (Date.currently() - this.startedAt - timePaused) / 1000;
- const songDuration = this.currentSong.duration;
- if (songDuration <= duration) this.player.pauseVideo();
- if (duration <= songDuration)
- this.timeElapsed = utils.formatTime(duration);
- },
- toggleLock() {
- window.socket.dispatch(
- "stations.toggleLock",
- this.station._id,
- res => {
- if (res.status === "success") {
- new Toast("Successfully toggled the queue lock.");
- } else new Toast(res.message);
- }
- );
- },
- changeVolume() {
- const volume = this.volumeSliderValue;
- localStorage.setItem("volume", volume / 100);
- if (this.playerReady) {
- this.player.setVolume(volume / 100);
- if (volume > 0) {
- this.player.unMute();
- localStorage.setItem("muted", false);
- this.muted = false;
- }
- }
- },
- resumeLocalStation() {
- this.updateLocalPaused(false);
- if (!this.stationPaused) this.resumeLocalPlayer();
- },
- pauseLocalStation() {
- this.updateLocalPaused(true);
- this.pauseLocalPlayer();
- },
- resumeLocalPlayer() {
- if (!this.noSong) {
- if (this.playerReady) {
- this.player.seekTo(
- this.getTimeElapsed() / 1000 +
- this.currentSong.skipDuration
- );
- this.player.playVideo();
- }
- }
- },
- pauseLocalPlayer() {
- if (!this.noSong) {
- this.timeBeforePause = this.getTimeElapsed();
- if (this.playerReady) this.player.pauseVideo();
- }
- },
- skipStation() {
- this.socket.dispatch(
- "stations.forceSkip",
- this.station._id,
- data => {
- if (data.status !== "success")
- new Toast(`Error: ${data.message}`);
- else
- new Toast(
- "Successfully skipped the station's current song."
- );
- }
- );
- },
- voteSkipStation() {
- this.socket.dispatch(
- "stations.voteSkip",
- this.station._id,
- data => {
- if (data.status !== "success")
- new Toast(`Error: ${data.message}`);
- else
- new Toast(
- "Successfully voted to skip the current song."
- );
- }
- );
- },
- resumeStation() {
- this.socket.dispatch("stations.resume", this.station._id, data => {
- if (data.status !== "success")
- new Toast(`Error: ${data.message}`);
- else new Toast("Successfully resumed the station.");
- });
- },
- pauseStation() {
- this.socket.dispatch("stations.pause", this.station._id, data => {
- if (data.status !== "success")
- new Toast(`Error: ${data.message}`);
- else new Toast("Successfully paused the station.");
- });
- },
- toggleMute() {
- if (this.playerReady) {
- const previousVolume = parseFloat(
- localStorage.getItem("volume")
- );
- const volume =
- this.player.getVolume() * 100 <= 0 ? previousVolume : 0;
- this.muted = !this.muted;
- localStorage.setItem("muted", this.muted);
- this.volumeSliderValue = volume * 100;
- this.player.setVolume(volume);
- if (!this.muted) localStorage.setItem("volume", volume);
- }
- },
- increaseVolume() {
- if (this.playerReady) {
- const previousVolume = parseInt(localStorage.getItem("volume"));
- let volume = previousVolume + 5;
- if (previousVolume === 0) {
- this.muted = false;
- localStorage.setItem("muted", false);
- }
- if (volume > 100) volume = 100;
- this.volumeSliderValue = volume * 100;
- this.player.setVolume(volume);
- localStorage.setItem("volume", volume);
- }
- },
- toggleLike() {
- if (this.currentSong.liked)
- this.socket.dispatch(
- "songs.unlike",
- this.currentSong.youtubeId,
- res => {
- if (res.status !== "success")
- new Toast(`Error: ${res.message}`);
- }
- );
- else
- this.socket.dispatch(
- "songs.like",
- this.currentSong.youtubeId,
- res => {
- if (res.status !== "success")
- new Toast(`Error: ${res.message}`);
- }
- );
- },
- toggleDislike() {
- if (this.currentSong.disliked)
- return this.socket.dispatch(
- "songs.undislike",
- this.currentSong.youtubeId,
- res => {
- if (res.status !== "success")
- new Toast(`Error: ${res.message}`);
- }
- );
- return this.socket.dispatch(
- "songs.dislike",
- this.currentSong.youtubeId,
- res => {
- if (res.status !== "success")
- new Toast(`Error: ${res.message}`);
- }
- );
- },
- addPartyPlaylistSongToQueue() {
- if (
- !this.partyPlaylistLock &&
- this.station.type === "community" &&
- this.station.partyMode === true &&
- this.songsList.length < 50 &&
- this.currentUserQueueSongs < 3 &&
- this.partyPlaylists.length > 0
- ) {
- const selectedPlaylist =
- this.partyPlaylists[
- Math.floor(Math.random() * this.partyPlaylists.length)
- ];
- if (selectedPlaylist._id && selectedPlaylist.songs.length > 0) {
- const selectedSong =
- selectedPlaylist.songs[
- Math.floor(
- Math.random() * selectedPlaylist.songs.length
- )
- ];
- if (selectedSong.youtubeId) {
- this.partyPlaylistLock = true;
- this.socket.dispatch(
- "stations.addToQueue",
- this.station._id,
- selectedSong.youtubeId,
- data => {
- this.partyPlaylistLock = false;
- if (data.status !== "success")
- this.addPartyPlaylistSongToQueue();
- }
- );
- }
- }
- }
- },
- togglePlayerDebugBox() {
- this.$refs.playerDebugBox.toggleBox();
- },
- resetPlayerDebugBox() {
- this.$refs.playerDebugBox.resetBox();
- },
- toggleKeyboardShortcutsHelper() {
- this.$refs.keyboardShortcutsHelper.toggleBox();
- },
- resetKeyboardShortcutsHelper() {
- this.$refs.keyboardShortcutsHelper.resetBox();
- },
- join() {
- this.socket.dispatch(
- "stations.join",
- this.stationIdentifier,
- res => {
- if (res.status === "success") {
- setTimeout(() => {
- this.loading = false;
- }, 1000); // prevents popping in of youtube embed etc.
- const {
- _id,
- displayName,
- name,
- description,
- privacy,
- locked,
- partyMode,
- owner,
- privatePlaylist,
- includedPlaylists,
- excludedPlaylists,
- type,
- genres,
- blacklistedGenres,
- isFavorited,
- theme
- } = res.data;
- // change url to use station name instead of station id
- if (name !== this.stationIdentifier) {
- // eslint-disable-next-line no-restricted-globals
- this.$router.replace(name);
- }
- this.joinStation({
- _id,
- name,
- displayName,
- description,
- privacy,
- locked,
- partyMode,
- owner,
- privatePlaylist,
- includedPlaylists,
- excludedPlaylists,
- type,
- genres,
- blacklistedGenres,
- isFavorited,
- theme
- });
- document.body.style.cssText = `--primary-color: var(--${res.data.theme})`;
- this.setCurrentSong({
- currentSong: res.data.currentSong,
- startedAt: res.data.startedAt,
- paused: res.data.paused,
- timePaused: res.data.timePaused,
- pausedAt: res.data.pausedAt
- });
- this.updateUserCount(res.data.userCount);
- this.updateUsers(res.data.users);
- this.socket.dispatch(
- "stations.getStationIncludedPlaylistsById",
- this.station._id,
- res => {
- if (res.status === "success") {
- this.setIncludedPlaylists(
- res.data.playlists
- );
- }
- }
- );
- this.socket.dispatch(
- "stations.getStationExcludedPlaylistsById",
- this.station._id,
- res => {
- if (res.status === "success") {
- this.setExcludedPlaylists(
- res.data.playlists
- );
- }
- }
- );
- this.socket.dispatch("stations.getQueue", _id, res => {
- if (res.status === "success") {
- const { queue } = res.data;
- this.updateSongsList(queue);
- const [nextSong] = queue;
- this.updateNextSong(nextSong);
- }
- });
- if (this.isOwnerOrAdmin()) {
- keyboardShortcuts.registerShortcut(
- "station.pauseResume",
- {
- keyCode: 32, // Spacebar
- shift: false,
- ctrl: true,
- preventDefault: true,
- handler: () => {
- if (this.aModalIsOpen) return;
- if (this.stationPaused)
- this.resumeStation();
- else this.pauseStation();
- }
- }
- );
- keyboardShortcuts.registerShortcut(
- "station.skipStation",
- {
- keyCode: 39, // Right arrow key
- shift: false,
- ctrl: true,
- preventDefault: true,
- handler: () => {
- if (this.aModalIsOpen) return;
- this.skipStation();
- }
- }
- );
- }
- keyboardShortcuts.registerShortcut(
- "station.lowerVolumeLarge",
- {
- keyCode: 40, // Down arrow key
- shift: false,
- ctrl: true,
- preventDefault: true,
- handler: () => {
- if (this.aModalIsOpen) return;
- this.volumeSliderValue -= 1000;
- this.changeVolume();
- }
- }
- );
- keyboardShortcuts.registerShortcut(
- "station.lowerVolumeSmall",
- {
- keyCode: 40, // Down arrow key
- shift: true,
- ctrl: true,
- preventDefault: true,
- handler: () => {
- if (this.aModalIsOpen) return;
- this.volumeSliderValue -= 100;
- this.changeVolume();
- }
- }
- );
- keyboardShortcuts.registerShortcut(
- "station.increaseVolumeLarge",
- {
- keyCode: 38, // Up arrow key
- shift: false,
- ctrl: true,
- preventDefault: true,
- handler: () => {
- if (this.aModalIsOpen) return;
- this.volumeSliderValue += 1000;
- this.changeVolume();
- }
- }
- );
- keyboardShortcuts.registerShortcut(
- "station.increaseVolumeSmall",
- {
- keyCode: 38, // Up arrow key
- shift: true,
- ctrl: true,
- preventDefault: true,
- handler: () => {
- if (this.aModalIsOpen) return;
- this.volumeSliderValue += 100;
- this.changeVolume();
- }
- }
- );
- keyboardShortcuts.registerShortcut(
- "station.toggleDebug",
- {
- keyCode: 68, // D key
- shift: false,
- ctrl: true,
- preventDefault: true,
- handler: () => {
- if (this.aModalIsOpen) return;
- this.togglePlayerDebugBox();
- }
- }
- );
- keyboardShortcuts.registerShortcut(
- "station.toggleKeyboardShortcutsHelper",
- {
- keyCode: 191, // '/' key
- ctrl: true,
- preventDefault: true,
- handler: () => {
- if (this.aModalIsOpen) return;
- this.toggleKeyboardShortcutsHelper();
- }
- }
- );
- keyboardShortcuts.registerShortcut(
- "station.resetKeyboardShortcutsHelper",
- {
- keyCode: 191, // '/' key
- ctrl: true,
- shift: true,
- preventDefault: true,
- handler: () => {
- if (this.aModalIsOpen) return;
- this.resetKeyboardShortcutsHelper();
- }
- }
- );
- // UNIX client time before ping
- const beforePing = Date.now();
- this.socket.dispatch("apis.ping", res => {
- if (res.status === "success") {
- // UNIX client time after ping
- const afterPing = Date.now();
- // Average time in MS it took between the server responding and the client receiving
- const connectionLatency =
- (afterPing - beforePing) / 2;
- console.log(
- connectionLatency,
- beforePing - afterPing
- );
- // UNIX server time
- const serverDate = res.data.date;
- // Difference between the server UNIX time and the client UNIX time after ping, with the connectionLatency added to the server UNIX time
- const difference =
- serverDate + connectionLatency - afterPing;
- console.log("Difference: ", difference);
- if (difference > 3000 || difference < -3000) {
- console.log(
- "System time difference is bigger than 3 seconds."
- );
- }
- this.systemDifference = difference;
- }
- });
- } else {
- this.loading = false;
- this.exists = false;
- }
- }
- );
- },
- favoriteStation() {
- this.socket.dispatch(
- "stations.favoriteStation",
- this.station._id,
- res => {
- if (res.status === "success") {
- new Toast("Successfully favorited station.");
- } else new Toast(res.message);
- }
- );
- },
- unfavoriteStation() {
- this.socket.dispatch(
- "stations.unfavoriteStation",
- this.station._id,
- res => {
- if (res.status === "success") {
- new Toast("Successfully unfavorited station.");
- } else new Toast(res.message);
- }
- );
- },
- sendActivityWatchVideoData() {
- if (!this.stationPaused && !this.localPaused && !this.noSong) {
- if (this.activityWatchVideoLastStatus !== "playing") {
- this.activityWatchVideoLastStatus = "playing";
- this.activityWatchVideoLastStartDuration =
- this.currentSong.skipDuration + this.getTimeElapsed();
- }
- if (
- this.activityWatchVideoLastYouTubeId !==
- this.currentSong.youtubeId
- ) {
- this.activityWatchVideoLastYouTubeId =
- this.currentSong.youtubeId;
- this.activityWatchVideoLastStartDuration =
- this.currentSong.skipDuration + this.getTimeElapsed();
- }
- const videoData = {
- title: this.currentSong ? this.currentSong.title : null,
- artists:
- this.currentSong && this.currentSong.artists
- ? this.currentSong.artists.join(", ")
- : null,
- youtubeId: this.currentSong.youtubeId,
- muted: this.muted,
- volume: this.volumeSliderValue / 100,
- startedDuration:
- this.activityWatchVideoLastStartDuration <= 0
- ? 0
- : Math.floor(
- this.activityWatchVideoLastStartDuration /
- 1000
- ),
- source: `station#${this.station.name}`,
- hostname: window.location.hostname
- };
- aw.sendVideoData(videoData);
- } else {
- this.activityWatchVideoLastStatus = "not_playing";
- }
- },
- ...mapActions("modalVisibility", ["openModal"]),
- ...mapActions("station", [
- "joinStation",
- "leaveStation",
- "updateUserCount",
- "updateUsers",
- "updateCurrentSong",
- "updateNextSong",
- "updateSongsList",
- "repositionSongInList",
- "updateStationPaused",
- "updateLocalPaused",
- "updateNoSong",
- "updateIfStationIsFavorited",
- "setIncludedPlaylists",
- "setExcludedPlaylists",
- "updateCurrentSongRatings",
- "updateOwnCurrentSongRatings",
- "updateCurrentSongSkipVotes"
- ]),
- ...mapActions("modals/editSong", ["stopVideo"])
- }
- };
- </script>
- <style lang="scss">
- #stationPlayer {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- }
- #currently-playing-container,
- #next-up-container {
- .song-item {
- .thumbnail {
- min-width: 130px;
- width: 130px;
- height: 130px;
- }
- }
- }
- </style>
- <style lang="scss" scoped>
- #page-loader-container {
- height: inherit;
- #page-loader-content {
- height: inherit;
- position: absolute;
- max-width: 100%;
- width: 1800px;
- transform: translateX(-50%);
- left: 50%;
- }
- #page-loader-layout {
- height: inherit;
- width: 100%;
- }
- }
- #mobile-progress-animation {
- width: 50px;
- animation: rotate 0.8s infinite linear;
- border: 8px solid var(--primary-color);
- border-right-color: transparent;
- border-radius: 50%;
- height: 50px;
- position: absolute;
- top: 50%;
- left: 50%;
- display: none;
- }
- @keyframes rotate {
- 0% {
- transform: rotate(0deg);
- }
- 100% {
- transform: rotate(360deg);
- }
- }
- .nav,
- .button.is-primary {
- background-color: var(--primary-color) !important;
- }
- .button.is-primary:hover,
- .button.is-primary:focus {
- filter: brightness(90%);
- }
- .night-mode {
- #currently-playing-container,
- #next-up-container,
- #about-station-container,
- #control-bar-container,
- .player-container {
- background-color: var(--dark-grey-3) !important;
- }
- #video-container,
- #control-bar-container,
- .quadrant:not(#sidebar-container),
- .player-container {
- border: 0 !important;
- }
- #seeker-bar-container {
- background-color: var(--dark-grey-3) !important;
- }
- #dropdown-toggle {
- background-color: var(--dark-grey-2) !important;
- border: 0;
- i {
- color: var(--white);
- }
- }
- }
- #station-outer-container {
- margin: 0 auto;
- padding: 20px 40px;
- min-height: calc(100vh - 64px);
- width: 100%;
- max-width: 1800px;
- display: flex;
- #station-inner-container {
- width: 100%;
- min-height: calc(100vh - 428px);
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- .row {
- display: flex;
- flex-direction: row;
- max-width: 100%;
- }
- .column {
- display: flex;
- flex-direction: column;
- }
- .quadrant {
- border-radius: 5px;
- margin: 10px;
- }
- .quadrant:not(#sidebar-container) {
- background-color: var(--white);
- border: 1px solid var(--light-grey-3);
- }
- #station-left-column,
- #station-right-column {
- padding: 0;
- }
- #about-station-container {
- padding: 20px;
- display: flex;
- flex-direction: column;
- flex-grow: unset;
- #station-info {
- #station-name {
- flex-direction: row !important;
- h1 {
- margin: 0;
- font-size: 36px;
- line-height: 0.8;
- }
- i {
- margin-left: 10px;
- font-size: 30px;
- color: var(--yellow);
- &.stationMode {
- padding-left: 10px;
- margin-left: auto;
- color: var(--primary-color);
- }
- }
- .verified-station {
- color: var(--primary-color);
- }
- }
- p {
- max-width: 700px;
- margin-bottom: 10px;
- }
- }
- #admin-buttons {
- display: flex;
- .button {
- margin: 3px;
- }
- }
- }
- #current-next-row {
- display: flex;
- flex-direction: row;
- #currently-playing-container,
- #next-up-container {
- overflow: hidden;
- flex-basis: 50%;
- .song-item {
- border: unset;
- }
- .nothing-here-text {
- height: 100%;
- }
- }
- > div:only-child {
- flex: 1 !important;
- flex-basis: 100% !important;
- }
- }
- .player-container {
- height: inherit;
- background-color: var(--white);
- display: flex;
- flex-direction: column;
- border: 1px solid var(--light-grey-3);
- border-radius: 5px;
- overflow: hidden;
- &.nothing-here-text {
- margin: 10px;
- flex: 1;
- min-height: 487px;
- }
- #video-container {
- position: relative;
- padding-bottom: 56.25%; /* proportion value to aspect ratio 16:9 (9 / 16 = 0.5625 or 56.25%) */
- height: 0;
- overflow: hidden;
- .player-cannot-autoplay {
- position: relative;
- width: 100%;
- height: 100%;
- bottom: calc(100% + 5px);
- background: var(--primary-color);
- display: flex;
- align-items: center;
- justify-content: center;
- p {
- color: var(--white);
- font-size: 26px;
- text-align: center;
- }
- }
- }
- #seeker-bar-container {
- background-color: var(--white);
- position: relative;
- height: 7px;
- display: block;
- width: 100%;
- #seeker-bar {
- background-color: var(--primary-color);
- top: 0;
- left: 0;
- bottom: 0;
- position: absolute;
- }
- }
- #control-bar-container {
- display: flex;
- justify-content: space-around;
- padding: 10px 0;
- width: 100%;
- background: var(--white);
- flex-direction: column;
- flex-flow: wrap;
- .button:not(#dropdown-toggle) {
- width: 75px;
- }
- #left-buttons,
- #right-buttons {
- margin: 3px;
- }
- #left-buttons {
- display: flex;
- .button:not(:first-of-type) {
- margin-left: 5px;
- }
- .disabled {
- filter: grayscale(0.4);
- }
- }
- #duration {
- margin: 3px;
- display: flex;
- align-items: center;
- p {
- font-size: 22px;
- /** prevents duration width slightly varying and shifting other controls slightly */
- width: 150px;
- text-align: center;
- }
- }
- #volume-control {
- margin: 3px;
- margin-top: 0;
- display: flex;
- align-items: center;
- cursor: pointer;
- .volume-slider {
- width: 100%;
- padding: 0 15px;
- background: transparent;
- min-width: 100px;
- }
- input[type="range"] {
- -webkit-appearance: none;
- margin: 7.3px 0;
- }
- input[type="range"]:focus {
- outline: none;
- }
- input[type="range"]::-webkit-slider-runnable-track {
- width: 100%;
- height: 5.2px;
- cursor: pointer;
- box-shadow: 0;
- background: var(--light-grey-3);
- border-radius: 0;
- border: 0;
- }
- input[type="range"]::-webkit-slider-thumb {
- box-shadow: 0;
- border: 0;
- height: 19px;
- width: 19px;
- border-radius: 15px;
- background: var(--primary-color);
- cursor: pointer;
- -webkit-appearance: none;
- margin-top: -6.5px;
- }
- input[type="range"]::-moz-range-track {
- width: 100%;
- height: 5.2px;
- cursor: pointer;
- box-shadow: 0;
- background: var(--light-grey-3);
- border-radius: 0;
- border: 0;
- }
- input[type="range"]::-moz-range-thumb {
- box-shadow: 0;
- border: 0;
- height: 19px;
- width: 19px;
- border-radius: 15px;
- background: var(--primary-color);
- cursor: pointer;
- -webkit-appearance: none;
- margin-top: -6.5px;
- }
- input[type="range"]::-ms-track {
- width: 100%;
- height: 5.2px;
- cursor: pointer;
- box-shadow: 0;
- background: var(--light-grey-3);
- border-radius: 1.3px;
- }
- input[type="range"]::-ms-fill-lower {
- background: var(--light-grey-3);
- border: 0;
- border-radius: 0;
- box-shadow: 0;
- }
- input[type="range"]::-ms-fill-upper {
- background: var(--light-grey-3);
- border: 0;
- border-radius: 0;
- box-shadow: 0;
- }
- input[type="range"]::-ms-thumb {
- box-shadow: 0;
- border: 0;
- height: 15px;
- width: 15px;
- border-radius: 15px;
- background: var(--primary-color);
- cursor: pointer;
- -webkit-appearance: none;
- margin-top: 1.5px;
- }
- }
- #right-buttons {
- display: flex;
- #dropdown-toggle {
- width: 35px;
- }
- #dislike-song,
- #add-song-to-playlist .button:not(#dropdown-toggle) {
- margin-left: 5px;
- }
- #ratings {
- display: flex;
- &.liked #dislike-song,
- &.disliked #like-song {
- background-color: var(--grey) !important;
- }
- #like-song.disabled,
- #dislike-song.disabled {
- filter: grayscale(0.4);
- }
- }
- #add-song-to-playlist {
- display: flex;
- flex-direction: column-reverse;
- #nav-dropdown {
- position: absolute;
- margin-left: 4px;
- margin-bottom: 36px;
- .nav-dropdown-items {
- position: relative;
- right: calc(100% - 110px);
- }
- }
- .control {
- width: fit-content;
- margin-bottom: 0 !important;
- button.disabled {
- filter: grayscale(0.4);
- border-radius: 3px;
- &::after {
- margin-right: 100%;
- }
- }
- }
- }
- }
- }
- }
- #sidebar-container {
- border-top: 0;
- position: relative;
- height: inherit;
- flex-grow: 1;
- min-height: 350px;
- }
- }
- }
- .footer {
- margin-top: 30px;
- }
- .nyan {
- background: linear-gradient(
- 90deg,
- magenta 0%,
- red 15%,
- orange 30%,
- yellow 45%,
- lime 60%,
- cyan 75%,
- blue 90%,
- magenta 100%
- );
- background-size: 200%;
- animation: nyanMoving 4s linear infinite;
- }
- @keyframes nyanMoving {
- 0% {
- background-position: 0% 0%;
- }
- 100% {
- background-position: -200% 0%;
- }
- }
- .bg-bubbles {
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- position: absolute;
- z-index: -1;
- margin: 0px;
- pointer-events: none;
- }
- .bg-bubbles li {
- position: absolute;
- list-style: none;
- display: block;
- width: 40px;
- height: 40px;
- border-radius: 100px;
- background-color: var(--primary-color);
- opacity: 0.15;
- bottom: 0px;
- -webkit-animation: square 25s infinite;
- animation: square 25s infinite;
- -webkit-transition-timing-function: linear;
- transition-timing-function: linear;
- }
- .bg-bubbles li:nth-child(1) {
- left: 10%;
- }
- .bg-bubbles li:nth-child(2) {
- left: 20%;
- width: 80px;
- height: 80px;
- -webkit-animation-delay: 2s;
- animation-delay: 2s;
- -webkit-animation-duration: 17s;
- animation-duration: 17s;
- }
- .bg-bubbles li:nth-child(3) {
- left: 25%;
- -webkit-animation-delay: 4s;
- animation-delay: 4s;
- }
- .bg-bubbles li:nth-child(4) {
- left: 40%;
- width: 60px;
- height: 60px;
- -webkit-animation-duration: 22s;
- animation-duration: 22s;
- background-color: var(--primary-color);
- opacity: 0.25;
- }
- .bg-bubbles li:nth-child(5) {
- left: 70%;
- }
- .bg-bubbles li:nth-child(6) {
- left: 80%;
- width: 120px;
- height: 120px;
- -webkit-animation-delay: 3s;
- animation-delay: 3s;
- background-color: var(--primary-color);
- opacity: 0.2;
- }
- .bg-bubbles li:nth-child(7) {
- left: 32%;
- width: 160px;
- height: 160px;
- -webkit-animation-delay: 7s;
- animation-delay: 7s;
- }
- .bg-bubbles li:nth-child(8) {
- left: 55%;
- width: 20px;
- height: 20px;
- -webkit-animation-delay: 15s;
- animation-delay: 15s;
- -webkit-animation-duration: 40s;
- animation-duration: 40s;
- }
- .bg-bubbles li:nth-child(9) {
- left: 25%;
- width: 10px;
- height: 10px;
- -webkit-animation-delay: 2s;
- animation-delay: 2s;
- -webkit-animation-duration: 40s;
- animation-duration: 40s;
- background-color: var(--primary-color);
- opacity: 0.3;
- }
- .bg-bubbles li:nth-child(10) {
- left: 80%;
- width: 160px;
- height: 160px;
- -webkit-animation-delay: 11s;
- animation-delay: 11s;
- }
- /* Tablet view fix */
- @media (max-width: 768px) {
- .bg-bubbles li:nth-child(10) {
- display: none;
- }
- }
- @-webkit-keyframes square {
- 0% {
- -webkit-transform: translateY(0);
- transform: translateY(0);
- }
- 100% {
- -webkit-transform: translateY(-700px) rotate(600deg);
- transform: translateY(-700px) rotate(600deg);
- }
- }
- @keyframes square {
- 0% {
- -webkit-transform: translateY(0);
- transform: translateY(0);
- }
- 100% {
- -webkit-transform: translateY(-700px) rotate(600deg);
- transform: translateY(-700px) rotate(600deg);
- }
- }
- /deep/ .nothing-here-text {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- @media (min-width: 1500px) {
- #station-left-column {
- max-width: 650px;
- }
- #station-right-column {
- max-width: calc(100% - 650px);
- }
- }
- @media (max-width: 1700px) {
- #current-next-row {
- flex-direction: column !important;
- > div {
- flex: 1 !important;
- }
- }
- }
- @media (max-width: 1500px) {
- #mobile-progress-animation {
- display: block;
- }
- #page-loader-container {
- display: none;
- }
- #station-outer-container {
- max-width: 1500px;
- #station-inner-container {
- flex-direction: row;
- #station-left-column {
- #about-station-container #admin-buttons {
- flex-wrap: wrap;
- }
- #sidebar-container {
- min-height: 350px;
- }
- }
- #station-right-column {
- #current-next-row {
- flex-direction: column;
- }
- #control-bar-container {
- #duration,
- #volume-control,
- #right-buttons,
- #left-buttons {
- margin-bottom: 5px;
- justify-content: center;
- }
- #duration {
- order: 1;
- }
- #volume-control {
- order: 2;
- max-width: 400px;
- }
- #right-buttons {
- order: 3;
- flex-wrap: wrap;
- #ratings {
- flex-wrap: wrap;
- }
- }
- #left-buttons {
- order: 4;
- flex-wrap: wrap;
- }
- }
- }
- }
- }
- }
- @media (max-width: 1200px) {
- #station-outer-container {
- max-width: 900px;
- padding: 0;
- #station-inner-container {
- flex-direction: column-reverse;
- flex-wrap: nowrap;
- }
- }
- }
- @media (max-width: 990px) {
- #station-outer-container {
- min-height: calc(
- 100vh - 256px
- ); // Height of nav (64px) + height of footer (190px)
- }
- }
- </style>
|