mirror of
https://github.com/greflm13/StaticGalleryBuilder.git
synced 2026-02-05 11:09:26 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
5227beb02a
|
@@ -38,8 +38,8 @@
|
|||||||
"-n",
|
"-n",
|
||||||
"-m",
|
"-m",
|
||||||
"--reverse-sort",
|
"--reverse-sort",
|
||||||
// "--regenerate-thumbnails",
|
"--regenerate-thumbnails",
|
||||||
// "--reread-metadata",
|
"--reread-metadata",
|
||||||
"--folderthumbnails"
|
"--folderthumbnails"
|
||||||
],
|
],
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
|
|||||||
@@ -85,22 +85,6 @@
|
|||||||
{% if images %}
|
{% if images %}
|
||||||
{%- set ns = namespace(count = 0) -%}
|
{%- set ns = namespace(count = 0) -%}
|
||||||
<div class="row" id="imagelist">
|
<div class="row" id="imagelist">
|
||||||
{%- for image in images %}
|
|
||||||
<div class="column">
|
|
||||||
<figure>
|
|
||||||
<img src="{{ image.thumbnail }}" alt="{{ image.name }}" onclick="openSwipe({{ ns.count }})" onmouseover="prefetch({{ ns.count }})" onmouseleave="cancel({{ ns.count }})" />
|
|
||||||
{%- set ns.count = ns.count + 1 %}
|
|
||||||
<figcaption class="caption">{{ image.name }}
|
|
||||||
{%- if image.tiff %}
|
|
||||||
<a href="{{ image.tiff }}">TIFF</a>
|
|
||||||
{%- endif %}
|
|
||||||
{%- if image.raw %}
|
|
||||||
<a href="{{ image.raw }}">RAW</a>
|
|
||||||
{%- endif %}
|
|
||||||
</figcaption>
|
|
||||||
</figure>
|
|
||||||
</div>
|
|
||||||
{%- endfor %}
|
|
||||||
</div>
|
</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{% if license %}
|
{% if license %}
|
||||||
@@ -123,14 +107,14 @@
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
<span class="attribution">Made with <a href="https://github.com/greflm13/StaticGalleryBuilder" target="_blank" rel="noopener noreferrer">StaticGalleryBuilder {{ version }}</a> by <a
|
<span class="attribution">Made with <a href="https://github.com/greflm13/StaticGalleryBuilder" target="_blank" rel="noopener noreferrer">StaticGalleryBuilder {{ version }}</a> by <a
|
||||||
href="https://github.com/greflm13" target="_blank" rel="noopener noreferrer">{{ logo }}</a>.</span>
|
href="https://github.com/greflm13" target="_blank" rel="noopener noreferrer">{{ logo }}</a>.</span>
|
||||||
<button onclick="topFunction()" id="totop" title="Back to Top">Back to Top</button>
|
<button type="button" onclick="topFunction()" id="totop" title="Back to Top">Back to Top</button>
|
||||||
</div>
|
</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<span class="attribution">Made with <a href="https://github.com/greflm13/StaticGalleryBuilder" target="_blank" rel="noopener noreferrer">StaticGalleryBuilder {{ version }}</a> by <a
|
<span class="attribution">Made with <a href="https://github.com/greflm13/StaticGalleryBuilder" target="_blank" rel="noopener noreferrer">StaticGalleryBuilder {{ version }}</a> by <a
|
||||||
href="https://github.com/greflm13" target="_blank" rel="noopener noreferrer">{{ logo }}</a>.</span>
|
href="https://github.com/greflm13" target="_blank" rel="noopener noreferrer">{{ logo }}</a>.</span>
|
||||||
<button onclick="topFunction()" id="totop" title="Back to Top">Back to Top</button>
|
<button type="button" onclick="topFunction()" id="totop" title="Back to Top">Back to Top</button>
|
||||||
</div>
|
</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{% if images %}
|
{% if images %}
|
||||||
@@ -175,12 +159,13 @@
|
|||||||
var items = [
|
var items = [
|
||||||
{%- for image in images %}
|
{%- for image in images %}
|
||||||
{%- if image.exifdata.DateTime %}
|
{%- if image.exifdata.DateTime %}
|
||||||
{ src: "{{ image.url }}", w: {{ image.width }}, h: {{ image.height }}, msrc: "{{ image.thumbnail }}", tags: "{{ image.tags }}", title: "Captured: {{ image.exifdata.DateTime }}" },
|
{ name: "{{ image.name }}", tiff: "{{ image.tiff }}", raw: "{{ image.raw }}", src: "{{ image.url }}", w: {{ image.width }}, h: {{ image.height }}, msrc: "{{ image.thumbnail }}", tags: "{{ image.tags }}", title: "Captured: {{ image.exifdata.DateTime }}" },
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{ src: "{{ image.url }}", w: {{ image.width }}, h: {{ image.height }}, msrc: "{{ image.thumbnail }}", tags: "{{ image.tags }}" },
|
{ name: "{{ image.name }}", tiff: "{{ image.tiff }}", raw: "{{ image.raw }}", src: "{{ image.url }}", w: {{ image.width }}, h: {{ image.height }}, msrc: "{{ image.thumbnail }}", tags: "{{ image.tags }}" },
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
];
|
];
|
||||||
|
var shown = [];
|
||||||
var re = /pid=(\d+)/;
|
var re = /pid=(\d+)/;
|
||||||
var controllers = {}
|
var controllers = {}
|
||||||
|
|
||||||
@@ -188,15 +173,10 @@
|
|||||||
var options = {
|
var options = {
|
||||||
index: img
|
index: img
|
||||||
};
|
};
|
||||||
var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
|
var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, shown, options);
|
||||||
gallery.init();
|
gallery.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (re.test(window.location.href)) {
|
|
||||||
var pid = window.location.href.match(re)[1];
|
|
||||||
openSwipe(parseInt(pid));
|
|
||||||
}
|
|
||||||
|
|
||||||
let totopbutton = document.getElementById("totop");
|
let totopbutton = document.getElementById("totop");
|
||||||
|
|
||||||
window.onscroll = function () { scrollFunction() };
|
window.onscroll = function () { scrollFunction() };
|
||||||
@@ -213,6 +193,25 @@
|
|||||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.onload = function () { filter() };
|
||||||
|
|
||||||
|
function updateImageList() {
|
||||||
|
var str = ""
|
||||||
|
var imagelist = document.getElementById("imagelist");
|
||||||
|
shown.forEach((item, index) => {
|
||||||
|
str += '<div class="column"><figure><img src="' + item.msrc + '" onclick="openSwipe(' + index + ')" onmouseover="prefetch(' + index + ')" onmouseleave="cancel(' + index + ')" /><figcaption class="caption">' + item.name;
|
||||||
|
if (item.tiff != "") {
|
||||||
|
str += ' <a href="' + item.tiff + '">TIFF</a>';
|
||||||
|
}
|
||||||
|
if (item.raw != "") {
|
||||||
|
str += ' <a href="' + item.raw + '">RAW</a>';
|
||||||
|
}
|
||||||
|
str += '</figcaption></figure></div>';
|
||||||
|
});
|
||||||
|
|
||||||
|
imagelist.innerHTML = str;
|
||||||
|
}
|
||||||
|
|
||||||
function prefetch(img) {
|
function prefetch(img) {
|
||||||
const controller = new AbortController()
|
const controller = new AbortController()
|
||||||
const signal = controller.signal
|
const signal = controller.signal
|
||||||
@@ -230,36 +229,37 @@
|
|||||||
delete controllers[img];
|
delete controllers[img];
|
||||||
}
|
}
|
||||||
|
|
||||||
{%- if tags|length > 0 %}
|
|
||||||
function filter() {
|
function filter() {
|
||||||
var selected_tags = [];
|
var selected_tags = [];
|
||||||
var tagdropdown, imagelist, figures, i, j, tags, incl;
|
var tagdropdown, tags, incl;
|
||||||
|
shown = [];
|
||||||
tagdropdown = document.getElementById("tagdropdown").getElementsByTagName("li");
|
tagdropdown = document.getElementById("tagdropdown").getElementsByTagName("li");
|
||||||
for (i = 0; i < tagdropdown.length; i++) {
|
for (var i = 0; i < tagdropdown.length; i++) {
|
||||||
if (tagdropdown[i].firstChild.firstChild.checked) {
|
if (tagdropdown[i].firstChild.firstChild.checked) {
|
||||||
selected_tags.push([tagdropdown[i].innerText])
|
selected_tags.push([tagdropdown[i].innerText])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
imagelist = document.getElementById("imagelist");
|
items.forEach((item, index) => {
|
||||||
figures = imagelist.getElementsByTagName("div");
|
tags = item.tags;
|
||||||
for (i = 0; i < figures.length; i++) {
|
|
||||||
tags = items[i].tags;
|
|
||||||
incl = true;
|
incl = true;
|
||||||
for (j = 0; j < selected_tags.length; j++) {
|
selected_tags.forEach((tag) => {
|
||||||
if (tags.indexOf(selected_tags[j]) == -1) {
|
if (tags.indexOf(tag) == -1) {
|
||||||
incl = false;
|
incl = false;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
if (incl | selected_tags == []) {
|
||||||
|
shown.push(item)
|
||||||
}
|
}
|
||||||
if (incl || selected_tags == []) {
|
});
|
||||||
figures[i].style.display = "";
|
updateImageList();
|
||||||
} else {
|
|
||||||
figures[i].style.display = "none";
|
if (re.test(window.location.href)) {
|
||||||
}
|
var pid = window.location.href.match(re)[1];
|
||||||
|
console.log(pid);
|
||||||
|
console.log(shown);
|
||||||
|
openSwipe(parseInt(pid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filter()
|
|
||||||
{%- endif %}
|
|
||||||
</script>
|
</script>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -54,14 +54,14 @@
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
<span class="attribution">Made with <a href="https://github.com/greflm13/StaticGalleryBuilder" target="_blank" rel="noopener noreferrer">StaticGalleryBuilder {{ version }}</a> by <a
|
<span class="attribution">Made with <a href="https://github.com/greflm13/StaticGalleryBuilder" target="_blank" rel="noopener noreferrer">StaticGalleryBuilder {{ version }}</a> by <a
|
||||||
href="https://github.com/greflm13" target="_blank" rel="noopener noreferrer">{{ logo }}</a>.</span>
|
href="https://github.com/greflm13" target="_blank" rel="noopener noreferrer">{{ logo }}</a>.</span>
|
||||||
<button onclick="topFunction()" id="totop" title="Back to Top">Back to Top</button>
|
<button type="button" onclick="topFunction()" id="totop" title="Back to Top">Back to Top</button>
|
||||||
</div>
|
</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<span class="attribution">Made with <a href="https://github.com/greflm13/StaticGalleryBuilder" target="_blank" rel="noopener noreferrer">StaticGalleryBuilder {{ version }}</a> by <a
|
<span class="attribution">Made with <a href="https://github.com/greflm13/StaticGalleryBuilder" target="_blank" rel="noopener noreferrer">StaticGalleryBuilder {{ version }}</a> by <a
|
||||||
href="https://github.com/greflm13" target="_blank" rel="noopener noreferrer">{{ logo }}</a>.</span>
|
href="https://github.com/greflm13" target="_blank" rel="noopener noreferrer">{{ logo }}</a>.</span>
|
||||||
<button onclick="topFunction()" id="totop" title="Back to Top">Back to Top</button>
|
<button type="button" onclick="topFunction()" id="totop" title="Back to Top">Back to Top</button>
|
||||||
</div>
|
</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</body>
|
</body>
|
||||||
@@ -2,6 +2,6 @@
|
|||||||
<x:xmpmeta x:xmptk="XMP Core 4.4.0-Exiv2" xmlns:x="adobe:ns:meta/">
|
<x:xmpmeta x:xmptk="XMP Core 4.4.0-Exiv2" xmlns:x="adobe:ns:meta/">
|
||||||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||||
<rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:lr="http://ns.adobe.com/lightroom/1.0/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmpMM:DerivedFrom="DSC03470.JPG">
|
<rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:lr="http://ns.adobe.com/lightroom/1.0/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmpMM:DerivedFrom="DSC03470.JPG">
|
||||||
<dc:subject><rdf:Bag><rdf:li></rdf:li><rdf:li>bus</rdf:li><rdf:li>illuminate</rdf:li><rdf:li>neon</rdf:li><rdf:li>neon light</rdf:li><rdf:li>night</rdf:li><rdf:li>sign</rdf:li><rdf:li>train car</rdf:li><rdf:li>trolley</rdf:li><rdf:li>window</rdf:li></rdf:Bag></dc:subject><lr:hierarchicalSubject><rdf:Bag><rdf:li>|bus</rdf:li><rdf:li>|illuminate</rdf:li><rdf:li>|neon</rdf:li><rdf:li>|neon light</rdf:li><rdf:li>|night</rdf:li><rdf:li>|sign</rdf:li><rdf:li>|train car</rdf:li><rdf:li>|trolley</rdf:li><rdf:li>|window</rdf:li></rdf:Bag></lr:hierarchicalSubject></rdf:Description>
|
<dc:subject><rdf:Bag><rdf:li></rdf:li><rdf:li>bus</rdf:li><rdf:li>illuminate</rdf:li><rdf:li>neon</rdf:li><rdf:li>passenger train</rdf:li><rdf:li>neon light</rdf:li><rdf:li>night</rdf:li><rdf:li>sign</rdf:li><rdf:li>train car</rdf:li><rdf:li>trolley</rdf:li><rdf:li>window</rdf:li></rdf:Bag></dc:subject><lr:hierarchicalSubject><rdf:Bag><rdf:li>|bus</rdf:li><rdf:li>|illuminate</rdf:li><rdf:li>|neon</rdf:li><rdf:li>|neon light</rdf:li><rdf:li>|night</rdf:li><rdf:li>|sign</rdf:li><rdf:li>|train car</rdf:li><rdf:li>|trolley</rdf:li><rdf:li>|window</rdf:li></rdf:Bag></lr:hierarchicalSubject></rdf:Description>
|
||||||
</rdf:RDF>
|
</rdf:RDF>
|
||||||
</x:xmpmeta>
|
</x:xmpmeta>
|
||||||
Reference in New Issue
Block a user