@eox/pages-theme-eox 0.9.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/LogoSection.vue +11 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="logo-section">
|
|
3
|
-
<div class="logo-row">
|
|
3
|
+
<div ref="logo-row" class="logo-row">
|
|
4
4
|
<component
|
|
5
5
|
v-for="logo in logos"
|
|
6
6
|
:is="logo.link ? 'a' : 'div'"
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script setup>
|
|
17
|
-
import { onMounted } from "vue";
|
|
17
|
+
import { useTemplateRef, onMounted } from "vue";
|
|
18
18
|
|
|
19
19
|
const props = defineProps(["baseHeight", "logos", "strength"]);
|
|
20
|
+
const logoRow = useTemplateRef("logo-row");
|
|
20
21
|
|
|
21
22
|
onMounted(() => {
|
|
22
23
|
// Function to update CSS variables and display values
|
|
@@ -25,17 +26,15 @@ onMounted(() => {
|
|
|
25
26
|
const strength = props.strength || 1;
|
|
26
27
|
|
|
27
28
|
// Update CSS variables on all .logo-row elements
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
img.
|
|
34
|
-
|
|
35
|
-
img.parentElement.style.setProperty("--height", img.naturalHeight);
|
|
36
|
-
img.style.opacity = 1;
|
|
37
|
-
});
|
|
29
|
+
logoRow.value.style.setProperty("--base-height", baseHeight + "rem");
|
|
30
|
+
logoRow.value.style.setProperty("--strength", strength);
|
|
31
|
+
logoRow.value.querySelectorAll("img").forEach((img) => {
|
|
32
|
+
img.addEventListener("load", () => {
|
|
33
|
+
img.parentElement.style.setProperty("--width", img.naturalWidth);
|
|
34
|
+
img.parentElement.style.setProperty("--height", img.naturalHeight);
|
|
35
|
+
img.style.opacity = 1;
|
|
38
36
|
});
|
|
37
|
+
img.src = img.src;
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
40
|
|