photos/js/photos-src_mixins_GridConfi...

1 line
29 KiB
Plaintext

{"version":3,"file":"photos-src_mixins_GridConfig_js-src_components_FolderTagPreview_vue.js?v=c196a3a16d5b4c863107","mappings":"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","sources":["webpack:///photos/src/assets/grid-sizes.js","webpack:///photos/src/services/GridConfig.js","webpack:///photos/src/mixins/GridConfig.js","webpack:///photos/src/components/FolderTagPreview.vue?vue&type=style&index=0&id=b8db2226&lang=scss&scoped=true&","webpack:///photos/src/components/FolderTagPreview.vue?vue&type=template&id=b8db2226&scoped=true&","webpack:///photos/src/components/FolderTagPreview.vue","webpack:///photos/src/components/FolderTagPreview.vue?vue&type=script&lang=js&","webpack://photos/./src/components/FolderTagPreview.vue?21a1","webpack://photos/./src/components/FolderTagPreview.vue?9d8b"],"sourcesContent":["/**\n * @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n// for now we want to keep the same gap everywhere\nconst gap = 8\n\n/**\n * Define the max width proportions\n * The number (key) indicate the MAX size\n *\n * needs to be compatible with webpack config\n * so no export default {}\n */\nmodule.exports = {\n\tsizes: {\n\t\t400: {\n\t\t\tmarginTop: 66,\n\t\t\tmarginW: gap,\n\t\t\tcount: 3,\n\t\t\tgap,\n\t\t},\n\t\t700: {\n\t\t\tmarginTop: 66,\n\t\t\tmarginW: gap,\n\t\t\tcount: 4,\n\t\t\tgap,\n\t\t},\n\t\t1024: {\n\t\t\tmarginTop: 66,\n\t\t\tmarginW: 44,\n\t\t\tcount: 5,\n\t\t\tgap,\n\t\t},\n\t\t1280: {\n\t\t\tmarginTop: 66,\n\t\t\tmarginW: 44,\n\t\t\tcount: 4,\n\t\t\tgap,\n\t\t},\n\t\t1440: {\n\t\t\tmarginTop: 88,\n\t\t\tmarginW: 66,\n\t\t\tcount: 5,\n\t\t\tgap,\n\t\t},\n\t\t1600: {\n\t\t\tmarginTop: 88,\n\t\t\tmarginW: 66,\n\t\t\tcount: 6,\n\t\t\tgap,\n\t\t},\n\t\t2048: {\n\t\t\tmarginTop: 88,\n\t\t\tmarginW: 66,\n\t\t\tcount: 7,\n\t\t\tgap,\n\t\t},\n\t\t2560: {\n\t\t\tmarginTop: 88,\n\t\t\tmarginW: 88,\n\t\t\tcount: 8,\n\t\t\tgap,\n\t\t},\n\t\t3440: {\n\t\t\tmarginTop: 88,\n\t\t\tmarginW: 88,\n\t\t\tcount: 9,\n\t\t\tgap,\n\t\t},\n\t\tmax: {\n\t\t\tmarginTop: 88,\n\t\t\tmarginW: 88,\n\t\t\tcount: 10,\n\t\t\tgap,\n\t\t},\n\t},\n}\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport Vue from 'vue'\nimport { sizes } from '../assets/grid-sizes'\n\nexport default new Vue({\n\tdata() {\n\t\treturn {\n\t\t\tgridConfig: sizes.max,\n\t\t}\n\t},\n\twatch: {\n\t\tgridConfig(val) {\n\t\t\tthis.$emit('changed', val)\n\t\t},\n\t},\n\tcreated() {\n\t\twindow.addEventListener('resize', this.handleWindowResize)\n\t\tthis.handleWindowResize()\n\t},\n\tbeforeDestroy() {\n\t\twindow.removeEventListener('resize', this.handleWindowResize)\n\t},\n\tmethods: {\n\t\thandleWindowResize() {\n\t\t\t// find the first grid size that fit the current window width\n\t\t\tconst currentSize = Object.keys(sizes).find(size => size > document.documentElement.clientWidth)\n\t\t\tthis.gridConfig = sizes[currentSize] || sizes.max\n\t\t},\n\t},\n})\n","/**\n * @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport getGridConfig from '../services/GridConfig'\n\n/**\n * Get the current used grid config\n */\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tgridConfig: {},\n\t\t}\n\t},\n\n\tcreated() {\n\t\tgetGridConfig.$on('changed', val => {\n\t\t\tthis.gridConfig = val\n\t\t})\n\t\tconsole.debug(`[${appName}]`, 'Grid config', Object.assign({}, getGridConfig.gridConfig))\n\t\tthis.gridConfig = getGridConfig.gridConfig\n\t},\n\n\tbeforeDestroy() {\n\t\tgetGridConfig.$off('changed', this.gridConfig)\n\t},\n}\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".file[data-v-b8db2226],.folder[data-v-b8db2226]{position:relative;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border-radius:var(--border-radius);overflow:hidden}.file .cover[data-v-b8db2226],.folder .cover[data-v-b8db2226]{z-index:2;width:100%;padding-bottom:100%;transition:opacity var(--animation-quick) ease-in-out;opacity:0;background-color:var(--color-main-text)}.file.active .cover[data-v-b8db2226],.file:active .cover[data-v-b8db2226],.file:hover .cover[data-v-b8db2226],.file:focus .cover[data-v-b8db2226],.folder.active .cover[data-v-b8db2226],.folder:active .cover[data-v-b8db2226],.folder:hover .cover[data-v-b8db2226],.folder:focus .cover[data-v-b8db2226]{opacity:.3}.file--clear.active .cover[data-v-b8db2226],.file--clear:active .cover[data-v-b8db2226],.file--clear:hover .cover[data-v-b8db2226],.file--clear:focus .cover[data-v-b8db2226],.folder--clear.active .cover[data-v-b8db2226],.folder--clear:active .cover[data-v-b8db2226],.folder--clear:hover .cover[data-v-b8db2226],.folder--clear:focus .cover[data-v-b8db2226]{opacity:.1}.fade-enter-active[data-v-b8db2226],.fade-leave-active[data-v-b8db2226]{transition:opacity var(--animation-quick) ease-in-out}.fade-enter[data-v-b8db2226],.fade-leave-to[data-v-b8db2226]{opacity:0}.folder-content[data-v-b8db2226]{position:absolute;display:grid;width:100%;height:100%}.folder-content--grid-1[data-v-b8db2226]{grid-template-columns:1fr;grid-template-rows:1fr}.folder-content--grid-2[data-v-b8db2226]{grid-template-columns:1fr;grid-template-rows:1fr 1fr}.folder-content--grid-3[data-v-b8db2226]{grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr}.folder-content--grid-3 img[data-v-b8db2226]:first-child{grid-column:span 2}.folder-content--grid-4[data-v-b8db2226]{grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr}.folder-content img[data-v-b8db2226]{width:100%;height:100%;object-fit:cover}.folder-name[data-v-b8db2226]{position:absolute;z-index:3;display:flex;overflow:hidden;flex-direction:column;width:100%;height:100%;transition:opacity var(--animation-quick) ease-in-out;opacity:1}.folder-name__icon[data-v-b8db2226]{height:40%;margin-top:calc(30% - 1rem / 2);background-size:40%}.folder-name__name[data-v-b8db2226]{overflow:hidden;height:1rem;padding:0 10px;text-align:center;white-space:nowrap;text-overflow:ellipsis;color:var(--color-main-background);text-shadow:0 0 8px var(--color-main-text);font-size:1rem;line-height:1rem}.folder--clear .folder-name__icon[data-v-b8db2226]{opacity:.3}.folder--clear .folder-name__name[data-v-b8db2226]{color:var(--color-main-text);text-shadow:0 0 8px var(--color-main-background)}.folder:not(.folder--clear) .cover[data-v-b8db2226]{opacity:.3}.folder:not(.folder--clear):active .folder-name[data-v-b8db2226],.folder:not(.folder--clear):active .cover[data-v-b8db2226],.folder:not(.folder--clear):hover .folder-name[data-v-b8db2226],.folder:not(.folder--clear):hover .cover[data-v-b8db2226],.folder:not(.folder--clear):focus .folder-name[data-v-b8db2226],.folder:not(.folder--clear):focus .cover[data-v-b8db2226]{opacity:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/mixins/FileFolder.scss\",\"webpack://./src/components/FolderTagPreview.vue\"],\"names\":[],\"mappings\":\"AAsBA,gDAEC,iBAAA,CACA,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,wBAAA,CAAA,gBAAA,CACA,kCAAA,CACA,eAAA,CAEA,8DACC,SAAA,CAMA,UAAA,CACA,mBAAA,CACA,qDAAA,CACA,SAAA,CACA,uCAAA,CAOA,4SACC,UAAA,CAQD,oWACC,UAAA,CAKH,wEACC,qDAAA,CAGD,6DACC,SAAA,CCkFD,iCACC,iBAAA,CACA,YAAA,CACA,UAAA,CACA,WAAA,CAEA,yCACC,yBAAA,CACA,sBAAA,CAED,yCACC,yBAAA,CACA,0BAAA,CAED,yCACC,6BAAA,CACA,0BAAA,CACA,yDACC,kBAAA,CAGF,yCACC,6BAAA,CACA,0BAAA,CAED,qCACC,UAAA,CACA,WAAA,CAEA,gBAAA,CAMF,8BACC,iBAAA,CACA,SAAA,CACA,YAAA,CACA,eAAA,CACA,qBAAA,CACA,UAAA,CACA,WAAA,CACA,qDAAA,CACA,SAAA,CACA,oCACC,UAAA,CACA,+BAAA,CACA,mBAAA,CAED,oCACC,eAAA,CACA,WAnBY,CAoBZ,cAAA,CACA,iBAAA,CACA,kBAAA,CACA,sBAAA,CACA,kCAAA,CACA,0CAAA,CACA,cA1BY,CA2BZ,gBA3BY,CAmCZ,mDACC,UAAA,CAED,mDACC,4BAAA,CACA,gDAAA,CAQD,oDACC,UAAA,CAQA,gXAEC,SAAA\",\"sourcesContent\":[\"/**\\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\\n *\\n * @author John Molakvoæ <skjnldsv@protonmail.com>\\n *\\n * @license AGPL-3.0-or-later\\n *\\n * This program is free software: you can redistribute it and/or modify\\n * it under the terms of the GNU Affero General Public License as\\n * published by the Free Software Foundation, either version 3 of the\\n * License, or (at your option) any later version.\\n *\\n * This program is distributed in the hope that it will be useful,\\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\\n * GNU Affero General Public License for more details.\\n *\\n * You should have received a copy of the GNU Affero General Public License\\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\\n *\\n */\\n\\n.file,\\n.folder {\\n\\tposition: relative;\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n\\tuser-select: none;\\n\\tborder-radius: var(--border-radius);\\n\\toverflow: hidden;\\n\\n\\t.cover {\\n\\t\\tz-index: 2;\\n\\t\\t// We want nice squares despite anything that is in it.\\n\\t\\t// The .cover is what makes the exact square size of the grid.\\n\\t\\t// We use padding-bottom because padding with percentage\\n\\t\\t// always refers to the width. And we only want to fit\\n\\t\\t// the css grid's width.\\n\\t\\twidth: 100%;\\n\\t\\tpadding-bottom: 100%;\\n\\t\\ttransition: opacity var(--animation-quick) ease-in-out;\\n\\t\\topacity: 0;\\n\\t\\tbackground-color: var(--color-main-text);\\n\\t}\\n\\n\\t&.active,\\n\\t&:active,\\n\\t&:hover,\\n\\t&:focus {\\n\\t\\t.cover {\\n\\t\\t\\topacity: .3;\\n\\t\\t}\\n\\t}\\n\\n\\t&--clear.active,\\n\\t&--clear:active,\\n\\t&--clear:hover,\\n\\t&--clear:focus {\\n\\t\\t.cover {\\n\\t\\t\\topacity: .1;\\n\\t\\t}\\n\\t}\\n}\\n\\n.fade-enter-active, .fade-leave-active {\\n\\ttransition: opacity var(--animation-quick) ease-in-out;\\n}\\n\\n.fade-enter, .fade-leave-to {\\n\\topacity: 0;\\n}\\n\",\"$sizes: (\\\"400\\\": (\\\"count\\\": 3, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"700\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"1024\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1280\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1440\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"1600\\\": (\\\"count\\\": 6, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2048\\\": (\\\"count\\\": 7, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2560\\\": (\\\"count\\\": 8, \\\"marginTop\\\": 88, \\\"marginW\\\": 88), \\\"3440\\\": (\\\"count\\\": 9, \\\"marginTop\\\": 88, \\\"marginW\\\": 88), \\\"max\\\": (\\\"count\\\": 10, \\\"marginTop\\\": 88, \\\"marginW\\\": 88));\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n@import '../mixins/FileFolder';\\n\\n.folder-content {\\n\\tposition: absolute;\\n\\tdisplay: grid;\\n\\twidth: 100%;\\n\\theight: 100%;\\n\\t// folder layout if less than 4 pictures\\n\\t&--grid-1 {\\n\\t\\tgrid-template-columns: 1fr;\\n\\t\\tgrid-template-rows: 1fr;\\n\\t}\\n\\t&--grid-2 {\\n\\t\\tgrid-template-columns: 1fr;\\n\\t\\tgrid-template-rows: 1fr 1fr;\\n\\t}\\n\\t&--grid-3 {\\n\\t\\tgrid-template-columns: 1fr 1fr;\\n\\t\\tgrid-template-rows: 1fr 1fr;\\n\\t\\timg:first-child {\\n\\t\\t\\tgrid-column: span 2;\\n\\t\\t}\\n\\t}\\n\\t&--grid-4 {\\n\\t\\tgrid-template-columns: 1fr 1fr;\\n\\t\\tgrid-template-rows: 1fr 1fr;\\n\\t}\\n\\timg {\\n\\t\\twidth: 100%;\\n\\t\\theight: 100%;\\n\\n\\t\\tobject-fit: cover;\\n\\t}\\n}\\n\\n$name-height: 1rem;\\n\\n.folder-name {\\n\\tposition: absolute;\\n\\tz-index: 3;\\n\\tdisplay: flex;\\n\\toverflow: hidden;\\n\\tflex-direction: column;\\n\\twidth: 100%;\\n\\theight: 100%;\\n\\ttransition: opacity var(--animation-quick) ease-in-out;\\n\\topacity: 1;\\n\\t&__icon {\\n\\t\\theight: 40%;\\n\\t\\tmargin-top: calc(30% - #{$name-height} / 2); // center name+icon\\n\\t\\tbackground-size: 40%;\\n\\t}\\n\\t&__name {\\n\\t\\toverflow: hidden;\\n\\t\\theight: $name-height;\\n\\t\\tpadding: 0 10px;\\n\\t\\ttext-align: center;\\n\\t\\twhite-space: nowrap;\\n\\t\\ttext-overflow: ellipsis;\\n\\t\\tcolor: var(--color-main-background);\\n\\t\\ttext-shadow: 0 0 8px var(--color-main-text);\\n\\t\\tfont-size: $name-height;\\n\\t\\tline-height: $name-height;\\n\\t}\\n}\\n\\n// Cover management empty/full\\n.folder {\\n\\t// if no img, let's display the folder icon as default black\\n\\t&--clear {\\n\\t\\t.folder-name__icon {\\n\\t\\t\\topacity: .3;\\n\\t\\t}\\n\\t\\t.folder-name__name {\\n\\t\\t\\tcolor: var(--color-main-text);\\n\\t\\t\\ttext-shadow: 0 0 8px var(--color-main-background);\\n\\t\\t}\\n\\t}\\n\\n\\t// show the cover as background\\n\\t// if there are pictures in it\\n\\t// so we can sho the folder+name above it\\n\\t&:not(.folder--clear) {\\n\\t\\t.cover {\\n\\t\\t\\topacity: .3;\\n\\t\\t}\\n\\n\\t\\t// hide everything but pictures\\n\\t\\t// on hover/active/focus\\n\\t\\t&:active,\\n\\t\\t&:hover,\\n\\t\\t&:focus {\\n\\t\\t\\t.folder-name,\\n\\t\\t\\t.cover {\\n\\t\\t\\t\\topacity: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('router-link',{staticClass:\"folder\",class:{'folder--clear': _vm.isEmpty},attrs:{\"to\":_vm.to,\"aria-label\":_vm.ariaLabel}},[_c('transition',{attrs:{\"name\":\"fade\"}},[_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.loaded),expression:\"loaded\"}],staticClass:\"folder-content\",class:(\"folder-content--grid-\" + (_vm.previewList.length)),attrs:{\"role\":\"none\"}},_vm._l((_vm.previewList),function(file){return _c('img',{key:file.fileid,attrs:{\"src\":_vm.generateImgSrc(file),\"alt\":\"\"},on:{\"load\":function($event){_vm.loaded = true},\"error\":function($event){return _vm.onPreviewFail(file)}}})}),0)]),_vm._v(\" \"),_c('div',{staticClass:\"folder-name\"},[_c('span',{staticClass:\"folder-name__icon\",class:[!_vm.isEmpty ? 'icon-white' : 'icon-dark', _vm.icon],attrs:{\"role\":\"img\"}}),_vm._v(\" \"),_c('p',{staticClass:\"folder-name__name\",attrs:{\"id\":_vm.ariaUuid}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.name)+\"\\n\\t\\t\")])]),_vm._v(\" \"),_c('div',{staticClass:\"cover\",attrs:{\"role\":\"none\"}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<router-link :class=\"{'folder--clear': isEmpty}\"\n\t\tclass=\"folder\"\n\t\t:to=\"to\"\n\t\t:aria-label=\"ariaLabel\">\n\t\t<!-- Images preview -->\n\t\t<transition name=\"fade\">\n\t\t\t<div v-show=\"loaded\"\n\t\t\t\t:class=\"`folder-content--grid-${previewList.length}`\"\n\t\t\t\tclass=\"folder-content\"\n\t\t\t\trole=\"none\">\n\t\t\t\t<img v-for=\"file in previewList\"\n\t\t\t\t\t:key=\"file.fileid\"\n\t\t\t\t\t:src=\"generateImgSrc(file)\"\n\t\t\t\t\talt=\"\"\n\t\t\t\t\t@load=\"loaded = true\"\n\t\t\t\t\t@error=\"onPreviewFail(file)\">\n\t\t\t</div>\n\t\t</transition>\n\n\t\t<div class=\"folder-name\">\n\t\t\t<span :class=\"[!isEmpty ? 'icon-white' : 'icon-dark', icon]\"\n\t\t\t\tclass=\"folder-name__icon\"\n\t\t\t\trole=\"img\" />\n\t\t\t<p :id=\"ariaUuid\" class=\"folder-name__name\">\n\t\t\t\t{{ name }}\n\t\t\t</p>\n\t\t</div>\n\n\t\t<div class=\"cover\" role=\"none\" />\n\t</router-link>\n</template>\n\n<script>\nimport { generateUrl } from '@nextcloud/router'\n\nexport default {\n\tname: 'FolderTagPreview',\n\n\tprops: {\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: 'icon-folder',\n\t\t},\n\t\tid: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tpath: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tfileList: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tloaded: false,\n\t\t\tfailed: [],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t// folder is empty\n\t\tisEmpty() {\n\t\t\treturn this.previewList.length === 0\n\t\t},\n\n\t\tariaUuid() {\n\t\t\treturn `folder-${this.id}`\n\t\t},\n\t\tariaLabel() {\n\t\t\treturn t('photos', 'Open the \"{name}\" sub-directory', { name: this.name })\n\t\t},\n\n\t\t/**\n\t\t * Previews list without the failed ones\n\t\t *\n\t\t * @return {object[]} the previews fileinfo\n\t\t */\n\t\tpreviewList() {\n\t\t\treturn this.fileList\n\t\t\t\t.filter(file => this.failed.indexOf(file.fileid) === -1)\n\t\t},\n\n\t\t/**\n\t\t * We do not want encoded slashes when browsing by folder\n\t\t * so we generate a new valid route object based on the\n\t\t * current named route, get the final url back, decode it\n\t\t * and use it as a direct string.\n\t\t * Which vue-router does not encode afterwards!\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tto() {\n\t\t\t// always remove first slash, the router\n\t\t\t// manage it automatically\n\t\t\tconst regex = /^\\/?(.+)/i\n\t\t\tconst path = regex.exec(this.path)[1]\n\n\t\t\t// apply to current route\n\t\t\treturn Object.assign({}, this.$route, {\n\t\t\t\tparams: { path: path.split('/') },\n\t\t\t})\n\t\t},\n\t},\n\n\tmethods: {\n\t\tgenerateImgSrc({ fileid, etag }) {\n\t\t\t// use etag to force cache reload if file changed\n\t\t\treturn generateUrl(`/core/preview?fileId=${fileid}&c=${etag}&x=${250}&y=${250}&forceIcon=0&a=0`)\n\t\t},\n\t\tonPreviewFail({ fileid }) {\n\t\t\tthis.failed.push(fileid)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '../mixins/FileFolder';\n\n.folder-content {\n\tposition: absolute;\n\tdisplay: grid;\n\twidth: 100%;\n\theight: 100%;\n\t// folder layout if less than 4 pictures\n\t&--grid-1 {\n\t\tgrid-template-columns: 1fr;\n\t\tgrid-template-rows: 1fr;\n\t}\n\t&--grid-2 {\n\t\tgrid-template-columns: 1fr;\n\t\tgrid-template-rows: 1fr 1fr;\n\t}\n\t&--grid-3 {\n\t\tgrid-template-columns: 1fr 1fr;\n\t\tgrid-template-rows: 1fr 1fr;\n\t\timg:first-child {\n\t\t\tgrid-column: span 2;\n\t\t}\n\t}\n\t&--grid-4 {\n\t\tgrid-template-columns: 1fr 1fr;\n\t\tgrid-template-rows: 1fr 1fr;\n\t}\n\timg {\n\t\twidth: 100%;\n\t\theight: 100%;\n\n\t\tobject-fit: cover;\n\t}\n}\n\n$name-height: 1rem;\n\n.folder-name {\n\tposition: absolute;\n\tz-index: 3;\n\tdisplay: flex;\n\toverflow: hidden;\n\tflex-direction: column;\n\twidth: 100%;\n\theight: 100%;\n\ttransition: opacity var(--animation-quick) ease-in-out;\n\topacity: 1;\n\t&__icon {\n\t\theight: 40%;\n\t\tmargin-top: calc(30% - #{$name-height} / 2); // center name+icon\n\t\tbackground-size: 40%;\n\t}\n\t&__name {\n\t\toverflow: hidden;\n\t\theight: $name-height;\n\t\tpadding: 0 10px;\n\t\ttext-align: center;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\tcolor: var(--color-main-background);\n\t\ttext-shadow: 0 0 8px var(--color-main-text);\n\t\tfont-size: $name-height;\n\t\tline-height: $name-height;\n\t}\n}\n\n// Cover management empty/full\n.folder {\n\t// if no img, let's display the folder icon as default black\n\t&--clear {\n\t\t.folder-name__icon {\n\t\t\topacity: .3;\n\t\t}\n\t\t.folder-name__name {\n\t\t\tcolor: var(--color-main-text);\n\t\t\ttext-shadow: 0 0 8px var(--color-main-background);\n\t\t}\n\t}\n\n\t// show the cover as background\n\t// if there are pictures in it\n\t// so we can sho the folder+name above it\n\t&:not(.folder--clear) {\n\t\t.cover {\n\t\t\topacity: .3;\n\t\t}\n\n\t\t// hide everything but pictures\n\t\t// on hover/active/focus\n\t\t&:active,\n\t\t&:hover,\n\t\t&:focus {\n\t\t\t.folder-name,\n\t\t\t.cover {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\n</style>\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FolderTagPreview.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FolderTagPreview.vue?vue&type=script&lang=js&\"","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2[0].rules[0].use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FolderTagPreview.vue?vue&type=style&index=0&id=b8db2226&lang=scss&scoped=true&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2[0].rules[0].use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FolderTagPreview.vue?vue&type=style&index=0&id=b8db2226&lang=scss&scoped=true&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./FolderTagPreview.vue?vue&type=template&id=b8db2226&scoped=true&\"\nimport script from \"./FolderTagPreview.vue?vue&type=script&lang=js&\"\nexport * from \"./FolderTagPreview.vue?vue&type=script&lang=js&\"\nimport style0 from \"./FolderTagPreview.vue?vue&type=style&index=0&id=b8db2226&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"b8db2226\",\n null\n \n)\n\nexport default component.exports"],"names":["module","exports","sizes","400","marginTop","marginW","count","gap","700","1024","1280","1440","1600","2048","2560","3440","max","Vue","data","gridConfig","watch","val","this","$emit","created","window","addEventListener","handleWindowResize","beforeDestroy","removeEventListener","methods","currentSize","Object","keys","find","size","document","documentElement","clientWidth","getGridConfig","console","debug","appName","assign","___CSS_LOADER_EXPORT___","push","id","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","_vm","_h","$createElement","_c","_self","staticClass","class","isEmpty","attrs","to","ariaLabel","directives","name","rawName","value","expression","previewList","_l","file","key","fileid","generateImgSrc","on","$event","loaded","onPreviewFail","_v","icon","ariaUuid","_s"],"sourceRoot":""}