@eox/pages-theme-eox 0.4.0 → 0.4.2
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/Layout.vue +13 -16
- package/src/index.js +2 -6
package/package.json
CHANGED
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
|
-
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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>
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import DefaultTheme from "vitepress/theme";
|
|
2
|
+
import FeatureSection from "./components/FeatureSection.vue";
|
|
2
3
|
import Layout from "./Layout.vue";
|
|
3
4
|
import "@eox/ui";
|
|
4
5
|
import "./style.css";
|
|
@@ -7,12 +8,7 @@ export default {
|
|
|
7
8
|
extends: DefaultTheme,
|
|
8
9
|
Layout,
|
|
9
10
|
enhanceApp({ app, router, siteData }) {
|
|
10
|
-
|
|
11
|
-
for (const path in modules) {
|
|
12
|
-
modules[path]().then((mod) => {
|
|
13
|
-
app.component(path.split("/")[2].replace(".vue", ""), mod.default);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
11
|
+
app.component("FeatureSection", FeatureSection);
|
|
16
12
|
|
|
17
13
|
router.onAfterRouteChanged = () => {
|
|
18
14
|
if (!import.meta.env.SSR) {
|