diff options
| author | 2026-06-30 21:29:04 +0500 | |
|---|---|---|
| committer | 2026-06-30 21:29:04 +0500 | |
| commit | 1ccaed422b8f66a9364a41e40d81ecabf1cb8c44 (patch) | |
| tree | d3702f32c6f1ca3f9e6eff86af65a8a0466baeac /script.js | |
| download | website-1ccaed422b8f66a9364a41e40d81ecabf1cb8c44.tar.gz website-1ccaed422b8f66a9364a41e40d81ecabf1cb8c44.tar.bz2 website-1ccaed422b8f66a9364a41e40d81ecabf1cb8c44.zip | |
Initial commit
Diffstat (limited to 'script.js')
| -rw-r--r-- | script.js | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/script.js b/script.js new file mode 100644 index 0000000..57561c2 --- /dev/null +++ b/script.js @@ -0,0 +1,79 @@ +import Webamp from "https://unpkg.com/webamp@^2"; + +const WEBAMP_CONFIG = { + initialSkin: { + url: "music/Khoa_Vuong.wsz", + }, + initialTracks: [ + { + metaData: { artist: "Олег Эмиров", title: "Часы НТВ" }, + url: "music/00_chasy_ntv.opus", + }, + { + metaData: { + artist: "T.BIRD", + title: "Two Years Gone", + }, + url: "music/01_two_years_gone.mp3", + }, + { + metaData: { + artist: "Mendelayev", + title: "Install", + }, + url: "music/02_install.opus", + }, + { + metaData: { + artist: "Date of Birth", + title: "Planet Deb", + }, + url: "music/03_planet_deb.opus", + }, + { + metaData: { + artist: "lazyfish", + title: "31 seconds", + }, + url: "music/04_31_seconds.mp3", + }, + { + metaData: { + artist: "Mewark", + title: "Static", + }, + url: "music/05_static.opus", + }, + { + metaData: { + artist: "Plus-Tech Squeeze Box", + title: "SUZZY P", + }, + url: "music/06_suzzy_p.opus", + }, + { + metaData: { + artist: "Олег Эмиров", + title: "Чистосердечное признание: Расследование", + }, + url: "music/07_chpr_rassledovanie.opus", + }, + ], +}; + +document.addEventListener("DOMContentLoaded", function () { + // #region Create a Webamp target + const target = document.createElement("div"); + + const betweens = (window.innerWidth - 640) / 2; + const left = 640 + betweens + (betweens / 2); + target.style = `position: absolute; width: 0px; height: 0px; top: 50%; left: ${left}px`; + + document.body.append(target); + // #endregion + + // #region Render the Webamp window + const webamp = new Webamp(WEBAMP_CONFIG); + webamp.renderWhenReady(target).then(() => target.remove()); + // #endregion +}); |
