mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-24 02:27:37 +00:00
31 lines
780 B
JavaScript
31 lines
780 B
JavaScript
import skins from "./skins.json";
|
|
|
|
export function screenshotUrlFromHash(hash) {
|
|
return `https://s3.amazonaws.com/webamp-uploaded-skins/screenshots/${hash}.png`;
|
|
}
|
|
|
|
export function filenameFromHash(hash) {
|
|
return skins[hash].fileName;
|
|
}
|
|
|
|
export function skinUrlFromHash(hash) {
|
|
return `https://s3.amazonaws.com/webamp-uploaded-skins/skins/${hash}.wsz`;
|
|
}
|
|
|
|
export function getPermalinkUrlFromHash(hash) {
|
|
return `/skin/${hash}/${filenameFromHash(hash)}/`;
|
|
}
|
|
|
|
export function getWindowSize() {
|
|
var w = window,
|
|
d = document,
|
|
e = d.documentElement,
|
|
g = d.getElementsByTagName("body")[0],
|
|
x = w.innerWidth || e.clientWidth || g.clientWidth,
|
|
y = w.innerHeight || e.clientHeight || g.clientHeight;
|
|
|
|
return {
|
|
windowWidth: x,
|
|
windowHeight: y
|
|
};
|
|
}
|