@rxdrag/website-lib 0.0.110 → 0.0.112

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": "@rxdrag/website-lib",
3
- "version": "0.0.110",
3
+ "version": "0.0.112",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.ts",
@@ -26,11 +26,11 @@
26
26
  "eslint": "^7.32.0",
27
27
  "gsap": "^3.12.7",
28
28
  "typescript": "^5",
29
- "@rxdrag/entify-hooks": "0.2.77",
30
- "@rxdrag/tsconfig": "0.2.0",
31
- "@rxdrag/slate-preview": "1.2.63",
29
+ "@rxdrag/eslint-config-custom": "0.2.12",
32
30
  "@rxdrag/rxcms-models": "0.3.96",
33
- "@rxdrag/eslint-config-custom": "0.2.12"
31
+ "@rxdrag/slate-preview": "1.2.63",
32
+ "@rxdrag/entify-hooks": "0.2.77",
33
+ "@rxdrag/tsconfig": "0.2.0"
34
34
  },
35
35
  "dependencies": {
36
36
  "aos": "3.0.0-beta.6",
@@ -1,152 +0,0 @@
1
- ---
2
- import "aos/dist/aos.css";
3
- import type { PageMeta } from "@rxdrag/rxcms-models";
4
- import Meta from "./Meta.astro";
5
-
6
- interface Props {
7
- lang?: string;
8
- meta?: PageMeta;
9
- title?: string;
10
- aos?: {
11
- easing?: string;
12
- duration?: string;
13
- delay?: string;
14
- offset?: string;
15
- once?: boolean;
16
- disable?: boolean;
17
- };
18
- }
19
-
20
- const {
21
- lang = "en",
22
- meta,
23
- title,
24
- aos = {
25
- easing: "ease-out-cubic",
26
- duration: "800",
27
- delay: "0",
28
- offset: "50",
29
- once: true,
30
- },
31
- } = Astro.props;
32
- ---
33
-
34
- <!doctype html>
35
- <html lang={lang} class="aos-preload">
36
- <head>
37
- <meta charset="UTF-8" />
38
- <meta
39
- name="viewport"
40
- content="width=device-width, initial-scale=1.0, maximum-scale=5.0, minimum-scale=0.5, user-scalable=yes"
41
- />
42
-
43
- <meta name="generator" content={Astro.generator} />
44
- <link rel="sitemap" href="/sitemap-index.xml" />
45
- <slot name="head" />
46
- <Meta title={title} content={meta} />
47
- <style>
48
- html.aos-preload [data-aos] {
49
- opacity: 1 !important;
50
- transform: none !important;
51
- transition: none !important;
52
- }
53
- </style>
54
- <script>
55
- const w = window as any;
56
- const state =
57
- w.__aos_state__ ||
58
- (w.__aos_state__ = { inited: false, loading: null, aos: null });
59
-
60
- const el = document.documentElement;
61
- const raf = () =>
62
- new Promise((resolve) =>
63
- requestAnimationFrame(() => resolve(undefined))
64
- );
65
-
66
- const ensureAos = async () => {
67
- if (state.aos) return state.aos;
68
- if (!state.loading) {
69
- state.loading = import("aos").then((m) => {
70
- state.aos = m.default;
71
- return state.aos;
72
- });
73
- }
74
- return state.loading;
75
- };
76
-
77
- const bootOrRefresh = async () => {
78
- if (
79
- window.matchMedia &&
80
- window.matchMedia("(prefers-reduced-motion: reduce)").matches
81
- ) {
82
- el.classList.add("aos-ready");
83
- el.classList.remove("aos-preload");
84
- return;
85
- }
86
-
87
- if (!document.querySelector("[data-aos]")) {
88
- el.classList.add("aos-ready");
89
- el.classList.remove("aos-preload");
90
- return;
91
- }
92
-
93
- el.classList.add("aos-preload");
94
- el.classList.remove("aos-ready");
95
-
96
- const AOS = await ensureAos();
97
- if (!state.inited) {
98
- state.inited = true;
99
- AOS.init({
100
- duration: 800,
101
- easing: "ease-out-cubic",
102
- once: true,
103
- offset: 50,
104
- });
105
- }
106
-
107
- await raf();
108
- await raf();
109
- AOS.refresh();
110
-
111
- el.classList.add("aos-ready");
112
- el.classList.remove("aos-preload");
113
- };
114
-
115
- const boot = () => {
116
- bootOrRefresh();
117
- };
118
-
119
- if (document.readyState === "loading") {
120
- document.addEventListener("DOMContentLoaded", boot, { once: true });
121
- } else {
122
- boot();
123
- }
124
-
125
- document.addEventListener("astro:page-load", boot);
126
- document.addEventListener("astro:after-swap", boot);
127
- </script>
128
- </head>
129
- <body
130
- class="scroll-smooth"
131
- data-aos-easing={aos.easing}
132
- data-aos-duration={aos.duration}
133
- data-aos-delay={aos.delay}
134
- data-aos-offset={aos.offset}
135
- data-aos-once={aos.once}
136
- >
137
- <slot />
138
- </body>
139
- </html>
140
-
141
- <style>
142
- html,
143
- body {
144
- margin: 0;
145
- width: 100%;
146
- height: 100%;
147
- }
148
-
149
- html {
150
- scroll-behavior: smooth;
151
- }
152
- </style>