diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-04-18 21:37:33 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-04-18 21:37:33 +0200 |
commit | a2423adab4de94ad5faf1516bcc24b6633bb91e6 (patch) | |
tree | 8086e109a1826daa24123f7a0230e3f2b8599258 /bin | |
parent | 0dd6c2df5037c22a67f646944a69b77c6fe0ba69 (diff) |
Switch to glightbox
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pyggle | 33 |
1 files changed, 6 insertions, 27 deletions
@@ -134,20 +134,8 @@ def copy_files(base_dir): imgwidth = f"{conf_size}px" imgheight = f"{conf_size}px" - css_files = ("jquery.fancybox.css",) - css_files += ( - "blank.gif", - "fancybox_loading@2x.gif", - "fancybox_loading.gif", - "fancybox_overlay.png", - "fancybox_sprite@2x.png", - "fancybox_sprite.png", - ) - js_files = ( - "jquery-1.10.2.min.js", - "jquery.fancybox.pack.js", - "jquery.mousewheel-3.0.6.pack.js", - ) + css_files = ["glightbox.min.css"] + js_files = ["glightbox.min.js"] for css_file in css_files: shutil.copy(f"{base_dir}/css/{css_file}", f".data/css/{css_file}") @@ -168,20 +156,11 @@ def copy_files(base_dir): def create_thumbnail_html(filename, title): - conf_size = 250 - conf_spacing = 1.1 - - div_width = conf_size * conf_spacing - div_height = div_width + 10 - buf = """<div class="image-container">\n""" - - buf += f"""\t<a class="fancybox" href="{filename}" title="{title}" data-fancybox-group="gallery">\n""" - buf += f"""\t\t<img src=".thumbnails/{filename}" alt="{filename}" /></a>\n""" - - buf += f"""\t<br/>\n\t<a style="text-decoration: none;" href="{filename}">{filename}</a>\n""" - - buf += "</div>\n" + buf += f"""<a href="{filename}" class="glightbox" data-gallery="gallery1" data-description="{title}">""" + buf += f"""<img src=".thumbnails/{filename}" alt="{filename}" />""" + buf += "</a>" + buf += "</div>" return buf |