Make gallery selectable by URL
This commit is contained in:
parent
5b6e323a90
commit
61e11ba94b
1 changed files with 5 additions and 1 deletions
|
@ -85,7 +85,11 @@
|
|||
next.setAttribute('src', image);
|
||||
}
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
fetch('http://c-flo.cbrp3.c-base.org/pictures/space')
|
||||
let gallery = 'space';
|
||||
if (window.location.search) {
|
||||
gallery = decodeURIComponent(window.location.search.substr(1));
|
||||
}
|
||||
fetch(`http://c-flo.cbrp3.c-base.org/pictures/${gallery}`)
|
||||
.then(res => res.json())
|
||||
.then((pictures) => {
|
||||
const withUrl = pictures.map(p => 'http://c-flo.cbrp3.c-base.org' + p);
|
||||
|
|
Loading…
Reference in a new issue