mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-09-12 19:50:57 +05:00
Some checks failed
Build Docker image / buildx (push) Waiting to run
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Release State / release-state (push) Waiting to run
Parallel Tests / Discover test files (push) Waiting to run
Parallel Tests / ${{ matrix.test.name }} (push) Blocked by required conditions
Parallel Tests / ${{ matrix.plugin.name }} (push) Blocked by required conditions
Run tests / python_tests (ubuntu-22.04, 3.13) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
51 lines
1.8 KiB
HTML
51 lines
1.8 KiB
HTML
<style>
|
|
/* Loading Progress Bar */
|
|
#progress {
|
|
position: absolute;
|
|
z-index: 1000;
|
|
top: 0px;
|
|
left: -6px;
|
|
width: 2%;
|
|
opacity: 1;
|
|
height: 2px;
|
|
background: #1a1a1a;
|
|
border-radius: 1px;
|
|
transition: width 4s ease-out, opacity 400ms linear;
|
|
}
|
|
|
|
@-moz-keyframes bugfix { from { padding-right: 1px ; } to { padding-right: 0; } }
|
|
</style>
|
|
<script>
|
|
// Page Loading Bar
|
|
const archiveboxJQuery = (window.django && window.django.jQuery) || window.jQuery;
|
|
window.loadStart = function(distance) {
|
|
if (!archiveboxJQuery) return;
|
|
var distance = distance || 0;
|
|
// only add progrstess bar if not already present
|
|
if (archiveboxJQuery("#loading-bar").length == 0) {
|
|
archiveboxJQuery("body").add("<div id=\"loading-bar\"></div>");
|
|
}
|
|
if (archiveboxJQuery("#progress").length === 0) {
|
|
archiveboxJQuery("body").append(archiveboxJQuery("<div></div>").attr("id", "progress"));
|
|
let last_distance = (distance || (30 + (Math.random() * 30)))
|
|
archiveboxJQuery("#progress").width(last_distance + "%");
|
|
setInterval(function() {
|
|
last_distance += Math.random()
|
|
archiveboxJQuery("#progress").width(last_distance + "%");
|
|
}, 1000)
|
|
}
|
|
};
|
|
|
|
window.loadFinish = function() {
|
|
if (!archiveboxJQuery) return;
|
|
const progress = archiveboxJQuery("#progress");
|
|
progress.width("101%");
|
|
window.setTimeout(function() {
|
|
progress.remove();
|
|
}, 600);
|
|
};
|
|
window.loadStart();
|
|
window.addEventListener('beforeunload', function() {window.loadStart(27)});
|
|
document.addEventListener('DOMContentLoaded', function() {window.loadFinish()});
|
|
</script>
|