`
+ tabDiv.querySelector('.dz-container').appendChild(div)
- tabDiv.getElementsByClassName('dz-container')[0].appendChild(div)
-
- const previewsContainer = tabDiv.getElementsByClassName('uploads')[0]
+ const previewsContainer = tabDiv.querySelector('#tab-files .field.uploads')
page.dropzone = new Dropzone('#dropzone', {
url: 'api/upload',
paramName: 'files[]',
@@ -372,12 +371,12 @@ page.updateTemplate = function (file, response) {
clipboard.parentElement.style.display = 'block'
const exec = /.[\w]+(\?|$)/.exec(response.url)
- if (exec && exec[0] && imageExtensions.includes(exec[0].toLowerCase())) {
+ if (exec && exec[0] && page.imageExtensions.includes(exec[0].toLowerCase())) {
const img = file.previewElement.querySelector('img')
img.setAttribute('alt', response.name || '')
img.dataset['src'] = response.url
img.onerror = function () { this.style.display = 'none' } // hide webp in firefox and ie
- page.lazyLoad.update(file.previewElement.querySelectorAll('img'))
+ page.lazyLoad.update()
}
}
@@ -476,7 +475,9 @@ window.onload = function () {
return swal('An error occurred!', 'There was an error when trying to copy the link to clipboard, please check the console for more information.', 'error')
})
- page.lazyLoad = new LazyLoad()
+ page.lazyLoad = new LazyLoad({
+ elements_selector: '.field.uploads img'
+ })
document.getElementById('createAlbum').addEventListener('click', function () {
page.createAlbum()
diff --git a/public/js/render.js b/public/js/render.js
new file mode 100644
index 0000000..1a9671e
--- /dev/null
+++ b/public/js/render.js
@@ -0,0 +1,86 @@
+/* global page, swal */
+
+page.renderRoot = 'render/al/'
+page.renderArray = [
+ 'atago_1.png',
+ 'atago_2.png',
+ 'belfast_1.png',
+ 'belfast_2.png',
+ 'belfast_3.png',
+ 'eldridge_1.png',
+ 'hammann_1.png',
+ 'hammann_2.png',
+ 'javelin_1.png',
+ 'kaga_1.png',
+ 'laffey_1.png',
+ 'prinz_eugen_1.png',
+ 'prinz_eugen_2.png',
+ 'takao_1.png',
+ 'takao_2.png',
+ 'unicorn_1.png',
+ 'unicorn_2.png',
+ 'unicorn_3.png',
+ 'unicorn_4.png',
+ 'unicorn_5.png',
+ 'yamashiro_1.png'
+]
+page.render = null
+
+page.doRenderSwal = function () {
+ const div = document.createElement('div')
+ div.innerHTML = `
+
+
+
+
+
If disabled, you will still be able to see a small button on the bottom right corner of the screen to re-enable it.
+
+ `
+
+ swal({
+ content: div,
+ buttons: {
+ confirm: true
+ }
+ }).then(function (value) {
+ if (!value) { return }
+ const newValue = div.querySelector('#swalRender').checked ? '1' : '0'
+ if (newValue !== localStorage.render) {
+ localStorage.render = newValue
+ swal('Success!', `Render is now ${newValue === '1' ? 'enabled' : 'disabled'}.`, 'success')
+ const element = document.querySelector('body > .render')
+ element.remove()
+ page.doRender()
+ }
+ })
+}
+
+page.doRender = function () {
+ if (!page.renderRoot || !page.renderArray || !page.renderArray.length) { return }
+ if (localStorage.render === undefined) { localStorage.render = '1' }
+
+ let element
+ if (localStorage.render === '0') {
+ element = document.createElement('a')
+ element.className = 'button is-breeze is-hidden-mobile'
+ element.title = 'ship waifu~'
+ element.innerHTML = '
'
+ } else {
+ if (!page.render) {
+ page.render = page.renderArray[Math.floor(Math.random() * page.renderArray.length)]
+ }
+ element = document.createElement('img')
+ element.alt = element.title = 'ship waifu~'
+ element.className = 'is-hidden-mobile'
+ element.src = `${page.renderRoot}${page.render}`
+ }
+
+ element.classList.add('render')
+ element.addEventListener('click', page.doRenderSwal)
+ document.body.appendChild(element)
+}
+
+page.doRender()
diff --git a/public/libs/lazyload/lazyload.min.js b/public/libs/lazyload/lazyload.min.js
index 897f1ad..c493598 100755
--- a/public/libs/lazyload/lazyload.min.js
+++ b/public/libs/lazyload/lazyload.min.js
@@ -1 +1 @@
-/*! lazyload v10.5.2 | Copyright (c) 2015 Andrea Verlicchi */var _extends=Object.assign||function(e){for(var t=1;t
-1&&(v(e,t),u(e,t.class_loading)),a(e,t),n(e,"was-processed",!0),f(t.callback_set,e)},p=function(e){return e.isIntersecting||e.intersectionRatio>0},h=function(t,n){this._settings=e(t),this._setObserver(),this.update(n)};h.prototype={_setObserver:function(){var e=this;if(c){var t=this._settings,n={root:t.container===document?null:t.container,rootMargin:t.threshold+"px"};this._observer=new IntersectionObserver(function(t){t.forEach(function(t){if(p(t)){var n=t.target;b(n,e._settings),e._observer.unobserve(n)}}),e._elements=r(e._elements)},n)}},update:function(e){var t=this,n=this._settings,s=e||n.container.querySelectorAll(n.elements_selector);this._elements=r(Array.prototype.slice.call(s)),this._observer?this._elements.forEach(function(e){t._observer.observe(e)}):(this._elements.forEach(function(e){b(e,n)}),this._elements=r(this._elements))},destroy:function(){var e=this;this._observer&&(r(this._elements).forEach(function(t){e._observer.unobserve(t)}),this._observer=null),this._elements=null,this._settings=null}};var y=window.lazyLoadOptions;return i&&y&&function(e,t){if(t.length)for(var n,r=0;n=t[r];r+=1)s(e,n);else s(e,t)}(h,y),h});
+/*! lazyload v10.19.0 | Copyright (c) 2015 Andrea Verlicchi */var _extends=Object.assign||function(t){for(var e=1;e-1&&(N(t,e),I(t,o.class_loading)),E(t,e),a(t),C(o.callback_set,t))}var e={elements_selector:"img",container:document,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,callback_load:null,callback_error:null,callback_set:null,callback_enter:null,callback_finish:null,to_webp:!1},n=function(t){return _extends({},e,t)},o=function(t,e){return t.getAttribute("data-"+e)},r=function(t,e,n){var o="data-"+e;null!==n?t.setAttribute(o,n):t.removeAttribute(o)},a=function(t){return r(t,"was-processed","true")},i=function(t){return"true"===o(t,"was-processed")},s=function(t,e){return r(t,"ll-timeout",e)},c=function(t){return o(t,"ll-timeout")},l=function(t){return t.filter(function(t){return!i(t)})},u=function(t,e){return t.filter(function(t){return t!==e})},d=function(t,e){var n,o=new t(e);try{n=new CustomEvent("LazyLoad::Initialized",{detail:{instance:o}})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:o})}window.dispatchEvent(n)},f=function(t,e){return e?t.replace(/\.(jpe?g|png)/gi,".webp"):t},_="undefined"!=typeof window,v=_&&!("onscroll"in window)||/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),g=_&&"IntersectionObserver"in window,h=_&&"classList"in document.createElement("p"),b=_&&function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))&&0===t.toDataURL("image/webp").indexOf("data:image/webp")}(),m=function(t,e,n,r){for(var a,i=0;a=t.children[i];i+=1)if("SOURCE"===a.tagName){var s=o(a,n);p(a,e,s,r)}},p=function(t,e,n,o){n&&t.setAttribute(e,f(n,o))},y=function(t,e){var n=b&&e.to_webp,r=o(t,e.data_src),a=o(t,e.data_bg);if(r){var i=f(r,n);t.style.backgroundImage='url("'+i+'")'}if(a){var s=f(a,n);t.style.backgroundImage=s}},w={IMG:function(t,e){var n=b&&e.to_webp,r=e.data_srcset,a=t.parentNode;a&&"PICTURE"===a.tagName&&m(a,"srcset",r,n);var i=o(t,e.data_sizes);p(t,"sizes",i);var s=o(t,r);p(t,"srcset",s,n);var c=o(t,e.data_src);p(t,"src",c,n)},IFRAME:function(t,e){var n=o(t,e.data_src);p(t,"src",n)},VIDEO:function(t,e){var n=e.data_src,r=o(t,n);m(t,"src",n),p(t,"src",r),t.load()}},E=function(t,e){var n=e._settings,o=t.tagName,r=w[o];if(r)return r(t,n),e._updateLoadingCount(1),void(e._elements=u(e._elements,t));y(t,n)},I=function(t,e){h?t.classList.add(e):t.className+=(t.className?" ":"")+e},L=function(t,e){h?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\s+)"+e+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},C=function(t,e){t&&t(e)},O=function(t,e,n){t.addEventListener(e,n)},k=function(t,e,n){t.removeEventListener(e,n)},x=function(t,e,n){O(t,"load",e),O(t,"loadeddata",e),O(t,"error",n)},A=function(t,e,n){k(t,"load",e),k(t,"loadeddata",e),k(t,"error",n)},z=function(t,e,n){var o=n._settings,r=e?o.class_loaded:o.class_error,a=e?o.callback_load:o.callback_error,i=t.target;L(i,o.class_loading),I(i,r),C(a,i),n._updateLoadingCount(-1)},N=function(t,e){var n=function n(r){z(r,!0,e),A(t,n,o)},o=function o(r){z(r,!1,e),A(t,n,o)};x(t,n,o)},R=["IMG","IFRAME","VIDEO"],S=function(e,n,o){t(e,o),n.unobserve(e)},M=function(t){var e=c(t);e&&(clearTimeout(e),s(t,null))},j=function(t,e,n){var o=n._settings.load_delay,r=c(t);r||(r=setTimeout(function(){S(t,e,n),M(t)},o),s(t,r))},D=function(t){return t.isIntersecting||t.intersectionRatio>0},T=function(t){return{root:t.container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}},U=function(t,e){this._settings=n(t),this._setObserver(),this._loadingCount=0,this.update(e)};return U.prototype={_manageIntersection:function(t){var e=this._observer,n=this._settings.load_delay,o=t.target;n?D(t)?j(o,e,this):M(o):D(t)&&S(o,e,this)},_onIntersection:function(t){t.forEach(this._manageIntersection.bind(this))},_setObserver:function(){g&&(this._observer=new IntersectionObserver(this._onIntersection.bind(this),T(this._settings)))},_updateLoadingCount:function(t){this._loadingCount+=t,0===this._elements.length&&0===this._loadingCount&&C(this._settings.callback_finish)},update:function(t){var e=this,n=this._settings,o=t||n.container.querySelectorAll(n.elements_selector);this._elements=l(Array.prototype.slice.call(o)),!v&&this._observer?this._elements.forEach(function(t){e._observer.observe(t)}):this.loadAll()},destroy:function(){var t=this;this._observer&&(this._elements.forEach(function(e){t._observer.unobserve(e)}),this._observer=null),this._elements=null,this._settings=null},load:function(e,n){t(e,this,n)},loadAll:function(){var t=this;this._elements.forEach(function(e){t.load(e)})}},_&&function(t,e){if(e)if(e.length)for(var n,o=0;n=e[o];o+=1)d(t,n);else d(t,e)}(U,window.lazyLoadOptions),U});
diff --git a/public/render/al/atago_1.png b/public/render/al/atago_1.png
new file mode 100644
index 0000000..4236e41
Binary files /dev/null and b/public/render/al/atago_1.png differ
diff --git a/public/render/al/atago_2.png b/public/render/al/atago_2.png
new file mode 100644
index 0000000..62f54c1
Binary files /dev/null and b/public/render/al/atago_2.png differ
diff --git a/public/render/al/belfast_1.png b/public/render/al/belfast_1.png
new file mode 100644
index 0000000..e6d8a42
Binary files /dev/null and b/public/render/al/belfast_1.png differ
diff --git a/public/render/al/belfast_2.png b/public/render/al/belfast_2.png
new file mode 100644
index 0000000..5a161c7
Binary files /dev/null and b/public/render/al/belfast_2.png differ
diff --git a/public/render/al/belfast_3.png b/public/render/al/belfast_3.png
new file mode 100644
index 0000000..f90aa51
Binary files /dev/null and b/public/render/al/belfast_3.png differ
diff --git a/public/render/al/eldridge_1.png b/public/render/al/eldridge_1.png
new file mode 100644
index 0000000..8c05662
Binary files /dev/null and b/public/render/al/eldridge_1.png differ
diff --git a/public/render/al/hammann_1.png b/public/render/al/hammann_1.png
new file mode 100644
index 0000000..144f70b
Binary files /dev/null and b/public/render/al/hammann_1.png differ
diff --git a/public/render/al/hammann_2.png b/public/render/al/hammann_2.png
new file mode 100644
index 0000000..f264f1f
Binary files /dev/null and b/public/render/al/hammann_2.png differ
diff --git a/public/render/al/javelin_1.png b/public/render/al/javelin_1.png
new file mode 100644
index 0000000..8801ebb
Binary files /dev/null and b/public/render/al/javelin_1.png differ
diff --git a/public/render/al/kaga_1.png b/public/render/al/kaga_1.png
new file mode 100644
index 0000000..8224edb
Binary files /dev/null and b/public/render/al/kaga_1.png differ
diff --git a/public/render/al/laffey_1.png b/public/render/al/laffey_1.png
new file mode 100644
index 0000000..22390b2
Binary files /dev/null and b/public/render/al/laffey_1.png differ
diff --git a/public/render/al/prinz_eugen_1.png b/public/render/al/prinz_eugen_1.png
new file mode 100644
index 0000000..b242b1f
Binary files /dev/null and b/public/render/al/prinz_eugen_1.png differ
diff --git a/public/render/al/prinz_eugen_2.png b/public/render/al/prinz_eugen_2.png
new file mode 100644
index 0000000..b4eb619
Binary files /dev/null and b/public/render/al/prinz_eugen_2.png differ
diff --git a/public/render/al/takao_1.png b/public/render/al/takao_1.png
new file mode 100644
index 0000000..592da7f
Binary files /dev/null and b/public/render/al/takao_1.png differ
diff --git a/public/render/al/takao_2.png b/public/render/al/takao_2.png
new file mode 100644
index 0000000..231e1d2
Binary files /dev/null and b/public/render/al/takao_2.png differ
diff --git a/public/render/al/unicorn_1.png b/public/render/al/unicorn_1.png
new file mode 100644
index 0000000..ab9b3d9
Binary files /dev/null and b/public/render/al/unicorn_1.png differ
diff --git a/public/render/al/unicorn_2.png b/public/render/al/unicorn_2.png
new file mode 100644
index 0000000..a081bb2
Binary files /dev/null and b/public/render/al/unicorn_2.png differ
diff --git a/public/render/al/unicorn_3.png b/public/render/al/unicorn_3.png
new file mode 100644
index 0000000..120f37f
Binary files /dev/null and b/public/render/al/unicorn_3.png differ
diff --git a/public/render/al/unicorn_4.png b/public/render/al/unicorn_4.png
new file mode 100644
index 0000000..851743f
Binary files /dev/null and b/public/render/al/unicorn_4.png differ
diff --git a/public/render/al/unicorn_5.png b/public/render/al/unicorn_5.png
new file mode 100644
index 0000000..8472cc3
Binary files /dev/null and b/public/render/al/unicorn_5.png differ
diff --git a/public/render/al/yamashiro_1.png b/public/render/al/yamashiro_1.png
new file mode 100644
index 0000000..1c7ba69
Binary files /dev/null and b/public/render/al/yamashiro_1.png differ
diff --git a/views/_globals.njk b/views/_globals.njk
index fef6f03..64f01e2 100644
--- a/views/_globals.njk
+++ b/views/_globals.njk
@@ -15,9 +15,9 @@
v2: Images and config files (manifest.json, browserconfig.xml, etc).
v3: CSS and JS files (libs such as bulma, lazyload, etc).
#}
-{% set v1 = "6SjzrVGxcS" %}
+{% set v1 = "6MfcbDZldp" %}
{% set v2 = "Ii3JYKIhb0" %}
-{% set v3 = "4TRCinLWfk" %}
+{% set v3 = "6MfcbDZldp" %}
{#
These will be the links in the homepage and the No-JS uploader.
diff --git a/views/home.njk b/views/home.njk
index f5c786b..c771aa3 100644
--- a/views/home.njk
+++ b/views/home.njk
@@ -23,6 +23,7 @@
+
{% endblock %}
{% block content %}
@@ -126,7 +127,7 @@
{% include "_partial/links.njk" %}
{% if gitHash -%}
- Git commit: {{ gitHash }}
+ Git commit: {{ gitHash }}
{%- endif %}