@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eox/pages-theme-eox",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "type": "module",
5
5
  "description": "Vitepress Theme with EOX branding",
6
6
  "main": "src/index.js",
@@ -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
- const logoRows = document.querySelectorAll(".logo-row");
29
- logoRows.forEach((logoRow) => {
30
- logoRow.style.setProperty("--base-height", baseHeight + "rem");
31
- logoRow.style.setProperty("--strength", strength);
32
- logoRow.querySelectorAll("img").forEach((img) => {
33
- img.addEventListener("load", () => {
34
- img.parentElement.style.setProperty("--width", img.naturalWidth);
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