@eox/pages-theme-eox 0.4.0 → 0.4.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Layout.vue +13 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eox/pages-theme-eox",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "description": "Vitepress Theme with EOX branding",
6
6
  "main": "src/index.js",
package/src/Layout.vue CHANGED
@@ -132,22 +132,19 @@ import DefaultTheme from "vitepress/theme";
132
132
  const { Layout } = DefaultTheme;
133
133
  import { useData } from "vitepress";
134
134
  const { frontmatter, theme } = useData();
135
- // import FeatureSection from "./components/FeatureSection.vue";
136
- const scrollListener = () => {
137
- const nav = document.querySelector(".top-nav");
138
- // if (window.scrollY > nav.clientHeight) {
139
- // nav.classList.add("hidden")
140
- // nav.classList.add("sticky")
141
- // } else {
142
- // nav.classList.remove("hidden")
143
- // }
144
- if (window.scrollY > window.innerHeight) {
145
- nav.classList.remove("at-top");
146
- } else {
147
- nav.classList.add("at-top");
148
- }
149
- };
150
- window.addEventListener("scroll", scrollListener);
135
+
136
+ if (!import.meta.env.SSR) {
137
+ const scrollListener = () => {
138
+ const nav = document.querySelector(".top-nav");
139
+
140
+ if (window.scrollY > window.innerHeight) {
141
+ nav.classList.remove("at-top");
142
+ } else {
143
+ nav.classList.add("at-top");
144
+ }
145
+ };
146
+ window.addEventListener("scroll", scrollListener);
147
+ }
151
148
  </script>
152
149
 
153
150
  <style>