33 lines
910 B
JavaScript
33 lines
910 B
JavaScript
import { getDocumentShaderSource } from './cuteTexture.js';
|
|
|
|
export async function loadStatus(){
|
|
let res = await fetch('/status/index.html');
|
|
|
|
let html_text = await res.text()
|
|
let html = new DOMParser().parseFromString(html_text, "text/html");
|
|
|
|
let shaderSource = getDocumentShaderSource(html);
|
|
|
|
let target = document.querySelector('#statuSection');
|
|
|
|
let hiddenBtn = target.querySelector('a');
|
|
|
|
hiddenBtn.style.visibility = 'collapse';
|
|
|
|
let status = html.querySelector('#lolStatus');
|
|
console.log('current status:', status.innerText);
|
|
|
|
let isOpen = status.innerText.includes('ouvert');
|
|
|
|
let icon = html.querySelector('link[rel="icon"]');
|
|
let style = html.querySelectorAll('link[rel="stylesheet"]')[0];
|
|
//console.log("selected script: ", script);
|
|
|
|
document.head.append(icon);
|
|
document.head.append(style);
|
|
|
|
target.appendChild(status);
|
|
|
|
return { open: isOpen, shaderSource };
|
|
}
|