2024-08-09 16:52:23 +07:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>People's Party Thailand Donations Count</title>
|
|
|
|
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
|
<meta name="HandheldFriendly" content="true">
|
|
|
|
<link rel="stylesheet" href="assets/css/style.css">
|
2024-08-09 17:18:20 +07:00
|
|
|
<link rel="stylesheet" href="assets/css/odometer-theme-default.css" />
|
|
|
|
<script src="assets/js/odometer.js"></script>
|
|
|
|
<script src="assets/js/jquery-3.7.1.min.js"></script>
|
|
|
|
|
2024-08-09 16:52:23 +07:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<style>
|
|
|
|
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');
|
|
|
|
</style>
|
|
|
|
<div class="container">
|
|
|
|
<div class="content">
|
|
|
|
<div>
|
|
|
|
<h1>People's Party Thailand Donation Count</h1>
|
|
|
|
<p>Updates every 10 seconds</p>
|
|
|
|
</div>
|
|
|
|
<p id="total" class="odometer">0</p></td>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
var el = document.querySelector('.odometer');
|
|
|
|
|
|
|
|
od = new Odometer({
|
|
|
|
el: el,
|
|
|
|
value: 0,
|
|
|
|
|
|
|
|
format: '(,ddd).dd',
|
|
|
|
theme: 'default'
|
|
|
|
});
|
|
|
|
|
|
|
|
fetchData()
|
|
|
|
setInterval(fetchData, 10000);
|
|
|
|
|
|
|
|
function fetchData() {
|
|
|
|
$.getJSON('https://donation-api.peoplespartythailand.org/report/total', function(data) {
|
|
|
|
var totalAmount = data["data"]["totalAmount"];
|
|
|
|
|
|
|
|
el.innerHTML = totalAmount;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|