Skip to content

Commit

Permalink
Show spinner on page or measure browsing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrizzor committed Jun 11, 2024
1 parent 429653b commit 18c2c29
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 4 deletions.
10 changes: 10 additions & 0 deletions Resources/Private/JavaScript/dfgviewerScripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,19 @@ $(document).ready(function () {
})
.on('click', function () {
localStorage.txDlfFromPage = $(this).attr('class').split(' ')[0];
showLoadingAnimation();
});
if (localStorage.txDlfFromPage) {
$('.' + localStorage.txDlfFromPage).addClass('no-transition over');
localStorage.clear();
}
}

$('.measureBacks, .measureFwds').on('click', function (evt)
{
showLoadingAnimation();
});

// hide outdated browser hint, if cookie was found
if (Cookies.get('tx-dlf-pageview-hidebrowseralert') === 'true') {
$('#browser-hint').addClass('hidden');
Expand Down Expand Up @@ -238,4 +244,8 @@ function hideBrowserAlert() {

}

function showLoadingAnimation() {
$("#overlay").fadeIn(300);
}

// EOF
6 changes: 6 additions & 0 deletions Resources/Private/Layouts/KitodoPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
/>

<div class="main-wrapper">
<div id="overlay">
<div class="ajax-spinner">
<span class="spinner"></span>
</div>
</div>

<f:if condition="{gp-multiview}">
<f:then>
<f:render section="ControlBar" partial="ControlBar" arguments="{_all}" />
Expand Down
1 change: 1 addition & 0 deletions Resources/Private/Less/all.less
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
@import "modules/score.less";
@import "modules/gridview.less";
@import "modules/sidebar.less";
@import "modules/home.less";

// EOF
34 changes: 34 additions & 0 deletions Resources/Private/Less/modules/home.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,40 @@
*
*/

#overlay{
position: fixed;
top: 0;
z-index: 100;
width: 100%;
height:100%;
display: none;
background: rgba(0,0,0,0.6);
}

.ajax-spinner {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}

.spinner {
width: 40px;
height: 40px;
border: 4px #ddd solid;
border-top: 4px #2e93e6 solid;
border-radius: 50%;
animation: sp-anime 0.8s infinite linear;
}

@keyframes sp-anime {
100% {
transform: rotate(360deg);
}
}

.is-hide{
display:none;
}

// EOF
2 changes: 1 addition & 1 deletion Resources/Public/Css/allStyles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Resources/Public/Css/allStyles.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Resources/Public/JavaScript/allScripts.js

Large diffs are not rendered by default.

0 comments on commit 18c2c29

Please sign in to comment.