mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 19:46:16 +00:00
Update to reccommended file structure
Use reccommended database structure Switch to SQLite and update scheme along with it
This commit is contained in:
parent
29d204f95e
commit
a499e6c840
41 changed files with 544 additions and 342 deletions
|
@ -1,54 +0,0 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block content %}
|
||||
<header>
|
||||
<img src="{{ url_for('static', filename='images/leaves.jpg') }}" alt="leaves" onload="imgFade(this)" style="display: none;"/>
|
||||
<span></span>
|
||||
</header>
|
||||
<div class="app">
|
||||
<h1>Gallery</h1>
|
||||
<div id="gallery" class="gallery"></div>
|
||||
</div>
|
||||
<script>
|
||||
let imageList = [];
|
||||
let imageIndex = 0;
|
||||
|
||||
function loadMore(startIndex, amount = 20) {
|
||||
for (let i = startIndex; i < startIndex + amount; i++) {
|
||||
if (i < imageList.length) {
|
||||
loadImg(imageList[i][0], imageList[i][1]);
|
||||
}
|
||||
}
|
||||
imageIndex = startIndex + amount;
|
||||
}
|
||||
|
||||
function loadImg(id, fileName) {
|
||||
var imgDiv = `
|
||||
<a class="gallery__item" href="/image/${id}">
|
||||
<div class="gallery__item-info">
|
||||
<p>${id}</p>\
|
||||
<h2>${fileName}</h2>
|
||||
</div>
|
||||
<span class="gallery__item-filter"></span>
|
||||
<img class="gallery__item-image" src="https://supersecreteuploadtest.leggy.dev/usr/images/${fileName}" onload="imgFade(this)" style="display:none;">
|
||||
</a>
|
||||
`;
|
||||
|
||||
$(imgDiv).hide().appendTo('#gallery').fadeIn(250);
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '/fileList/original',
|
||||
type: 'get',
|
||||
success: function(response) {
|
||||
imageList = response;
|
||||
loadMore(0, 30);
|
||||
}
|
||||
});
|
||||
|
||||
$(window).scroll(function() {
|
||||
if ($(window).height() + $(window).scrollTop() >= $(document).height() - 500) {
|
||||
loadMore(imageIndex);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue