From d7455d95ffc8994ecccc449e81b983495d72e1cc Mon Sep 17 00:00:00 2001 From: Greenscreener Date: Mon, 15 Jul 2019 19:39:38 +0200 Subject: [PATCH] Fixed the logo being giant for a second while page is loading. Also a layout mishap. --- patekLogo.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/patekLogo.js b/patekLogo.js index b588070..099d5bf 100644 --- a/patekLogo.js +++ b/patekLogo.js @@ -20,7 +20,7 @@ template.innerHTML = ` font-weight: bold; } #titlePlaceholder { - margin-right: -0.9em; + margin-right: -1.15em; visibility: hidden; } #titleText { @@ -94,7 +94,12 @@ class PatekLogo extends HTMLElement { clone.getElementById("titleText").innerText = typeof this.attributes.title !== "undefined" ? this.attributes.title.value : "Pátek"; clone.getElementById("subtitleText").innerText = typeof this.attributes.subtitle !== "undefined" ? this.attributes.subtitle.value : ""; this.shadow.appendChild(clone); + this.style.display = "none"; this.calculateCircles(); + window.addEventListener("load", () => { + this.style.display = "inline-block"; + console.log("loaded"); + }); } static get observedAttributes() { return ['title', 'subtitle']; } attributeChangedCallback(name, oldValue, newValue) {