| Server IP : 167.235.67.158 / Your IP : 216.73.216.95 Web Server : Apache System : Linux ubuntu-8gb-nbg1-1 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/bc.the-word.com/timer/ |
Upload File : |
<!doctype html>
<html lang="en" class="h-100">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Counter</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="text-center h-100">
<div class="container h-100">
<div class="row h-100 align-items-center justify-content-center">
<div class="col-12">
<h5 id="chapter"></h5>
<h1 id="seconds"></h1>
<div class="progress my-3" style="height: 30px;">
<div id="progressBar" class="progress-bar" role="progressbar" style="width: 0%;"></div>
<div id="progressPercentage" class="mt-1 text-danger mx-auto">0.0000%</div>
</div>
<button class="btn btn-primary">Start</button>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-4.0.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>
<script>
var start_time = localStorage.getItem('start_time');
const CHAPTER_LENGTH = 5000000; // seconds
jQuery('button').on('click', function () {
const now = Date.now();
localStorage.setItem('start_time', now);
start_time = now;
jQuery(this).remove();
});
if (start_time != null) {
jQuery('button').remove();
}
setInterval(() => {
if (start_time == null) return;
const now = Date.now();
const diff = now - start_time;
const totalSeconds = diff / 1000;
// Display total time
jQuery('#seconds').text(
totalSeconds.toFixed(2) + ' seconds'
);
// Chapter number
const chapter = Math.floor(totalSeconds / CHAPTER_LENGTH) + 1;
// Progress within current chapter
const chapterProgressSeconds = totalSeconds % CHAPTER_LENGTH;
const percent = (chapterProgressSeconds / CHAPTER_LENGTH) * 100;
const percentFixed = percent.toFixed(4);
jQuery('#chapter').text('Chapter ' + chapter);
// Update progress bar
jQuery('#progressBar')
.css('width', percentFixed + '%');
jQuery('#progressPercentage').text(percentFixed + '%');
}, 100);
</script>
</body>
</html>