From ce80611a75269639bde26c15fe1e2c8fce8b4faa Mon Sep 17 00:00:00 2001 From: Vincent Boutour Date: Sat, 21 Oct 2023 10:58:50 +0200 Subject: [PATCH] fix(bundle): Fixing minify that takes only 4 files Signed-off-by: Vincent Boutour --- Makefile | 4 ++-- cmd/fibr/static/scripts/index.min.js | 2 +- cmd/fibr/static/styles/main.min.css | 2 +- go.mod | 2 +- go.sum | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 6ec0e8d1..54d6f9bf 100644 --- a/Makefile +++ b/Makefile @@ -94,8 +94,8 @@ build: build-web: go install "github.com/tdewolff/minify/v2/cmd/minify@latest" rm -f "cmd/fibr/static/scripts/index.min.js" "cmd/fibr/static/styles/main.min.css" - minify --bundle --output "cmd/fibr/static/scripts/index.min.js" "cmd/fibr/static/scripts/"*.js - minify --bundle --output "cmd/fibr/static/styles/main.min.css" "cmd/fibr/static/styles/"*.css + minify --bundle --all --recursive --output "cmd/fibr/static/scripts/index.min.js" "cmd/fibr/static/scripts/" + minify --bundle --all --recursive --output "cmd/fibr/static/styles/main.min.css" "cmd/fibr/static/styles/" ## run: Locally run the application, e.g. node index.js, python -m myapp, go run myapp etc ... .PHONY: run diff --git a/cmd/fibr/static/scripts/index.min.js b/cmd/fibr/static/scripts/index.min.js index 014f2528..52c9ef8d 100644 --- a/cmd/fibr/static/scripts/index.min.js +++ b/cmd/fibr/static/scripts/index.min.js @@ -1 +1 @@ -function isWebPCompatible(){const e="UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA";return new Promise((t,n)=>{const s=new Image;s.onload=()=>{s.width>0&&s.height>0?t():n()},s.onerror=n.bind(null,!0),s.src=`data:image/webp;base64,${e}`})}function appendChunk(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}function findIndexEscapeSequence(e,t){let n=0;for(let s=0;s=400)throw new Error("unable to load thumbnails");let t;typeof lazyLoadThumbnail!="undefined"&&lazyLoadThumbnail&&(t=new IntersectionObserver(async(e)=>{for(const s of e){if(!s.isIntersecting)continue;const n=s.target,o=n.parentElement.parentElement,i=generateThrobber(["throbber-white","throbber-overlay"]);if(o.appendChild(i),n.addEventListener("load",()=>o.removeChild(i),{once:!0}),window.webpHero){const t=await fetch(n.dataset.src,{credentials:"same-origin"}),s=await t.arrayBuffer(),e=new webpHero.WebpMachine;n.src=await e.decode(new Uint8Array(s)),e.clearCache()}else n.src=n.dataset.src;t.unobserve(n)}}));for await(let o of readChunk(n)){const i=o.findIndex(e=>e===44);if(i===-1){console.error("invalid line for thumbnail:",line);continue}const s=document.getElementById(`picture-${String.fromCharCode.apply(null,o.slice(0,i))}`);if(!s)continue;const e=new Image;e.src=`data:image/webp;base64,${encode(o.slice(i+1))}`,e.alt=s.dataset.alt,e.dataset.src=s.dataset.src,e.classList.add("thumbnail","full","block"),replaceContent(s,e),t!==void 0&&t.observe(e)}}document.addEventListener("readystatechange",async e=>{if(e.target.readyState!=="complete")return;let t=new Intl.DateTimeFormat(navigator.language,{dateStyle:"full",timeStyle:"long"});document.querySelectorAll(".date").forEach(e=>{e.innerHTML=t.format(new Date(e.innerHTML))})}),document.addEventListener("readystatechange",async e=>{if(e.target.readyState!=="complete")return;if(typeof hasThumbnail=="undefined"||!hasThumbnail)return;const t=document.querySelectorAll("[data-thumbnail]");if(!t)return;t.forEach(e=>{replaceContent(e,generateThrobber(["throbber-white"]))});try{await isWebPCompatible()}catch{await resolveScript("https://unpkg.com/webp-hero@0.0.2/dist-cjs/webp-hero.bundle.js","sha512-DA6h9H5Sqn55/uVn4JI4aSPFnAWoCQYYDXUnvjOAMNVx11///hX4QaFbQt5yWsrIm9hSI5fLJYfRWt3KXneSXQ==","anonymous")}try{await fetchThumbnail()}catch(e){console.error(e)}if(window.webpHero){const e=new webpHero.WebpMachine;e.polyfillDocument(),e.clearCache()}},!1),document.addEventListener("readystatechange",e=>{if(e.target.readyState!=="complete")return;document.querySelectorAll("[data-confirm]").forEach(e=>{e.addEventListener("click",t=>{confirm(`Are you sure you want to delete ${e.dataset.confirm}?`)||t.preventDefault()})})}),document.addEventListener("readystatechange",e=>{if(e.target.readyState!=="complete")return;const t=document.getElementById("go-back");t&&(t.setAttribute("href",document.referrer),t.addEventListener("click",e=>(e.preventDefault(),window.addEventListener("popstate",()=>{window.location.reload(!0)}),history.back(),!1)))});async function fetchGeoJSON(e){const t=await fetch(e,{credentials:"same-origin"});if(t.status>=400)throw new Error("unable to load geojson");return t.status===204?null:t.json()}async function addStyle(e,t,n){return new Promise(s=>{const o=document.createElement("link");o.rel="stylesheet",o.href=e,o.onload=s,t&&(o.integrity=t,o.crossOrigin=n),document.querySelector("head").appendChild(o)})}async function loadLeaflet(){const e="1.9.4";await addStyle(`https://unpkg.com/leaflet@${e}/dist/leaflet.css`,"sha512-Zcn6bjR/8RZbLEpLIeOwNtzREBAJnUKESxces60Mpoj+2okopSAcSUIUOseddDm0cxnGQzxIR7vJgsLZbdLE3w==","anonymous"),await addStyle("https://unpkg.com/leaflet.markercluster@1.5.1/dist/MarkerCluster.Default.css","sha512-6ZCLMiYwTeli2rVh3XAPxy3YoR5fVxGdH/pz+KMCzRY2M65Emgkw00Yqmhh8qLGeYQ3LbVZGdmOX9KUjSKr0TA==","anonymous"),await resolveScript(`https://unpkg.com/leaflet@${e}/dist/leaflet.js`,"sha512-BwHfrr4c9kmRkLw6iXFdzcdWV/PGkVgiIyIWLLlTSXzWQzxuSg4DiQUCpauz/EWjgk5TYQqX/kvn9pG1NpYfqg==","anonymous"),await resolveScript("https://unpkg.com/leaflet.markercluster@1.5.1/dist/leaflet.markercluster.js","sha512-+Zr0llcuE/Ho6wXRYtlWypMyWSEMxrWJxrYgeAMDRSf1FF46gQ3PAVOVp5RHdxdzikZXuHZ0soHpqRkkPkI3KA==","anonymous")}let map;async function renderMap(e){if(map){map.invalidateSize();return}const t=document.getElementById("map-container"),n=generateThrobber(["map-throbber","throbber-white"]);t&&t.appendChild(n),await loadLeaflet(),map=L.map("map-container",{center:[46.227638,2.213749],zoom:5}),L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'© OpenStreetMap contributors'}).addTo(map);const s=await fetchGeoJSON(e);if(!s||!s.features)return;const o=L.markerClusterGroup({zoomToBoundsOnClick:!1}),i=[];s.features.map(e=>{const t=L.GeoJSON.coordsToLatLng(e.geometry.coordinates);i.push(t),o.addLayer(L.circleMarker(t).bindPopup(`Image thumbnail
${e.properties.date}`,{maxWidth:"auto",closeButton:!1,className:"thumbnail-popup"}))}),o.on("clusterclick",e=>{map.fitBounds(e.layer.getAllChildMarkers().map(e=>e.getLatLng()))}),i.length?(map.once("zoomend",()=>{t.removeChild(n)}),map.fitBounds(i)):t.removeChild(n),map.addLayer(o)}document.addEventListener("readystatechange",async e=>{if(e.target.readyState!=="complete")return;document.location.hash==="#map"?await renderMap(geoURL):window.addEventListener("popstate",async()=>{document.location.hash==="#map"&&await renderMap(geoURL)})}) \ No newline at end of file +function isWebPCompatible(){const e="UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA";return new Promise((t,n)=>{const s=new Image;s.onload=()=>{s.width>0&&s.height>0?t():n()},s.onerror=n.bind(null,!0),s.src=`data:image/webp;base64,${e}`})}function appendChunk(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}function findIndexEscapeSequence(e,t){let n=0;for(let s=0;s=400)throw new Error("unable to load thumbnails");let t;typeof lazyLoadThumbnail!="undefined"&&lazyLoadThumbnail&&(t=new IntersectionObserver(async(e)=>{for(const s of e){if(!s.isIntersecting)continue;const n=s.target,o=n.parentElement.parentElement,i=generateThrobber(["throbber-white","throbber-overlay"]);if(o.appendChild(i),n.addEventListener("load",()=>o.removeChild(i),{once:!0}),window.webpHero){const t=await fetch(n.dataset.src,{credentials:"same-origin"}),s=await t.arrayBuffer(),e=new webpHero.WebpMachine;n.src=await e.decode(new Uint8Array(s)),e.clearCache()}else n.src=n.dataset.src;t.unobserve(n)}}));for await(let o of readChunk(n)){const i=o.findIndex(e=>e===44);if(i===-1){console.error("invalid line for thumbnail:",line);continue}const s=document.getElementById(`picture-${String.fromCharCode.apply(null,o.slice(0,i))}`);if(!s)continue;const e=new Image;e.src=`data:image/webp;base64,${encode(o.slice(i+1))}`,e.alt=s.dataset.alt,e.dataset.src=s.dataset.src,e.classList.add("thumbnail","full","block"),replaceContent(s,e),t!==void 0&&t.observe(e)}}document.addEventListener("readystatechange",async e=>{if(e.target.readyState!=="complete")return;let t=new Intl.DateTimeFormat(navigator.language,{dateStyle:"full",timeStyle:"long"});document.querySelectorAll(".date").forEach(e=>{e.innerHTML=t.format(new Date(e.innerHTML))})}),document.addEventListener("readystatechange",async e=>{if(e.target.readyState!=="complete")return;if(typeof hasThumbnail=="undefined"||!hasThumbnail)return;const t=document.querySelectorAll("[data-thumbnail]");if(!t)return;t.forEach(e=>{replaceContent(e,generateThrobber(["throbber-white"]))});try{await isWebPCompatible()}catch{await resolveScript("https://unpkg.com/webp-hero@0.0.2/dist-cjs/webp-hero.bundle.js","sha512-DA6h9H5Sqn55/uVn4JI4aSPFnAWoCQYYDXUnvjOAMNVx11///hX4QaFbQt5yWsrIm9hSI5fLJYfRWt3KXneSXQ==","anonymous")}try{await fetchThumbnail()}catch(e){console.error(e)}if(window.webpHero){const e=new webpHero.WebpMachine;e.polyfillDocument(),e.clearCache()}},!1),document.addEventListener("readystatechange",e=>{if(e.target.readyState!=="complete")return;document.querySelectorAll("[data-confirm]").forEach(e=>{e.addEventListener("click",t=>{confirm(`Are you sure you want to delete ${e.dataset.confirm}?`)||t.preventDefault()})})}),document.addEventListener("readystatechange",e=>{if(e.target.readyState!=="complete")return;const t=document.getElementById("go-back");t&&(t.setAttribute("href",document.referrer),t.addEventListener("click",e=>(e.preventDefault(),window.addEventListener("popstate",()=>{window.location.reload(!0)}),history.back(),!1)))});async function fetchGeoJSON(e){const t=await fetch(e,{credentials:"same-origin"});if(t.status>=400)throw new Error("unable to load geojson");return t.status===204?null:t.json()}async function addStyle(e,t,n){return new Promise(s=>{const o=document.createElement("link");o.rel="stylesheet",o.href=e,o.onload=s,t&&(o.integrity=t,o.crossOrigin=n),document.querySelector("head").appendChild(o)})}async function loadLeaflet(){const e="1.9.4";await addStyle(`https://unpkg.com/leaflet@${e}/dist/leaflet.css`,"sha512-Zcn6bjR/8RZbLEpLIeOwNtzREBAJnUKESxces60Mpoj+2okopSAcSUIUOseddDm0cxnGQzxIR7vJgsLZbdLE3w==","anonymous"),await addStyle("https://unpkg.com/leaflet.markercluster@1.5.1/dist/MarkerCluster.Default.css","sha512-6ZCLMiYwTeli2rVh3XAPxy3YoR5fVxGdH/pz+KMCzRY2M65Emgkw00Yqmhh8qLGeYQ3LbVZGdmOX9KUjSKr0TA==","anonymous"),await resolveScript(`https://unpkg.com/leaflet@${e}/dist/leaflet.js`,"sha512-BwHfrr4c9kmRkLw6iXFdzcdWV/PGkVgiIyIWLLlTSXzWQzxuSg4DiQUCpauz/EWjgk5TYQqX/kvn9pG1NpYfqg==","anonymous"),await resolveScript("https://unpkg.com/leaflet.markercluster@1.5.1/dist/leaflet.markercluster.js","sha512-+Zr0llcuE/Ho6wXRYtlWypMyWSEMxrWJxrYgeAMDRSf1FF46gQ3PAVOVp5RHdxdzikZXuHZ0soHpqRkkPkI3KA==","anonymous")}let map;async function renderMap(e){if(map){map.invalidateSize();return}const t=document.getElementById("map-container"),n=generateThrobber(["map-throbber","throbber-white"]);t&&t.appendChild(n),await loadLeaflet(),map=L.map("map-container",{center:[46.227638,2.213749],zoom:5}),L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'© OpenStreetMap contributors'}).addTo(map);const s=await fetchGeoJSON(e);if(!s||!s.features)return;const o=L.markerClusterGroup({zoomToBoundsOnClick:!1}),i=[];s.features.map(e=>{const t=L.GeoJSON.coordsToLatLng(e.geometry.coordinates);i.push(t),o.addLayer(L.circleMarker(t).bindPopup(`Image thumbnail
${e.properties.date}`,{maxWidth:"auto",closeButton:!1,className:"thumbnail-popup"}))}),o.on("clusterclick",e=>{map.fitBounds(e.layer.getAllChildMarkers().map(e=>e.getLatLng()))}),i.length?(map.once("zoomend",()=>{t.removeChild(n)}),map.fitBounds(i)):t.removeChild(n),map.addLayer(o)}document.addEventListener("readystatechange",async e=>{if(e.target.readyState!=="complete")return;document.location.hash==="#map"?await renderMap(geoURL):window.addEventListener("popstate",async()=>{document.location.hash==="#map"&&await renderMap(geoURL)})});function resolveScript(e,t,n){return new Promise((s,o)=>{const i=document.createElement("script");i.type="text/javascript",i.src=e,i.async=!0,i.onload=s.bind(null,!0),i.onerror=o.bind(null,!0),t&&(i.integrity=t,i.crossOrigin=n),document.querySelector("head").appendChild(i)})}window.onkeyup=e=>{switch(e.key){case"ArrowLeft":goToPrevious();break;case"ArrowRight":goToNext();break;case"Escape":goBack(e);break}};function goBack(e){const t=document.location.hash;if(t){if(typeof abort=="function"&&typeof aborter!="undefined"){abort(e);return}document.location.hash="",/success$/gim.test(t)&&window.location.reload(!0);return}if(typeof parentPage=="undefined")return;window.location.href=parentPage}function goToPrevious(){if(typeof previousFile=="undefined")return;window.location.href=previousFile}function goToNext(){if(typeof nextFile=="undefined")return;window.location.href=nextFile}function replaceContent(e,t){for(;e.firstChild;)e.removeChild(e.firstChild);t&&e.appendChild(t)}function generateThrobber(e=[]){const t=document.createElement("div");t.classList.add("throbber"),e.forEach(e=>t.classList.add(e));for(let e=1;e<4;e++){const n=document.createElement("div");n.classList.add("throbber-dot",`throbber-dot-${e}`),t.appendChild(n)}return t}let fileInput,uploadList,cancelButton;function eventNoop(e){e.preventDefault(),e.stopPropagation()}document.addEventListener("readystatechange",async e=>{if(e.target.readyState!=="complete")return;const t=document.getElementsByTagName("body")[0];t.addEventListener("dragover",eventNoop),t.addEventListener("dragleave",eventNoop),t.addEventListener("drop",e=>{eventNoop(e),window.location.hash="#upload-modal",fileInput&&(fileInput.files=e.dataTransfer.files,fileInput.dispatchEvent(new Event("change")))})});function bufferToHex(e){return Array.prototype.map.call(new Uint8Array(e),e=>`00${e.toString(16)}`.slice(-2)).join("")}async function sha(e){const t=await crypto.subtle.digest("SHA-256",new TextEncoder("utf-8").encode(e));return bufferToHex(t)}async function fileMessageId(e){const t=await sha(JSON.stringify({name:e.name,size:e.size,type:e.type,lastModified:e.lastModified}));return`upload-file-${t}`}function humanFileSize(e){return e<1024?e+"bytes":e<1048576?(e/1024).toFixed(0)+" KB":(e/1048576).toFixed(0)+" MB"}async function addUploadItem(e,t){const c=await fileMessageId(t),n=document.createElement("div");n.id=c,n.classList.add("flex","flex-center","margin");const o=document.createElement("div");o.classList.add("upload-item"),n.appendChild(o);const s=document.createElement("input");s.id=`${c}-filename`,s.classList.add("upload-name","full"),s.type="text",s.value=t.name,o.appendChild(s);const i=document.createElement("div");i.classList.add("full","flex","flex-center");const r=document.createElement("em");r.innerHTML=humanFileSize(t.size),r.style.width="8rem",i.appendChild(r);const a=document.createElement("progress");a.classList.add("flex-grow","margin-left"),a.max=100,a.value=0,i.appendChild(a),o.appendChild(i);const l=document.createElement("span");l.classList.add("upload-status"),n.appendChild(l),e.appendChild(n)}function getFiles(e){return[].filter.call(e.target,e=>e.nodeName.toLowerCase()==="input").reduce((e,t)=>(t.type==="file"?e.files=t.files:e[t.name]=t.value,e),{})}function getFilename(e,t){const n=document.getElementById(`${e}-filename`);return n&&n.value?n.value:t.name}function clearUploadStatus(e){if(!e)return;const t=e.querySelector(".upload-status");if(!t)return;t.classList.remove("danger"),t.classList.remove("success")}async function setUploadStatus(e,t,n,s){if(!e)return;const o=e.querySelector(".upload-status");if(!o)return;o.innerHTML=t,o.classList.add(n),s&&(o.title=s)}let uploadFile,aborter;const chunkSize=1024*1024;let currentUpload={};async function uploadFileByChunks(e,t,n,s){let i;if(e&&(i=e.querySelector("progress"),clearUploadStatus(e)),s.name!==currentUpload.filename){currentUpload.filename=s.name,currentUpload.chunks=[];for(let e=0;e=400)return Promise.reject(await a.text());currentUpload.chunks[e].done=!0,i&&(i.value=chunkSize*(e+1)/s.size*100)}const o=new FormData;o.append("method",t),o.append("filename",n),o.append("size",s.size);const a=await fetch("",{method:"POST",credentials:"same-origin",headers:{"X-Chunk-Upload":!0,Accept:"text/plain"},body:o}),r=await a.text();return a.status>=400?Promise.reject(r):(currentUpload={},Promise.resolve(r))}async function uploadFileByXHR(e,t,n,s){let o;e&&(o=e.querySelector("progress"),clearUploadStatus(e));const i=new FormData;return i.append("method",t),i.append("filename",n),i.append("size",s.size),i.append("file",s),new Promise((e,t)=>{let n=new XMLHttpRequest;aborter=n,o&&n.upload.addEventListener("progress",e=>o.value=parseInt(e.loaded/e.total*100,10),!1),n.addEventListener("readystatechange",s=>{if(n.readyState===XMLHttpRequest.UNSENT){t(new Error("request aborted")),n=void 0;return}if(n.readyState!==XMLHttpRequest.DONE)return;n.status>=200&&n.status<400?(o&&(o.value=100),e(n.responseText),n=void 0):(t(s),n=void 0)},!1),n.open("POST","",!0),n.setRequestHeader("Accept","text/plain"),n.send(i)})}function sliceFileList(e,t){const n=document.getElementById(e),s=new DataTransfer;for(;t{if(e.target.readyState!=="complete")return;if(typeof chunkUpload!="undefined"&&chunkUpload?uploadFile=uploadFileByChunks:uploadFile=uploadFileByXHR,fileInput=document.getElementById("file"),uploadList=document.getElementById("upload-list"),cancelButton=document.getElementById("upload-cancel"),fileInput){fileInput.classList.add("opacity"),fileInput.multiple=!0,fileInput.addEventListener("change",()=>{window.location.hash="#upload-modal",replaceContent(uploadList);for(const e of fileInput.files)addUploadItem(uploadList,e)});const e=document.getElementById("upload-button-link");e&&e.addEventListener("click",e=>{eventNoop(e),fileInput.click()})}const t=document.getElementById("file-label");t&&(t.classList.remove("hidden"),t.innerHTML="Choose files..."),uploadList&&uploadList.classList.remove("hidden"),cancelButton&&cancelButton.addEventListener("click",goBack);const n=document.getElementById("upload-form");n&&n.addEventListener("submit",upload)}),document.addEventListener("readystatechange",e=>{if(e.target.readyState!=="complete")return;const t=document.getElementById("webhook-url-label");if(!t)return;const n=document.getElementById("webhook-url"),s=document.getElementById("telegram-chat-id");document.getElementById("webhook-kind-raw").addEventListener("change",e=>{e.target.value==="raw"&&(n.placeholder="https://website.com/fibr",t.innerHTML="URL",s.classList.add("hidden"))}),document.getElementById("webhook-kind-discord").addEventListener("change",e=>{e.target.value==="discord"&&(n.placeholder="https://discord.com/api/webhooks/...",t.innerHTML="URL",s.classList.add("hidden"))}),document.getElementById("webhook-kind-slack").addEventListener("change",e=>{e.target.value==="slack"&&(n.placeholder="https://hooks.slack.com/services/...",t.innerHTML="URL",s.classList.add("hidden"))}),document.getElementById("webhook-kind-telegram").addEventListener("change",e=>{e.target.value==="telegram"&&(t.innerHTML="Token",n.placeholder="Bot token",s.classList.remove("hidden"))})}) \ No newline at end of file diff --git a/cmd/fibr/static/styles/main.min.css b/cmd/fibr/static/styles/main.min.css index ba476baf..80f22db0 100644 --- a/cmd/fibr/static/styles/main.min.css +++ b/cmd/fibr/static/styles/main.min.css @@ -1 +1 @@ -.thumbnail{max-height:100%;vertical-align:middle;width:100%}.exif-button{bottom:1rem;position:absolute;right:1rem}#exif-modal:target{display:flex;z-index:5}#exif-modal:target~.content{pointer-events:none}.breakable{word-break:break-word}.top-shadow{box-shadow:0 -.5em .5em -.5em var(--white)}:root{--primary:royalblue;--success:limegreen;--danger:crimson;--dark:#272727;--grey:#3b3b3b;--white:aliceblue;--icon-size:2.4rem;--icon-large:4.8rem}*{box-sizing:border-box}html{font-size:62.5%}body{-webkit-overflow-scrolling:touch;background-color:var(--dark);height:100vh}body,button,input{color:var(--white);font-family:-apple-system,segoe ui,roboto,oxygen-sans,ubuntu,cantarell,helvetica nue,sans-serif;font-size:1.6rem;font-style:normal;font-weight:400}input{color:var(--dark)}input[type=file]{color:var(--white)}a{color:var(--white);text-decoration:none}a:hover{color:var(--primary);text-decoration:underline}.primary{color:var(--primary)}.success{color:var(--success)}.danger{color:var(--danger)}.grey{color:var(--grey)}.white{color:var(--white)}.bg-primary,.bg-primary:hover{background-color:var(--primary);color:var(--white);text-decoration:none}.bg-success,.bg-success:hover{background-color:var(--success);color:var(--dark);text-decoration:none}.bg-danger,.bg-danger:hover{background-color:var(--danger);color:var(--white);text-decoration:none}.bg-grey,.bg-grey:hover{background-color:var(--grey);color:var(--white);text-decoration:none}.button{border-radius:4px;border:0;cursor:pointer;display:inline-block;margin:0;padding:1rem;text-decoration:none}.button-icon{background-color:initial}.icon{background-position:50%;background-repeat:no-repeat;color:var(--white);display:inline-block;height:var(--icon-size);text-decoration:none;vertical-align:middle}.icon-square{width:var(--icon-size)}.icon-large{height:var(--icon-large);width:var(--icon-large)}.icon-overlay{background-color:var(--white);border-radius:50%;height:var(--icon-large);left:calc((100% - var(--icon-large))/2);padding-left:1rem;pointer-events:none;position:absolute;top:calc((100% - var(--icon-large))/2);width:var(--icon-large)}.icon-overlay-small{bottom:1rem;height:var(--icon-size);position:absolute;right:1rem;width:var(--icon-size)}.clickable{cursor:pointer}.modal{align-items:flex-start;background-color:rgba(84,84,84,.75);display:none;height:100vh;justify-content:center;left:0;padding-top:5rem;pointer-events:none;position:fixed;top:0;width:100vw}.modal-content{background-color:var(--dark);display:flex;flex-direction:column;max-height:80%;max-width:90%;pointer-events:auto}.header{background-color:var(--grey);margin-top:0;padding:.5rem 1rem;text-align:left}.center{text-align:center}.padding{padding:1rem}.no-padding{padding:0}.margin{margin:1rem}.margin-left{margin-left:1rem}.no-margin{margin:0}.no-background{background-color:initial}.hidden{display:none}@media print{body::before{content:'Save ink, share link.'}body>*{display:none}}.flex{display:flex}.flex-center{align-items:center;justify-content:center}.flex-grow{flex:1 1}.flex-column{flex-direction:column}.full{width:100%}.full-screen{max-width:100vw}.medium{font-size:2.4rem}.small{font-size:1.6rem}.scrollable{overflow-y:auto}.padding-left{padding-left:1rem}.padding-right{padding-right:1rem}.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.flex-ellipsis{min-width:0}.relative{position:relative}.block{display:block}@media screen and (max-width:374px){.hide-xs{display:none}}@media screen and (max-width:599px){.hide-s{display:none}} \ No newline at end of file +.thumbnail{max-height:100%;vertical-align:middle;width:100%}.exif-button{bottom:1rem;position:absolute;right:1rem}#exif-modal:target{display:flex;z-index:5}#exif-modal:target~.content{pointer-events:none}.breakable{word-break:break-word}.top-shadow{box-shadow:0 -.5em .5em -.5em var(--white)}:root{--primary:royalblue;--success:limegreen;--danger:crimson;--dark:#272727;--grey:#3b3b3b;--white:aliceblue;--icon-size:2.4rem;--icon-large:4.8rem}*{box-sizing:border-box}html{font-size:62.5%}body{-webkit-overflow-scrolling:touch;background-color:var(--dark);height:100vh}body,button,input{color:var(--white);font-family:-apple-system,segoe ui,roboto,oxygen-sans,ubuntu,cantarell,helvetica nue,sans-serif;font-size:1.6rem;font-style:normal;font-weight:400}input{color:var(--dark)}input[type=file]{color:var(--white)}a{color:var(--white);text-decoration:none}a:hover{color:var(--primary);text-decoration:underline}.primary{color:var(--primary)}.success{color:var(--success)}.danger{color:var(--danger)}.grey{color:var(--grey)}.white{color:var(--white)}.bg-primary,.bg-primary:hover{background-color:var(--primary);color:var(--white);text-decoration:none}.bg-success,.bg-success:hover{background-color:var(--success);color:var(--dark);text-decoration:none}.bg-danger,.bg-danger:hover{background-color:var(--danger);color:var(--white);text-decoration:none}.bg-grey,.bg-grey:hover{background-color:var(--grey);color:var(--white);text-decoration:none}.button{border-radius:4px;border:0;cursor:pointer;display:inline-block;margin:0;padding:1rem;text-decoration:none}.button-icon{background-color:initial}.icon{background-position:50%;background-repeat:no-repeat;color:var(--white);display:inline-block;height:var(--icon-size);text-decoration:none;vertical-align:middle}.icon-square{width:var(--icon-size)}.icon-large{height:var(--icon-large);width:var(--icon-large)}.icon-overlay{background-color:var(--white);border-radius:50%;height:var(--icon-large);left:calc((100% - var(--icon-large))/2);padding-left:1rem;pointer-events:none;position:absolute;top:calc((100% - var(--icon-large))/2);width:var(--icon-large)}.icon-overlay-small{bottom:1rem;height:var(--icon-size);position:absolute;right:1rem;width:var(--icon-size)}.clickable{cursor:pointer}.modal{align-items:flex-start;background-color:rgba(84,84,84,.75);display:none;height:100vh;justify-content:center;left:0;padding-top:5rem;pointer-events:none;position:fixed;top:0;width:100vw}.modal-content{background-color:var(--dark);display:flex;flex-direction:column;max-height:80%;max-width:90%;pointer-events:auto}.header{background-color:var(--grey);margin-top:0;padding:.5rem 1rem;text-align:left}.center{text-align:center}.padding{padding:1rem}.no-padding{padding:0}.margin{margin:1rem}.margin-left{margin-left:1rem}.no-margin{margin:0}.no-background{background-color:initial}.hidden{display:none}@media print{body::before{content:'Save ink, share link.'}body>*{display:none}}.flex{display:flex}.flex-center{align-items:center;justify-content:center}.flex-grow{flex:1 1}.flex-column{flex-direction:column}.full{width:100%}.full-screen{max-width:100vw}.medium{font-size:2.4rem}.small{font-size:1.6rem}.scrollable{overflow-y:auto}.padding-left{padding-left:1rem}.padding-right{padding-right:1rem}.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.flex-ellipsis{min-width:0}.relative{position:relative}.block{display:block}@media screen and (max-width:374px){.hide-xs{display:none}}@media screen and (max-width:599px){.hide-s{display:none}}#map:target{display:flex;z-index:5}#map:target~.content{pointer-events:none}#map-container{background-color:var(--grey);color:var(--dark);height:80vh;width:80vw}.thumbnail-img{height:15rem}.thumbnail-popup{bottom:55px!important;height:15rem;width:19rem}.map-throbber{z-index:500}.map-throbber .throbber-dot{height:3.2rem;width:3.2rem}#search:target{display:flex;z-index:5}#search:target~.content{pointer-events:none}#size,#since{width:7rem}.share-form-modal:target{display:flex;z-index:5}.share-form-modal:target~.content{pointer-events:none}.share-list-modal:target{display:flex;z-index:5}.share-list-modal:target~.content{pointer-events:none}#shares{border-spacing:0;display:block;overflow-x:hidden;overflow-y:auto}#shares th,#shares td{padding:1rem}.share-link{color:var(--success)}.share-content:hover{background-color:var(--grey)}.path{max-width:30rem;text-align:left}@media screen and (max-width:485px){#shares th,#shares td{padding:.5rem}.path{max-width:20rem}}@media screen and (max-width:430px){.path{max-width:16rem}}@media screen and (max-width:375px){.path{max-width:12rem}}@media screen and (max-width:320px){.path{max-width:8rem}}.stats{margin:0 auto;width:30rem}.key{display:inline-block;width:10rem}.throbber{margin:auto;text-align:center}.throbber-dot{animation:throbber-dot 1.4s infinite ease-in-out both;background-color:var(--dark);border-radius:100%;display:inline-block;height:1rem;width:1rem}.throbber-white .throbber-dot{background-color:var(--white)}.throbber-dot-1{animation-delay:-.32s}.throbber-dot-2{animation-delay:-.16s}@keyframes throbber-dot{0%,80%,100%{transform:scale(0)}40%{transform:scale(1)}}.upload-modal:target,.upload-success:target{display:flex;z-index:5}.upload-modal:target~.content,.upload-success:target~.content{pointer-events:none}.upload-width{max-width:30rem}.upload-item{display:inline-block;width:calc(100% - 2rem)}.upload-name{text-align:left}.opacity{flex:0 0;opacity:0}.upload-status{margin-left:.5rem;text-align:right;width:2rem}#webhook-form:target{display:flex;z-index:5}#webhook-form:target~.content{pointer-events:none}#webhook-list:target{display:flex;z-index:5}#webhook-list:target~.content{pointer-events:none}#webhooks{border-spacing:0;display:block;overflow:auto}#webhooks th,#webhooks td{padding:1rem}.webhook-content:hover{background-color:var(--grey)}.url{max-width:30rem;text-align:left}@media screen and (max-width:485px){.url{max-width:20rem}}@media screen and (max-width:430px){.url{max-width:16rem}}@media screen and (max-width:375px){.url{max-width:12rem}}@media screen and (max-width:320px){.url{max-width:8rem}} \ No newline at end of file diff --git a/go.mod b/go.mod index 317f69d3..0726e76c 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/ViBiOh/auth/v2 v2.16.1 github.com/ViBiOh/exas v0.7.1 github.com/ViBiOh/flags v1.4.1 - github.com/ViBiOh/httputils/v4 v4.66.8 + github.com/ViBiOh/httputils/v4 v4.66.9 github.com/ViBiOh/vith v0.6.0 github.com/rabbitmq/amqp091-go v1.9.0 github.com/redis/go-redis/v9 v9.2.1 diff --git a/go.sum b/go.sum index 8e1e3002..6f7444bf 100644 --- a/go.sum +++ b/go.sum @@ -8,8 +8,8 @@ github.com/ViBiOh/exas v0.7.1 h1:nzh6E1668OFRgoTIJZJa1RybCW64Gd918qi0Z+0Q4WA= github.com/ViBiOh/exas v0.7.1/go.mod h1:MvIWQZXpWgg45Vsde9bMV48Kb0J8frya8vimmrkQ04E= github.com/ViBiOh/flags v1.4.1 h1:qEAO70rWTYcVlU9BgCuz0SgMjth12oi502cq3SHDudg= github.com/ViBiOh/flags v1.4.1/go.mod h1:Ocgx/QhY7WYNfGokFT3kw5C05pDooQyLbI/9ZWwylI4= -github.com/ViBiOh/httputils/v4 v4.66.8 h1:a5UQCVgUB0iAwkR5B9fbvx9OLC2OHJuNwpalAs9YKR0= -github.com/ViBiOh/httputils/v4 v4.66.8/go.mod h1:7KTWHkVw50L+UG7XHK9mtPQpTHMPdDyWV0MY+cCNpqw= +github.com/ViBiOh/httputils/v4 v4.66.9 h1:iPb6PYaYClgiB39xdo/SeKkbai46AyuqGYfmHyHuZuc= +github.com/ViBiOh/httputils/v4 v4.66.9/go.mod h1:7KTWHkVw50L+UG7XHK9mtPQpTHMPdDyWV0MY+cCNpqw= github.com/ViBiOh/vith v0.6.0 h1:bdLmwgqUEWi3ivShtAhtM9gOZlWQzvZi2Z5b0BRSB1U= github.com/ViBiOh/vith v0.6.0/go.mod h1:eRqtDU2uB8g85vll4spbnCV93DHyHNAYwXCMIBH1GuQ= github.com/bsm/ginkgo/v2 v2.7.0/go.mod h1:AiKlXPm7ItEHNc/2+OkrNG4E0ITzojb9/xWzvQ9XZ9w=