Skip to content

Commit 5ef5f03

Browse files
ioigoumetvdijen
authored andcommitted
Slow Post js and css changes
1 parent 6ee5b98 commit 5ef5f03

File tree

3 files changed

+104
-1
lines changed

3 files changed

+104
-1
lines changed

resources/css/default.scss

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,3 +862,82 @@ div.preferredidp {
862862
.left {
863863
float: left;
864864
}
865+
/*Margins*/
866+
.mt-0 { margin-top: 0 !important; }
867+
.mt-1 { margin-top: .25rem !important; }
868+
.mt-2 { margin-top: .5rem !important; }
869+
.mt-3 { margin-top: 1rem !important; }
870+
.mt-4 { margin-top: 1.5rem !important; }
871+
.mt-5 { margin-top: 3rem !important; }
872+
873+
.mb-0 { margin-bottom: 0 !important; }
874+
.mb-1 { margin-bottom: .25rem !important; }
875+
.mb-2 { margin-bottom: .5rem !important; }
876+
.mb-3 { margin-bottom: 1rem !important; }
877+
.mb-4 { margin-bottom: 1.5rem !important; }
878+
.mb-5 { margin-bottom: 3rem !important; }
879+
/*Padding*/
880+
.p-0 { padding: 0 !important; }
881+
.p-1 { padding: .25rem !important; }
882+
.p-2 { padding: .5rem !important; }
883+
.p-3 { padding: 1rem !important; }
884+
.p-4 { padding: 1.5rem !important; }
885+
.p-5 { padding: 3rem !important; }
886+
887+
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
888+
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
889+
890+
/*Loader*/
891+
.loader {
892+
position: fixed;
893+
top: 50%;
894+
left: 50%;
895+
transform: translate(-50%, -50%);
896+
display: block;
897+
width: 16px;
898+
height: 16px;
899+
border-radius: 50%;
900+
margin: 15px auto;
901+
background: #FFF;
902+
box-shadow: -24px 0 #FFF, 24px 0 #FFF;
903+
box-sizing: border-box;
904+
animation: shadowPulse 2s linear infinite;
905+
z-index: 10000;
906+
}
907+
.loader::before {
908+
content: "";
909+
position: absolute;
910+
left: 50%;
911+
top: 50%;
912+
width: 120px; /* square width */
913+
height: 120px; /* square height (same as width) */
914+
transform: translate(-50%, -50%);
915+
background: rgba(0, 0, 0, 0.04); /* subtle halo for contrast */
916+
border-radius: 12px; /* rounded corners */
917+
pointer-events: none;
918+
z-index: -1; /* behind the loader dots */
919+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); /* faint inner edge for visibility */
920+
}
921+
922+
@media (forced-colors: active) {
923+
.loader::before {
924+
background: Canvas;
925+
border: 2px solid ButtonText;
926+
box-shadow: none;
927+
}
928+
}
929+
930+
@keyframes shadowPulse {
931+
33% {
932+
background: #FFF;
933+
box-shadow: -24px 0 #db0100, 24px 0 #FFF;
934+
}
935+
66% {
936+
background: #db0100;
937+
box-shadow: -24px 0 #FFF, 24px 0 #FFF;
938+
}
939+
100% {
940+
background: #FFF;
941+
box-shadow: -24px 0 #FFF, 24px 0 #db0100;
942+
}
943+
}

resources/css/postSubmit.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import 'default';
2+
13
input#postLoginSubmitButton {
24
display: none;
35
}

resources/js/post/post.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,27 @@
55
* the SSO
66
*/
77
ready(function () {
8-
document.getElementById('postLoginSubmitButton').click();
8+
// Reveal #slowPostMessage after a delay (default 30000 ms).
9+
// If you want to change the delay per page, set data-slow-post-delay on the element.
10+
const el = document.getElementById('slowPostMessage');
11+
const pageTitle = document.getElementById('page-title');
12+
if (!el) return;
13+
const attr = (el.dataset && el.dataset.slowPostDelay) || el.getAttribute('data-slow-post-delay');
14+
let delay = parseInt(attr, 10);
15+
if (!Number.isFinite(delay) || delay < 0) delay = 30000;
16+
17+
setTimeout(function () {
18+
el.classList.remove('hidden');
19+
if (pageTitle) {
20+
pageTitle.classList.remove('hidden');
21+
}
22+
}, delay);
23+
24+
// Automatically click the input button to redirect the user to
25+
// the SSO
26+
const btn = document.getElementById('postLoginSubmitButton');
27+
if (btn) {
28+
// Defer the click so the scheduling above is committed
29+
setTimeout(function () { btn.click(); }, 0);
30+
}
931
});

0 commit comments

Comments
 (0)