site-libsoc/Server/public/js/components/loadscreen-component.js

116 lines
3.2 KiB
JavaScript
Raw Normal View History

2023-07-30 17:04:15 +07:00
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, f as element, n as noop, k as attr_dev, F as set_style, j as add_location, p as detach_dev, q as binding_callbacks } from './index-998178c7.js';
/* src\components\loadscreen-component.svelte generated by Svelte v3.52.0 */
const file = "src\\components\\loadscreen-component.svelte";
function create_fragment(ctx) {
let div;
const block = {
c: function create() {
div = element("div");
this.c = noop;
attr_dev(div, "id", "loadscreen");
set_style(div, "width", "100%");
set_style(div, "height", "100%");
set_style(div, "background", "white");
set_style(div, "position", "absolute");
set_style(div, "z-index", "100000");
add_location(div, file, 20, 0, 366);
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
},
m: function mount(target, anchor) {
insert_dev(target, div, anchor);
/*div_binding*/ ctx[1](div);
},
p: noop,
i: noop,
o: noop,
d: function destroy(detaching) {
if (detaching) detach_dev(div);
/*div_binding*/ ctx[1](null);
}
};
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_fragment.name,
type: "component",
source: "",
ctx
});
return block;
}
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
validate_slots('loadscreen-component', slots, []);
let loadscreen;
onMount(() => {
window.addEventListener('load', function () {
$$invalidate(0, loadscreen.parentNode.host.style.display = "none", loadscreen);
});
});
const writable_props = [];
Object.keys($$props).forEach(key => {
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<loadscreen-component> was created with unknown prop '${key}'`);
});
function div_binding($$value) {
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
loadscreen = $$value;
$$invalidate(0, loadscreen);
});
}
$$self.$capture_state = () => ({ onMount, loadscreen });
$$self.$inject_state = $$props => {
if ('loadscreen' in $$props) $$invalidate(0, loadscreen = $$props.loadscreen);
};
if ($$props && "$$inject" in $$props) {
$$self.$inject_state($$props.$$inject);
}
return [loadscreen, div_binding];
}
class Loadscreen_component extends SvelteElement {
constructor(options) {
super();
init(
this,
{
target: this.shadowRoot,
props: attribute_to_object(this.attributes),
customElement: true
},
instance,
create_fragment,
safe_not_equal,
{},
null
);
if (options) {
if (options.target) {
insert_dev(options.target, this, options.anchor);
}
}
}
}
customElements.define("loadscreen-component", Loadscreen_component);
export { Loadscreen_component as default };