longer scroll timer

This commit is contained in:
Q
2023-09-28 08:50:04 +03:00
parent eb698f244f
commit 3f69c63638
4 changed files with 17 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
__version__ = "20230407.0"
__version__ = "20230928.0"
def get_version():

View File

@@ -14,7 +14,6 @@ from tqdm import tqdm
class Mirva:
def __init__(self):
self.resource_src = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "resources"
)
@@ -52,7 +51,6 @@ class Mirva:
self.file_list = self.get_files()
if self.run_commands["config"]:
self.write_resources()
updated = self.create_config()
if updated:
@@ -70,7 +68,6 @@ class Mirva:
print("Gallery written.")
def create_config(self):
self.config = configparser.RawConfigParser()
self.config.read(self.config_file)
config_changed = False
@@ -119,7 +116,6 @@ class Mirva:
return config_changed
def create_posts(self):
self.posts = []
for c in self.config:
if c in self.file_list:
@@ -219,7 +215,6 @@ class Mirva:
}
def get_index(self, posts):
return """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by TEMPLATED
@@ -314,7 +309,6 @@ Released : 20110306
)
def is_created_with_mirva(self):
with open("index.html", "rt") as fp:
for line in fp.readlines():
if line.strip() == '<meta name="generator" content="Mirva" />':
@@ -322,7 +316,6 @@ Released : 20110306
return False
def write_index(self):
if os.path.exists("index.html"):
if not self.is_created_with_mirva():
print(
@@ -334,7 +327,6 @@ Released : 20110306
fp.write(self.get_index(self.posts))
def write_resources(self):
try:
os.makedirs(self.resource_dir)
except Exception:
@@ -383,7 +375,6 @@ Released : 20110306
)
def write_mediums(self):
try:
os.makedirs(self.medium_dir)
except Exception:

View File

@@ -59,16 +59,16 @@ function is_visible(el, type) {
function get_position() {
let intro = document.getElementsByClassName("intro");
for (let i = 0; i < intro.length; i++) {
if (is_visible(intro[i], "fully")) {
return {
"current": -1,
"next": 0,
"previous": -1,
"type": "top"
}
for (let i = 0; i < intro.length; i++) {
if (is_visible(intro[i], "fully")) {
return {
"current": -1,
"next": 0,
"previous": -1,
"type": "top"
}
}
}
let posts = document.getElementsByClassName("image_wrapper");
for (let i = 0; i < posts.length; i++) {
if (is_visible(posts[i], "fully")) {
@@ -134,8 +134,11 @@ function keyboard_entry(ev) {
return
}
if (current == -1) {
window.scrollTo({ top: 0, behavior: defaultScroll });
return
window.scrollTo({
top: 0,
behavior: defaultScroll
});
return
}
current = Math.max(0, current);
current = Math.min(posts.length - 1, current);
@@ -153,6 +156,6 @@ function keyboard_entry(ev) {
scrollTimer = setTimeout(function() {
scrollTimer = null;
},
200
1200
);
}

View File

@@ -4,7 +4,7 @@ version = attr: mirva.__version__
license = MIT
description = A tool to create a web gallery from a folder of images.
author = Ville Rantanen
author_email = ville.q.rantanen@gmail.com
author_email = q@six9.net
url = https://bitbucket.org/MoonQ/mirva
download_url = https://bitbucket.org/MoonQ/mirva/get/master.zip
keywords = album, generator, javascript