Skip to content

Commit

Permalink
Stop flash of unstyled content (#1932)
Browse files Browse the repository at this point in the history
  • Loading branch information
mimse authored and ManBearTM committed Aug 8, 2023
1 parent 9e67b08 commit 5eb227b
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,21 @@
.error.itemLevel.show {
font-size: 14px;
}

main {
display: none;
}
</style>
<script>
function init() {
Utils.waitFor("button#next", function (element) {
element.addEventListener("click", Utils.toggleErrorClasses);
});
}

function showContent() {
document.querySelector("main").style.display = "block";
}
</script>

<script>
Expand All @@ -83,6 +91,7 @@
link.rel = "stylesheet";
link.type = "text/css";
link.href = path + "main.css";
link.onload = showContent;
head.appendChild(link);

var script = document.createElement("script");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
background: transparent;
}

main {
display: none;
}

/* Remove and change azure elements */
</style>
<script>
Expand Down Expand Up @@ -196,6 +200,10 @@
});
});
}

function showContent() {
document.querySelector("main").style.display = "block";
}
</script>
<script>
const path = window.SETTINGS
Expand All @@ -207,6 +215,7 @@
link.rel = "stylesheet";
link.type = "text/css";
link.href = path + "main.css";
link.onload = showContent;
head.appendChild(link);

var script = document.createElement("script");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@
top: 50%;
right: 0;
}

main {
display: none;
}
</style>
<script>
function appendForgotPasswordTemplate() {
Expand All @@ -155,6 +159,10 @@
appendForgotPasswordTemplate();
});
}

function showContent() {
document.querySelector("main").style.display = "block";
}
</script>

<script>
Expand All @@ -166,6 +174,7 @@
link.rel = "stylesheet";
link.type = "text/css";
link.href = path + "main.css";
link.onload = showContent;
head.appendChild(link);

var script = document.createElement("script");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
top: 50%;
right: 0;
}

main {
display: none;
}
</style>
<script>
function getB2CFlowLink(flowname) {
Expand Down Expand Up @@ -189,6 +193,10 @@
setMitIdFlowSignInFlow();
});
}

function showContent() {
document.querySelector("main").style.display = "block";
}
</script>

<script>
Expand All @@ -200,6 +208,7 @@
link.rel = "stylesheet";
link.type = "text/css";
link.href = path + "main.css";
link.onload = showContent;
head.appendChild(link);

var script = document.createElement("script");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,21 @@
text-align: center;
padding-bottom: 24px;
}

main {
display: none;
}
</style>
<script>
function init() {
Utils.waitFor("button#next", function (element) {
element.addEventListener("click", toggleErrorClasses);
});
}

function showContent() {
document.querySelector("main").style.display = "block";
}
</script>
<script>
const path = window.SETTINGS
Expand All @@ -99,6 +107,7 @@
link.rel = "stylesheet";
link.type = "text/css";
link.href = path + "main.css";
link.onload = showContent;
head.appendChild(link);

var script = document.createElement("script");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,15 @@
display: none !important;
}
/* Remove and change azure elements */
main {
display: none;
}
</style>
<script>
function showContent() {
document.querySelector("main").style.display = "block";
}
</script>
<script>
const path = window.SETTINGS
? SETTINGS.remoteResource.replace(SETTINGS.remoteResource.split("/").pop(), "")
Expand All @@ -105,6 +113,7 @@
link.rel = "stylesheet";
link.type = "text/css";
link.href = path + "main.css";
link.onload = showContent;
head.appendChild(link);
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
display: block !important;
margin-top: 1.5rem;
}

main {
display: none;
}
</style>
<script>
function init() {
Expand All @@ -122,6 +126,10 @@
});
});
}

function showContent() {
document.querySelector("main").style.display = "block";
}
</script>
<script>
const path = window.SETTINGS
Expand All @@ -133,6 +141,7 @@
link.rel = "stylesheet";
link.type = "text/css";
link.href = path + "main.css";
link.onload = showContent;
head.appendChild(link);

var script = document.createElement("script");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
display: block !important;
margin-top: 1.5rem;
}

main {
display: none;
}
</style>
<script>
function init() {
Expand All @@ -105,6 +109,10 @@
});
});
}

function showContent() {
document.querySelector("main").style.display = "block";
}
</script>
<script>
const path = window.SETTINGS
Expand All @@ -116,6 +124,7 @@
link.rel = "stylesheet";
link.type = "text/css";
link.href = path + "main.css";
link.onload = showContent;
head.appendChild(link);

var script = document.createElement("script");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,16 @@
margin-bottom: 0;
display: block;
}

main {
display: none;
}
</style>
<script>
function init() {}
function showContent() {
document.querySelector("main").style.display = "block";
}
</script>

<script>
Expand All @@ -130,6 +137,7 @@
link.rel = "stylesheet";
link.type = "text/css";
link.href = path + "main.css";
link.onload = showContent;
head.appendChild(link);

var script = document.createElement("script");
Expand Down

0 comments on commit 5eb227b

Please sign in to comment.