Basic interface

This commit is contained in:
Remy Moll
2021-10-30 21:50:35 +02:00
parent 458156fafd
commit 14ddbf0ce4
8 changed files with 162 additions and 6 deletions

BIN
static/SBB-Logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -0,0 +1,9 @@
.bg-primary .btn-primary .btn-primary:hover{
border-color: red;
background-color: red !important;
}
* {
border-radius: 0 !important;
}

BIN
static/fallback.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

33
static/index.js Normal file
View File

@@ -0,0 +1,33 @@
var currentscrollHeight = 0;
var count = 0;
jQuery(document).ready(function ($) {
for (var i = 0; i < 8; i++) {
callData(count);//Call 8 times on page load
count++;
}
});
$(window).on("scroll", function () {
const scrollHeight = $(document).height();
const scrollPos = Math.floor($(window).height() + $(window).scrollTop());
const isBottom = scrollHeight - 100 < scrollPos;
if (isBottom && currentscrollHeight < scrollHeight) {
//alert('calling...');
for (var i = 0; i < 6; i++) {
callData(count);//Once at bottom of page -> call 6 times
count++;
}
currentscrollHeight = scrollHeight;
}
});
function callData(counter) {
$.ajax({
type: "GET",
url: "http://localhost:8000/get_event?id=" + counter,
dataType: "html",
success: function (result) {
//alert(result[0]);
$(result).appendTo('.list');
},
error: function (result) {}
});
}