@ -0,0 +1,51 @@ |
|||||
|
function get_base_sha(app,theme) { |
||||
|
url = `https://api.github.com/repos/gilbn/theme.park/contents/CSS/themes/${app}/${app}-base.css` |
||||
|
const date = new Date().toUTCString(); |
||||
|
fetch(url, { |
||||
|
headers: { "If-Modified-Since": date } |
||||
|
}) |
||||
|
.then(res => res.json()) |
||||
|
.then(data => (injectTheme(app,theme,sha=data.sha || "ratelimited"))) |
||||
|
.catch(err => { throw err }); |
||||
|
} |
||||
|
|
||||
|
function injectTheme(app,theme,sha,container="head") { |
||||
|
if (container === "head") { |
||||
|
html_element = document.head; |
||||
|
} else html_element = document.body; |
||||
|
let link = document.createElement("link"); |
||||
|
url = "https://theme-park.dev/CSS/themes/" |
||||
|
link.type = "text/css"; |
||||
|
link.rel = "stylesheet"; |
||||
|
link.href = `${url}/${app}/${theme}.css?v=${sha}`; |
||||
|
|
||||
|
html_element.appendChild(link); |
||||
|
} |
||||
|
|
||||
|
function injectAddon(app,addon,container="head") { |
||||
|
if (container === "head") { |
||||
|
html_element = document.head; |
||||
|
} else html_element = document.body; |
||||
|
let link = document.createElement("link"); |
||||
|
url = "https://theme-park.dev/CSS/addons/" |
||||
|
link.type = "text/css"; |
||||
|
link.rel = "stylesheet"; |
||||
|
link.href = `${url}/${app}/${addon}.css`; |
||||
|
|
||||
|
html_element.appendChild(link); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// {
|
||||
|
// if (res.status) {
|
||||
|
// res.json()
|
||||
|
// .then(data => console.log(data))
|
||||
|
// } else {
|
||||
|
// res.json()
|
||||
|
// .then(data => console.log(data))
|
||||
|
// console.info("%c theme.park %c ".concat("ERROR", " "), "color: white; background: #009688; font-weight: 700; font-size: 24px; font-family: Monospace;", "color: red; background: white; font-weight: 700; font-size: 24px; font-family: Monospace;");
|
||||
|
// console.info(`%c Error %c Failed to fetch the url, double check the name passed in your subfilter.. `, "color: white; background: red; font-weight: 700;", "color: red; background: white; font-weight: 700;");
|
||||
|
// }
|
||||
|
// })
|
||||
|
|
||||
|
|
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 233 B |
After Width: | Height: | Size: 952 B |
After Width: | Height: | Size: 583 B |
After Width: | Height: | Size: 821 B |
After Width: | Height: | Size: 584 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 305 B |
After Width: | Height: | Size: 304 B |
After Width: | Height: | Size: 552 B |
After Width: | Height: | Size: 961 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 920 B |
After Width: | Height: | Size: 232 B |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 1.6 MiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 1.9 MiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 355 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 1.8 MiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 841 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 2.2 MiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 2.9 MiB |
After Width: | Height: | Size: 449 KiB |
After Width: | Height: | Size: 294 KiB |
After Width: | Height: | Size: 495 KiB |
After Width: | Height: | Size: 374 KiB |
After Width: | Height: | Size: 355 KiB |
After Width: | Height: | Size: 252 KiB |
After Width: | Height: | Size: 316 KiB |
After Width: | Height: | Size: 250 KiB |
After Width: | Height: | Size: 390 KiB |
After Width: | Height: | Size: 454 KiB |