diff --git a/.gitignore b/.gitignore
index 4a4beca..30e63a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,10 +2,10 @@ node_modules
.DS_Store
dist
dist-ssr
-config
-pages
-components
-taxa
+/config
+/pages
+/components
+/panels
public
README.md
*.local
diff --git a/src/components/Gallery/GalleryMainImage.vue b/src/components/Gallery/GalleryMainImage.vue
index fb91b68..385a558 100644
--- a/src/components/Gallery/GalleryMainImage.vue
+++ b/src/components/Gallery/GalleryMainImage.vue
@@ -3,7 +3,12 @@
+
props.image,
(newVal) => {
- if (newVal.id) {
+ if (newVal.original) {
+ errorMessage.value = null
isLoading.value = true
}
}
)
+function handleError(e) {
+ e.preventDefault()
+
+ isLoading.value = false
+ errorMessage.value = 'Image was not found or format is not supported'
+}
+
+function handleLoad() {
+ isLoading.value = false
+}
+
onMounted(() => {
- imageElement.value.addEventListener('load', () => (isLoading.value = false))
+ imageElement.value.addEventListener('load', handleLoad)
+ imageElement.value.addEventListener('error', handleError)
})
diff --git a/src/components/Gallery/GallerySlider/GallerySlider.vue b/src/components/Gallery/GallerySlider/GallerySlider.vue
new file mode 100644
index 0000000..7132ba8
--- /dev/null
+++ b/src/components/Gallery/GallerySlider/GallerySlider.vue
@@ -0,0 +1,77 @@
+
+
+
![Dichroplus maculipennis]()
+
+
+
+
+ {{ currentDepiction.label }} © {{ currentDepiction.copyright }}
+
+
+
+
+
+
+
+
+
diff --git a/src/components/ImageViewer/ImageViewer.global.vue b/src/components/ImageViewer/ImageViewer.global.vue
index 36a6528..b0f8eab 100644
--- a/src/components/ImageViewer/ImageViewer.global.vue
+++ b/src/components/ImageViewer/ImageViewer.global.vue
@@ -10,7 +10,13 @@
class="absolute rounded-t-lg w-auto max-h-full h-auto top-12 bottom-44 left-0 right-0 flex justify-center align-middle"
>
+
{
const imageElement = ref(null)
const isLoading = ref(false)
+const errorMessage = ref(null)
const image = computed(() => props.images[props.index])
document.addEventListener('keyup', handleKeyboard)
+function handleError() {
+ isLoading.value = false
+ errorMessage.value = 'Image was not found or format is not supported'
+}
+
+function handleLoad() {
+ isLoading.value = false
+}
+
onMounted(() => {
- imageElement.value.addEventListener('load', () => (isLoading.value = false))
+ imageElement.value.addEventListener('load', handleLoad)
+ imageElement.value.addEventListener('error', handleError)
document.body.classList.add('overflow-hidden')
})
@@ -141,6 +158,9 @@ onUnmounted(() => {
watch(
() => props.index,
- () => (isLoading.value = true)
+ () => {
+ errorMessage.value = null
+ isLoading.value = true
+ }
)
diff --git a/src/components/Markdown/MarkdownLayout.global.vue b/src/components/Markdown/MarkdownLayout.global.vue
new file mode 100644
index 0000000..72014a4
--- /dev/null
+++ b/src/components/Markdown/MarkdownLayout.global.vue
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
diff --git a/src/modules/otus/constants/overviewLayout.js b/src/modules/otus/constants/overviewLayout.js
index 36e0abc..95a0399 100644
--- a/src/modules/otus/constants/overviewLayout.js
+++ b/src/modules/otus/constants/overviewLayout.js
@@ -1,11 +1,8 @@
const panelEntries = Object.values(
- import.meta.glob(
- ['../components/Panel/*/main.js', '#/taxa/overview/panels/*/main.js'],
- {
- eager: true,
- import: 'default'
- }
- )
+ import.meta.glob(['../components/Panel/*/main.js', '#/panels/*/main.js'], {
+ eager: true,
+ import: 'default'
+ })
)
const { taxa_page_overview } = __APP_ENV__
diff --git a/src/ssr/utils/registerFakeClientComponents.js b/src/ssr/utils/registerFakeClientComponents.js
index 815f8b0..c7c73bf 100644
--- a/src/ssr/utils/registerFakeClientComponents.js
+++ b/src/ssr/utils/registerFakeClientComponents.js
@@ -5,7 +5,7 @@ export function registerFakeClientComponents(app) {
const filePaths = glob.sync('src/components/**/*.client.vue')
const vueComponent = defineComponent({
setup() {
- return h('div')
+ return () => h('div')
}
})
diff --git a/vite.config.js b/vite.config.js
index 789f04f..e734819 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -32,8 +32,7 @@ export default () => {
}),
Markdown({
- wrapperClasses:
- '!container mx-auto p-4 sm:pl-0 sm:pr-0 prose dark:prose-invert box-border',
+ wrapperComponent: 'markdown-layout',
markdownItSetup(md) {
md.use(markdownAnchor)
md.use(variableReplacementPlugin, {