@myelophone/nuxt 0.18.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.
Files changed (259) hide show
  1. package/.devcontainer/Dockerfile +7 -0
  2. package/.devcontainer/devcontainer.json +21 -0
  3. package/.editorconfig +43 -0
  4. package/.github/workflows/package.yml +73 -0
  5. package/.nuxtignore +6 -0
  6. package/.releaserc.js +132 -0
  7. package/.yarn/releases/yarn-4.18.0.cjs +1000 -0
  8. package/.yarnrc.yml +8 -0
  9. package/CHANGELOG.md +141 -0
  10. package/LICENSE +77 -0
  11. package/README.md +3004 -0
  12. package/app/app.vue +455 -0
  13. package/app/assets/css/animation.css +81 -0
  14. package/app/assets/css/backgrounds.css +57 -0
  15. package/app/assets/css/base.css +182 -0
  16. package/app/assets/css/index.css +9 -0
  17. package/app/assets/css/links.css +12 -0
  18. package/app/assets/css/multimedia.css +102 -0
  19. package/app/assets/css/preloader.css +68 -0
  20. package/app/assets/css/print.css +40 -0
  21. package/app/assets/css/tailwind.css +20 -0
  22. package/app/assets/css/theme.css +29 -0
  23. package/app/components/consent/GoogleMap.vue +59 -0
  24. package/app/components/consent/Youtube.vue +27 -0
  25. package/app/components/cookie/Banner.vue +70 -0
  26. package/app/components/cookie/ConsentWrapper.vue +71 -0
  27. package/app/components/cookie/PrivacyPolicy.vue +179 -0
  28. package/app/components/cookie/SettingsModal.vue +387 -0
  29. package/app/components/grid/Col.vue +262 -0
  30. package/app/components/grid/Container.vue +236 -0
  31. package/app/components/grid/Row.vue +248 -0
  32. package/app/components/grid/Stack.vue +233 -0
  33. package/app/components/myelophone/Copyright.vue +5 -0
  34. package/app/components/myelophone/Welcome.vue +107 -0
  35. package/app/components/page/FullscreenPreloader.vue +177 -0
  36. package/app/components/page/Preloader.vue +18 -0
  37. package/app/components/page/ReadyLocalized.vue +19 -0
  38. package/app/components/ready/.gitkeep +0 -0
  39. package/app/components/safe/Email.vue +52 -0
  40. package/app/components/safe/ImgWithLoader.vue +180 -0
  41. package/app/components/safe/NuxtImg.vue +25 -0
  42. package/app/components/safe/NuxtPicture.vue +29 -0
  43. package/app/components/section/.gitkeep +0 -0
  44. package/app/components/seo/BrandInfo.vue +76 -0
  45. package/app/components/seo/ContentNoIndex.vue +35 -0
  46. package/app/components/seo/NoIndex.vue +22 -0
  47. package/app/components/seo/OrgInfo.vue +130 -0
  48. package/app/components/seo/ProfileInfo.vue +137 -0
  49. package/app/components/ui/Accordion.vue +163 -0
  50. package/app/components/ui/Alert.vue +179 -0
  51. package/app/components/ui/Avatar.vue +88 -0
  52. package/app/components/ui/Badge.vue +150 -0
  53. package/app/components/ui/Banner.vue +133 -0
  54. package/app/components/ui/Button.vue +175 -0
  55. package/app/components/ui/Card.vue +66 -0
  56. package/app/components/ui/Checkbox.vue +134 -0
  57. package/app/components/ui/Chip.vue +136 -0
  58. package/app/components/ui/CommandPalette.vue +434 -0
  59. package/app/components/ui/Console.vue +583 -0
  60. package/app/components/ui/CursorCreative.vue +148 -0
  61. package/app/components/ui/FeatureAccordion.vue +165 -0
  62. package/app/components/ui/FileUpload.vue +705 -0
  63. package/app/components/ui/GeoDependent.vue +72 -0
  64. package/app/components/ui/Heading.vue +51 -0
  65. package/app/components/ui/Icon.vue +42 -0
  66. package/app/components/ui/Icon8.vue +39 -0
  67. package/app/components/ui/Input.vue +88 -0
  68. package/app/components/ui/LangLink.vue +34 -0
  69. package/app/components/ui/LangVisible.vue +33 -0
  70. package/app/components/ui/LanguageSelect.vue +202 -0
  71. package/app/components/ui/LightBox.vue +155 -0
  72. package/app/components/ui/LocalTime.vue +170 -0
  73. package/app/components/ui/Modal.vue +161 -0
  74. package/app/components/ui/Popup.vue +200 -0
  75. package/app/components/ui/PostContent.server.vue +23 -0
  76. package/app/components/ui/ProtectedEmail.vue +52 -0
  77. package/app/components/ui/RelativeTime.vue +141 -0
  78. package/app/components/ui/ScheduledContent.vue +150 -0
  79. package/app/components/ui/ScrollToTop.client.vue +48 -0
  80. package/app/components/ui/SegmentedControl.vue +148 -0
  81. package/app/components/ui/SiteSearch.vue +1191 -0
  82. package/app/components/ui/Skeleton.vue +91 -0
  83. package/app/components/ui/SmartContrast.vue +74 -0
  84. package/app/components/ui/SnapContainer.vue +222 -0
  85. package/app/components/ui/SnapSection.vue +294 -0
  86. package/app/components/ui/SonnerStyle.vue +7 -0
  87. package/app/components/ui/SplitSection.vue +99 -0
  88. package/app/components/ui/Steps.vue +858 -0
  89. package/app/components/ui/StickyWrapper.vue +46 -0
  90. package/app/components/ui/Table.vue +251 -0
  91. package/app/components/ui/Tabs.vue +451 -0
  92. package/app/components/ui/TextColumn.vue +36 -0
  93. package/app/components/ui/Textarea.vue +251 -0
  94. package/app/components/ui/Toggler.vue +40 -0
  95. package/app/components/ui/Tooltip.vue +524 -0
  96. package/app/components/ui/TruncateText.vue +105 -0
  97. package/app/components/ui/ViewportSpacer.vue +72 -0
  98. package/app/components/view/AnimatedCounter.vue +121 -0
  99. package/app/components/view/AnnouncementBar.vue +104 -0
  100. package/app/components/view/AvatarGroup.vue +104 -0
  101. package/app/components/view/Breadcrumbs.vue +97 -0
  102. package/app/components/view/ContentWithToc.vue +152 -0
  103. package/app/components/view/Copyright.vue +68 -0
  104. package/app/components/view/CountdownTimer.vue +184 -0
  105. package/app/components/view/CreativeCTA.vue +143 -0
  106. package/app/components/view/CurrencySelect.vue +254 -0
  107. package/app/components/view/FeatureBoxGrid.vue +142 -0
  108. package/app/components/view/HorizontalMenu.vue +97 -0
  109. package/app/components/view/ImageCompare.vue +141 -0
  110. package/app/components/view/ImgSlider.vue +333 -0
  111. package/app/components/view/InfiniteMarquee.vue +147 -0
  112. package/app/components/view/InfoBar.vue +86 -0
  113. package/app/components/view/LogoGrid.vue +106 -0
  114. package/app/components/view/LogoSlider.vue +83 -0
  115. package/app/components/view/NotFound.vue +81 -0
  116. package/app/components/view/PartialBackground.vue +313 -0
  117. package/app/components/view/QuoteBig.vue +111 -0
  118. package/app/components/view/ResponsiveMenu.vue +219 -0
  119. package/app/components/view/ReviewsSlider.vue +230 -0
  120. package/app/components/view/SocialBar.vue +78 -0
  121. package/app/components/view/StickyHeadingContent.vue +158 -0
  122. package/app/components/view/TallyForm.vue +295 -0
  123. package/app/components/view/WarningOutdated.vue +113 -0
  124. package/app/composables/useApi.ts +88 -0
  125. package/app/composables/useAppSeo.ts +78 -0
  126. package/app/composables/useBreadcrumbs.ts +106 -0
  127. package/app/composables/useChangeUrl.ts +73 -0
  128. package/app/composables/useCommand.ts +28 -0
  129. package/app/composables/useCookieControl.ts +111 -0
  130. package/app/composables/useCookieModal.ts +9 -0
  131. package/app/composables/useDevice.ts +109 -0
  132. package/app/composables/useGeoFetch.ts +139 -0
  133. package/app/composables/useLoadScript.ts +36 -0
  134. package/app/composables/useModalState.ts +37 -0
  135. package/app/composables/useMultiLang.ts +278 -0
  136. package/app/composables/useNetwork.ts +49 -0
  137. package/app/composables/useNuxtVersion.ts +5 -0
  138. package/app/composables/usePiniaStore.ts +5 -0
  139. package/app/composables/usePopupControl.ts +57 -0
  140. package/app/composables/useQuery.ts +307 -0
  141. package/app/composables/useReadyPage.ts +182 -0
  142. package/app/composables/useSafeList.ts +90 -0
  143. package/app/composables/useScriptLoader.ts +221 -0
  144. package/app/composables/useSiteSearch.ts +32 -0
  145. package/app/composables/useSnapScroll.ts +24 -0
  146. package/app/composables/useStatic.ts +5 -0
  147. package/app/composables/useStorage.ts +252 -0
  148. package/app/composables/useStoreBroadcast.ts +146 -0
  149. package/app/composables/useThemeSync.ts +81 -0
  150. package/app/constants/layout.ts +109 -0
  151. package/app/constants/predefinedCookieScripts.ts +1222 -0
  152. package/app/constants/ui-events.ts +1 -0
  153. package/app/error.vue +169 -0
  154. package/app/layouts/default-blog.vue +5 -0
  155. package/app/layouts/default.vue +3 -0
  156. package/app/locales/en/commands.json +5 -0
  157. package/app/locales/en/cookies.json +182 -0
  158. package/app/locales/en/error.json +4 -0
  159. package/app/locales/en/interface.json +33 -0
  160. package/app/locales/en/myelophone.json +8 -0
  161. package/app/locales/en/outdated.json +5 -0
  162. package/app/locales/en/times.json +18 -0
  163. package/app/locales/pl/commands.json +5 -0
  164. package/app/locales/pl/cookies.json +182 -0
  165. package/app/locales/pl/error.json +4 -0
  166. package/app/locales/pl/interface.json +33 -0
  167. package/app/locales/pl/myelophone.json +8 -0
  168. package/app/locales/pl/outdated.json +5 -0
  169. package/app/locales/pl/times.json +18 -0
  170. package/app/locales/ru/commands.json +5 -0
  171. package/app/locales/ru/cookies.json +182 -0
  172. package/app/locales/ru/error.json +4 -0
  173. package/app/locales/ru/interface.json +33 -0
  174. package/app/locales/ru/myelophone.json +8 -0
  175. package/app/locales/ru/outdated.json +5 -0
  176. package/app/locales/ru/times.json +18 -0
  177. package/app/middleware/blog-layout.ts +28 -0
  178. package/app/middleware/i18n.global.ts +17 -0
  179. package/app/middleware/not-found-status.ts +11 -0
  180. package/app/modules/default-blog/index.ts +39 -0
  181. package/app/modules/default-blog/posts.ts +80 -0
  182. package/app/modules/default-sitemap/index.ts +116 -0
  183. package/app/modules/default-sitemap/runtime/sitemap.get.ts +42 -0
  184. package/app/modules/fullscreen-preloader/module.ts +43 -0
  185. package/app/modules/htaccess/.htaccess +38 -0
  186. package/app/modules/htaccess/index.ts +23 -0
  187. package/app/modules/i18n-shaker.mjs +221 -0
  188. package/app/modules/multi18n/module.ts +71 -0
  189. package/app/modules/myelophone-config/module.ts +241 -0
  190. package/app/pages/[...all].vue +9 -0
  191. package/app/pages/index.vue +3 -0
  192. package/app/pages/post/[...slug].vue +30 -0
  193. package/app/plugins/bfcache-refresh.client.ts +9 -0
  194. package/app/plugins/canonical.ts +30 -0
  195. package/app/plugins/csp-nonce.server.ts +41 -0
  196. package/app/plugins/multi18n.client.ts +21 -0
  197. package/app/plugins/multi18n.server.ts +15 -0
  198. package/app/plugins/nuxt-version.client.ts +4 -0
  199. package/app/plugins/restore.client.ts +21 -0
  200. package/app/plugins/reveal.ts +89 -0
  201. package/app/plugins/url-helper.client.ts +66 -0
  202. package/app/server/api/exchange-rates.get.ts +216 -0
  203. package/app/server/api/healthz.ts +1 -0
  204. package/app/server/api/logout.post.ts +6 -0
  205. package/app/server/middleware/normalize-url.ts +14 -0
  206. package/app/server/middleware/security-headers.ts +147 -0
  207. package/app/server/middleware/url-helper.ts +43 -0
  208. package/app/server/plugins/clean-html-spaces.ts +15 -0
  209. package/app/server/plugins/clean-styles.ts +94 -0
  210. package/app/server/plugins/compression.ts +122 -0
  211. package/app/server/plugins/css-preload.ts +26 -0
  212. package/app/server/plugins/early-hints.ts +31 -0
  213. package/app/server/plugins/force-noindex.ts +43 -0
  214. package/app/server/plugins/html-one-line.ts +17 -0
  215. package/app/server/plugins/inline-style.ts +7 -0
  216. package/app/server/routes/healthz.get.ts +1 -0
  217. package/app/server/tsconfig.json +3 -0
  218. package/app/stores/cart.ts +945 -0
  219. package/app/stores/commands.ts +43 -0
  220. package/app/stores/device.ts +156 -0
  221. package/app/stores/querySync.ts +5 -0
  222. package/app/stores/settings.ts +145 -0
  223. package/app/stores/user.ts +607 -0
  224. package/app/types/cookie.ts +89 -0
  225. package/app/types/myelophone.d.ts +87 -0
  226. package/app/types/site-search.ts +110 -0
  227. package/app/utils/asyncRefresh.ts +4 -0
  228. package/app/utils/blog.server.ts +142 -0
  229. package/app/utils/jsonLd.ts +56 -0
  230. package/app/utils/myelophoneConfig.ts +4 -0
  231. package/app/utils/sortBy.ts +18 -0
  232. package/app/utils/transliterate.ts +75 -0
  233. package/app/utils/ytVideo.ts +37 -0
  234. package/app/workers/site-search.worker.ts +661 -0
  235. package/biome.json +94 -0
  236. package/commitlint.config.js +3 -0
  237. package/nuxt.config.ts +539 -0
  238. package/package.json +101 -0
  239. package/playground/content/.gitkeep +0 -0
  240. package/playground/locales/.gitkeep +0 -0
  241. package/playground/myelophone.dev.ts +45 -0
  242. package/playground/nuxt.config.ts +105 -0
  243. package/playground/package.json +5 -0
  244. package/playground/pages/.gitkeep +0 -0
  245. package/playground/tsconfig.json +3 -0
  246. package/playwright.config.ts +23 -0
  247. package/public/browsers/chrome.svg +77 -0
  248. package/public/browsers/edge.svg +98 -0
  249. package/public/browsers/firefox.svg +300 -0
  250. package/public/favicon.ico +0 -0
  251. package/public/myelophone_eng.png +0 -0
  252. package/public/myelophone_eng_white.png +0 -0
  253. package/spa-loading-template.html +72 -0
  254. package/tests/home.spec.ts +9 -0
  255. package/tests/utils.ts +23 -0
  256. package/tsconfig.json +16 -0
  257. package/vite/plugins/clean-css.ts +190 -0
  258. package/vite/plugins/postcss-add-viewportunits.ts +33 -0
  259. package/vite/plugins/postcss-viewport-fallback.ts +49 -0
@@ -0,0 +1,248 @@
1
+ <script setup lang="ts">
2
+ import type { LayoutSize } from "~/constants/layout";
3
+ import { getYoutubeEmbed, getYoutubePoster } from "~/utils/ytVideo";
4
+
5
+ import {
6
+ CONTAINER_MAX_WIDTH,
7
+ ROW_BASE,
8
+ FLEX_ALIGN,
9
+ FLEX_JUSTIFY,
10
+ } from "~/constants/layout";
11
+
12
+ interface Props {
13
+ size?: LayoutSize;
14
+ align?: keyof typeof FLEX_ALIGN;
15
+ justify?: keyof typeof FLEX_JUSTIFY;
16
+ equalHeight?: boolean;
17
+ py?: string;
18
+ my?: string;
19
+ mdPy?: string;
20
+ mdMy?: string;
21
+ class?: string;
22
+ id?: string;
23
+ hideOnMobile?: boolean;
24
+ hideOnDesktop?: boolean;
25
+ bgColor?: string;
26
+ bgImage?: string;
27
+ bgImageSm?: string;
28
+ bgGradient?: string;
29
+ bgGradientSm?: string;
30
+ bgSize?: string;
31
+ bgSizeSm?: string;
32
+ bgVideo?: string;
33
+ bgVideoSm?: string;
34
+ bgVideoPoster?: string;
35
+ bgVideoPosterSm?: string;
36
+ bgYoutube?: string;
37
+ bgYoutubeSm?: string;
38
+ }
39
+
40
+ const props = withDefaults(defineProps<Props>(), {
41
+ align: "start",
42
+ justify: "start",
43
+ equalHeight: false,
44
+ hideOnMobile: false,
45
+ hideOnDesktop: false,
46
+ bgSize: "cover",
47
+ });
48
+
49
+ const hasVideo = computed(() => {
50
+ const hasYt =
51
+ (props.bgYoutube && props.bgYoutube !== "none") ||
52
+ (props.bgYoutubeSm && props.bgYoutubeSm !== "none");
53
+ if (hasYt) return true;
54
+
55
+ return (
56
+ (props.bgVideo && props.bgVideo !== "none") ||
57
+ (props.bgVideoSm && props.bgVideoSm !== "none")
58
+ );
59
+ });
60
+
61
+ const classes = computed(() => [
62
+ ROW_BASE,
63
+ {
64
+ "layout-row-root relative": bgStyles.value || hasVideo.value,
65
+ },
66
+ { "has-gradient-overlay": props.bgGradient || props.bgGradientSm },
67
+ props.hideOnMobile ? "hidden md:flex" : "",
68
+ props.hideOnDesktop ? "flex md:hidden" : "",
69
+ !props.hideOnMobile && !props.hideOnDesktop ? "flex" : "",
70
+ props.size && ["mx-auto", CONTAINER_MAX_WIDTH[props.size]],
71
+ props.equalHeight
72
+ ? ["md:items-stretch", "group/equal"]
73
+ : FLEX_ALIGN[props.align],
74
+ FLEX_JUSTIFY[props.justify],
75
+ props.py && `py-${props.py}`,
76
+ props.my && `my-${props.my}`,
77
+ props.mdPy && `md:py-${props.mdPy}`,
78
+ props.mdMy && `md:my-${props.mdMy}`,
79
+ props.class,
80
+ ]);
81
+
82
+ const bgStyles = computed(() => {
83
+ const styles: Record<string, string> = {};
84
+
85
+ const hasBg =
86
+ props.bgColor ||
87
+ props.bgImage ||
88
+ props.bgImageSm ||
89
+ props.bgGradient ||
90
+ props.bgGradientSm ||
91
+ hasVideo.value;
92
+ if (!hasBg) return null;
93
+
94
+ if (props.bgColor) styles["--bg-color"] = props.bgColor;
95
+
96
+ let img = "";
97
+ if (props.bgImage) {
98
+ img = `url('${props.bgImage}')`;
99
+ } else if (props.bgYoutube && props.bgYoutube !== "none") {
100
+ img = getYoutubePoster(props.bgYoutube);
101
+ } else if (props.bgVideoPoster) {
102
+ img = `url('${props.bgVideoPoster}')`;
103
+ }
104
+ const grad = props.bgGradient || "";
105
+
106
+ styles["--bg-img-desktop"] = img;
107
+ styles["--bg-grad-desktop"] = grad;
108
+ styles["--bg-size-desktop"] = props.bgSize;
109
+
110
+ let imgSm = "";
111
+ if (props.bgImageSm === "none") {
112
+ imgSm = "";
113
+ } else if (props.bgImageSm) {
114
+ imgSm = `url('${props.bgImageSm}')`;
115
+ } else if (props.bgYoutubeSm && props.bgYoutubeSm !== "none") {
116
+ imgSm = getYoutubePoster(props.bgYoutubeSm);
117
+ } else if (props.bgVideoPosterSm) {
118
+ imgSm = `url('${props.bgVideoPosterSm}')`;
119
+ } else {
120
+ imgSm = img;
121
+ }
122
+ const gradSm = props.bgGradientSm || grad;
123
+
124
+ styles["--bg-img-mobile"] = imgSm;
125
+ styles["--bg-grad-mobile"] = gradSm;
126
+ styles["--bg-size-mobile"] = props.bgSizeSm || props.bgSize;
127
+
128
+ return Object.keys(styles).length > 0 ? styles : null;
129
+ });
130
+
131
+ const rootRef = ref<HTMLElement | null>(null);
132
+
133
+ const refreshMyVideo = () => {
134
+ const iframe = rootRef.value?.querySelector("iframe");
135
+ if (iframe) {
136
+ const src = iframe.getAttribute("src");
137
+ if (src) iframe.setAttribute("src", src);
138
+ }
139
+ };
140
+
141
+ onMounted(() => {
142
+ window.addEventListener("focus", refreshMyVideo);
143
+ });
144
+
145
+ onUnmounted(() => {
146
+ window.removeEventListener("focus", refreshMyVideo);
147
+ });
148
+ </script>
149
+
150
+ <template>
151
+ <div
152
+ ref="rootRef"
153
+ :id="id"
154
+ :class="classes"
155
+ v-bind="bgStyles ? { style: bgStyles } : {}"
156
+ >
157
+ <div
158
+ v-if="bgYoutube && bgYoutube !== 'none'"
159
+ class="video-background-container"
160
+ :class="[
161
+ bgYoutubeSm && bgYoutubeSm !== 'none'
162
+ ? 'hidden md:block'
163
+ : 'block',
164
+ ]"
165
+ >
166
+ <iframe
167
+ :src="getYoutubeEmbed(bgYoutube)!"
168
+ frameborder="0"
169
+ allow="autoplay; encrypted-media"
170
+ loading="lazy"
171
+ ></iframe>
172
+ </div>
173
+
174
+ <div
175
+ v-if="bgYoutubeSm && bgYoutubeSm !== 'none'"
176
+ class="video-background-container md:hidden"
177
+ >
178
+ <iframe
179
+ :src="getYoutubeEmbed(bgYoutubeSm)!"
180
+ frameborder="0"
181
+ allow="autoplay; encrypted-media"
182
+ loading="lazy"
183
+ ></iframe>
184
+ </div>
185
+
186
+ <video
187
+ v-if="
188
+ bgVideo &&
189
+ bgVideo !== 'none' &&
190
+ (!bgYoutube || bgYoutube === 'none')
191
+ "
192
+ autoplay
193
+ muted
194
+ loop
195
+ playsinline
196
+ :poster="bgVideoPoster"
197
+ class="absolute inset-0 z-0 h-full w-full object-cover pointer-events-none"
198
+ :class="[
199
+ (bgVideoSm && bgVideoSm !== 'none') ||
200
+ (bgYoutubeSm && bgYoutubeSm !== 'none')
201
+ ? 'hidden md:block'
202
+ : 'block',
203
+ ]"
204
+ >
205
+ <source :src="bgVideo" />
206
+ </video>
207
+
208
+ <video
209
+ v-if="
210
+ bgVideoSm &&
211
+ bgVideoSm !== 'none' &&
212
+ (!bgYoutubeSm || bgYoutubeSm === 'none')
213
+ "
214
+ autoplay
215
+ muted
216
+ loop
217
+ playsinline
218
+ :poster="bgVideoPosterSm || bgVideoPoster"
219
+ class="absolute inset-0 z-0 h-full w-full object-cover pointer-events-none md:hidden"
220
+ >
221
+ <source :src="bgVideoSm" />
222
+ </video>
223
+
224
+ <slot />
225
+ </div>
226
+ </template>
227
+
228
+ <style>
229
+ .layout-row-root {
230
+ background-color: var(--bg-color, transparent);
231
+ background-image: var(--bg-img-mobile, none);
232
+ background-size: var(--bg-size-mobile, cover);
233
+ }
234
+
235
+ .layout-row-root.has-gradient-overlay::before {
236
+ background-image: var(--bg-grad-mobile, none);
237
+ }
238
+
239
+ @media (min-width: 768px) {
240
+ .layout-row-root {
241
+ background-image: var(--bg-img-desktop, none);
242
+ background-size: var(--bg-size-desktop, cover);
243
+ }
244
+ .layout-row-root.has-gradient-overlay::before {
245
+ background-image: var(--bg-grad-desktop, none);
246
+ }
247
+ }
248
+ </style>
@@ -0,0 +1,233 @@
1
+ <script setup lang="ts">
2
+ import { getYoutubeEmbed, getYoutubePoster } from "~/utils/ytVideo";
3
+
4
+ interface Props {
5
+ as?: string;
6
+ id?: string;
7
+ class?: any;
8
+ hideOnMobile?: boolean;
9
+ hideOnDesktop?: boolean;
10
+ bgColor?: string;
11
+ bgImage?: string;
12
+ bgImageSm?: string;
13
+ bgGradient?: string;
14
+ bgGradientSm?: string;
15
+ bgSize?: string;
16
+ bgSizeSm?: string;
17
+ bgVideo?: string;
18
+ bgVideoSm?: string;
19
+ bgVideoPoster?: string;
20
+ bgVideoPosterSm?: string;
21
+ bgYoutube?: string;
22
+ bgYoutubeSm?: string;
23
+ }
24
+
25
+ const props = withDefaults(defineProps<Props>(), {
26
+ as: "div",
27
+ id: undefined,
28
+ class: undefined,
29
+ hideOnMobile: false,
30
+ hideOnDesktop: false,
31
+ bgSize: "cover",
32
+ });
33
+
34
+ const hasHeightClass = computed(() => {
35
+ const classStr = String(props.class || "");
36
+ return (
37
+ /\bh-\d+/.test(classStr) ||
38
+ /\bh-\[/.test(classStr) ||
39
+ /\bh-screen/.test(classStr)
40
+ );
41
+ });
42
+
43
+ const hasVideo = computed(() => {
44
+ const hasYt =
45
+ (props.bgYoutube && props.bgYoutube !== "none") ||
46
+ (props.bgYoutubeSm && props.bgYoutubeSm !== "none");
47
+ if (hasYt) return true;
48
+
49
+ return (
50
+ (props.bgVideo && props.bgVideo !== "none") ||
51
+ (props.bgVideoSm && props.bgVideoSm !== "none")
52
+ );
53
+ });
54
+
55
+ const classes = computed(() => [
56
+ {
57
+ "layout-stack-root relative overflow-hidden":
58
+ bgStyles.value || hasVideo.value,
59
+ },
60
+ !props.hideOnMobile && !props.hideOnDesktop ? "flex" : "",
61
+ { "h-full": !hasHeightClass.value },
62
+ "flex-col",
63
+ props.hideOnMobile ? "hidden md:flex" : "",
64
+ props.hideOnDesktop ? "flex md:hidden" : "",
65
+ props.class,
66
+ ]);
67
+
68
+ const bgStyles = computed(() => {
69
+ const styles: Record<string, string> = {};
70
+
71
+ const hasBg =
72
+ props.bgColor ||
73
+ props.bgImage ||
74
+ props.bgImageSm ||
75
+ props.bgGradient ||
76
+ props.bgGradientSm ||
77
+ hasVideo.value;
78
+ if (!hasBg) return null;
79
+
80
+ if (props.bgColor) styles["--bg-color"] = props.bgColor;
81
+
82
+ let img = "";
83
+ if (props.bgImage) {
84
+ img = `url('${props.bgImage}')`;
85
+ } else if (props.bgYoutube && props.bgYoutube !== "none") {
86
+ img = getYoutubePoster(props.bgYoutube);
87
+ } else if (props.bgVideoPoster) {
88
+ img = `url('${props.bgVideoPoster}')`;
89
+ }
90
+ const grad = props.bgGradient || "";
91
+
92
+ styles["--bg-img-desktop"] = img;
93
+ styles["--bg-grad-desktop"] = grad;
94
+ styles["--bg-size-desktop"] = props.bgSize;
95
+
96
+ let imgSm = "";
97
+ if (props.bgImageSm === "none") {
98
+ imgSm = "";
99
+ } else if (props.bgImageSm) {
100
+ imgSm = `url('${props.bgImageSm}')`;
101
+ } else if (props.bgYoutubeSm && props.bgYoutubeSm !== "none") {
102
+ imgSm = getYoutubePoster(props.bgYoutubeSm);
103
+ } else if (props.bgVideoPosterSm) {
104
+ imgSm = `url('${props.bgVideoPosterSm}')`;
105
+ } else {
106
+ imgSm = img;
107
+ }
108
+
109
+ const gradSm = props.bgGradientSm || grad;
110
+ styles["--bg-img-mobile"] = imgSm;
111
+ styles["--bg-grad-mobile"] = gradSm;
112
+ styles["--bg-size-mobile"] = props.bgSizeSm || props.bgSize;
113
+
114
+ return Object.keys(styles).length > 0 ? styles : null;
115
+ });
116
+
117
+ const rootRef = ref<HTMLElement | null>(null);
118
+
119
+ const refreshMyVideo = () => {
120
+ const iframe = rootRef.value?.querySelector("iframe");
121
+ if (iframe) {
122
+ const src = iframe.getAttribute("src");
123
+ if (src) iframe.setAttribute("src", src);
124
+ }
125
+ };
126
+
127
+ onMounted(() => {
128
+ window.addEventListener("focus", refreshMyVideo);
129
+ });
130
+
131
+ onUnmounted(() => {
132
+ window.removeEventListener("focus", refreshMyVideo);
133
+ });
134
+ </script>
135
+
136
+ <template>
137
+ <div
138
+ ref="rootRef"
139
+ :is="as"
140
+ :id="id"
141
+ :class="[
142
+ classes,
143
+ { 'has-gradient-overlay': props.bgGradient || props.bgGradientSm },
144
+ ]"
145
+ v-bind="bgStyles ? { style: bgStyles } : {}"
146
+ >
147
+ <div
148
+ v-if="bgYoutube && bgYoutube !== 'none'"
149
+ class="video-background-container"
150
+ :class="[bgYoutubeSm ? 'hidden md:block' : 'block']"
151
+ >
152
+ <iframe
153
+ :src="getYoutubeEmbed(bgYoutube)!"
154
+ frameborder="0"
155
+ allow="autoplay; encrypted-media"
156
+ loading="lazy"
157
+ ></iframe>
158
+ </div>
159
+
160
+ <div
161
+ v-if="bgYoutubeSm && bgYoutubeSm !== 'none'"
162
+ class="video-background-container md:hidden"
163
+ >
164
+ <iframe
165
+ :src="getYoutubeEmbed(bgYoutubeSm)!"
166
+ frameborder="0"
167
+ allow="autoplay; encrypted-media"
168
+ loading="lazy"
169
+ ></iframe>
170
+ </div>
171
+
172
+ <video
173
+ v-if="
174
+ bgVideo &&
175
+ bgVideo !== 'none' &&
176
+ (!bgYoutube || bgYoutube === 'none')
177
+ "
178
+ autoplay
179
+ muted
180
+ loop
181
+ playsinline
182
+ :poster="bgVideoPoster"
183
+ class="absolute inset-0 z-0 h-full w-full object-cover pointer-events-none"
184
+ :class="[
185
+ bgVideoSm || (bgYoutubeSm && bgYoutubeSm !== 'none')
186
+ ? 'hidden md:block'
187
+ : 'block',
188
+ ]"
189
+ >
190
+ <source :src="bgVideo" />
191
+ </video>
192
+
193
+ <video
194
+ v-if="
195
+ bgVideoSm &&
196
+ bgVideoSm !== 'none' &&
197
+ (!bgYoutubeSm || bgYoutubeSm === 'none')
198
+ "
199
+ autoplay
200
+ muted
201
+ loop
202
+ playsinline
203
+ :poster="bgVideoPosterSm || bgVideoPoster"
204
+ class="absolute inset-0 z-0 h-full w-full object-cover pointer-events-none md:hidden"
205
+ >
206
+ <source :src="bgVideoSm" />
207
+ </video>
208
+
209
+ <slot />
210
+ </div>
211
+ </template>
212
+
213
+ <style>
214
+ .layout-stack-root {
215
+ background-color: var(--bg-color, transparent);
216
+ background-image: var(--bg-img-mobile, none);
217
+ background-size: var(--bg-size-mobile, cover);
218
+ }
219
+
220
+ .layout-stack-root.has-gradient-overlay::before {
221
+ background-image: var(--bg-grad-mobile, none);
222
+ }
223
+
224
+ @media (min-width: 768px) {
225
+ .layout-stack-root {
226
+ background-image: var(--bg-img-desktop, none);
227
+ background-size: var(--bg-size-desktop, cover);
228
+ }
229
+ .layout-stack-root.has-gradient-overlay::before {
230
+ background-image: var(--bg-grad-desktop, none);
231
+ }
232
+ }
233
+ </style>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <a href="https://github.com/aleksivanou" target="_blank">
3
+ © 2025 Aliaksandr Ivanou. All rights reserved.
4
+ </a>
5
+ </template>
@@ -0,0 +1,107 @@
1
+ <template>
2
+ <div
3
+ class="min-h-dvh flex flex-col items-center justify-center text-center"
4
+ >
5
+ <div class="flex items-center gap-3 mb-6">
6
+ <NuxtLink
7
+ to="/"
8
+ class="flex items-center gap-2 hover:opacity-90 transition-opacity"
9
+ >
10
+ <div class="flex items-center gap-3">
11
+ <SafeNuxtImg
12
+ src="/myelophone_eng.png"
13
+ width="221"
14
+ class="block dark:hidden"
15
+ alt="MyelophOne"
16
+ />
17
+ <SafeNuxtImg
18
+ src="/myelophone_eng_white.png"
19
+ width="221"
20
+ class="hidden dark:block"
21
+ alt="MyelophOne"
22
+ /><svg
23
+ xmlns="http://www.w3.org/2000/svg"
24
+ fill="none"
25
+ aria-label="Nuxt"
26
+ class="h-8 sm:h-12"
27
+ viewBox="0 0 800 200"
28
+ >
29
+ <path
30
+ fill="#00dc82"
31
+ d="M168.303 200h111.522c3.543 0 7.022-.924 10.09-2.679A20.1 20.1 0 0 0 297.3 190a19.86 19.86 0 0 0 2.7-10.001 19.86 19.86 0 0 0-2.709-9.998L222.396 41.429a20.1 20.1 0 0 0-7.384-7.32 20.3 20.3 0 0 0-10.088-2.679c-3.541 0-7.02.925-10.087 2.68a20.1 20.1 0 0 0-7.384 7.32l-19.15 32.896L130.86 9.998a20.1 20.1 0 0 0-7.387-7.32A20.3 20.3 0 0 0 113.384 0c-3.542 0-7.022.924-10.09 2.679a20.1 20.1 0 0 0-7.387 7.319L2.709 170A19.85 19.85 0 0 0 0 179.999c-.002 3.511.93 6.96 2.7 10.001a20.1 20.1 0 0 0 7.385 7.321A20.3 20.3 0 0 0 20.175 200h70.004c27.737 0 48.192-12.075 62.266-35.633l34.171-58.652 18.303-31.389 54.93 94.285h-73.233zm-79.265-31.421-48.854-.011 73.232-125.706 36.541 62.853-24.466 42.01c-9.347 15.285-19.965 20.854-36.453 20.854"
32
+ ></path>
33
+ <path
34
+ fill="currentColor"
35
+ d="M377 200a4 4 0 0 0 4-4v-93s5.244 8.286 15 25l38.707 66.961c1.789 3.119 5.084 5.039 8.649 5.039H470V50h-27a4 4 0 0 0-4 4v94l-17-30-36.588-62.98c-1.792-3.108-5.081-5.02-8.639-5.02H350v150zm299.203-56.143L710.551 92h-25.73a9.97 9.97 0 0 0-8.333 4.522L660.757 120.5l-15.731-23.978A9.97 9.97 0 0 0 636.693 92h-25.527l34.348 51.643L608.524 200h24.966a9.97 9.97 0 0 0 8.29-4.458l19.18-28.756 18.981 28.72a9.97 9.97 0 0 0 8.313 4.494h24.736zM724.598 92h19.714V60.071h28.251V92H800v24.857h-27.437V159.5c0 10.5 5.284 15.429 14.43 15.429H800V200h-16.869c-23.576 0-38.819-14.143-38.819-39.214v-43.929h-19.714zM590 92h-15c-3.489 0-6.218.145-8.5 2.523-2.282 2.246-2.5 3.63-2.5 7.066v52.486c0 8.058-.376 12.962-4 16.925-3.624 3.831-8.619 5-16 5-7.247 0-12.376-1.169-16-5-3.624-3.963-4-8.867-4-16.925v-52.486c0-3.435-.218-4.82-2.5-7.066C519.218 92.145 516.489 92 513 92h-15v62.422q0 21.006 11.676 33.292C517.594 195.905 529.103 200 544 200s26.204-4.095 34.123-12.286Q590 175.428 590 154.422z"
36
+ ></path>
37
+ </svg>
38
+ </div>
39
+ </NuxtLink>
40
+ </div>
41
+ <p class="max-w-xl mb-6 dark:opacity-70">
42
+ {{ t("myelophone.welcome") }} <strong>MyelophOne Nuxt</strong>!
43
+ <br />
44
+ {{ t("myelophone.experiment") }}
45
+ <br />
46
+ <span class="italic"
47
+ >{{ t("myelophone.poweredBy") }}
48
+ <strong
49
+ ><a href="https://github.com/MyelophOne" target="_blank"
50
+ >MyelophOne</a
51
+ ></strong
52
+ >.</span
53
+ >
54
+ 💚 <br /><br />
55
+ <span class="text-sm"
56
+ >{{ t("myelophone.templateVersion") }}
57
+ <span
58
+ class="bg-[#00DC42]/10 border border-[#00DC42]/50 font-mono font-semibold group-hover:bg-[#00DC42]/15 group-hover:border-[#00DC42] inline-block leading-none px-2 py-0.5 rounded sm:px-2.5 sm:py-1 sm:text-[14px] text-[#00DC82] text-[12px]"
59
+ >{{ version }}</span
60
+ >
61
+ <br />
62
+ {{ t("myelophone.nuxtVersion") }}
63
+ <span
64
+ class="bg-[#00DC42]/10 border border-[#00DC42]/50 font-mono font-semibold group-hover:bg-[#00DC42]/15 group-hover:border-[#00DC42] inline-block leading-none px-2 py-0.5 rounded sm:px-2.5 sm:py-1 sm:text-[14px] text-[#00DC82] text-[12px]"
65
+ >{{ nuxtVersion }}</span
66
+ ></span
67
+ >
68
+ </p>
69
+ <p class="max-w-xl mb-6 font-semibold dark:opacity-70">
70
+ <button @click="settingsStore.toggleTheme" class="mb-2">
71
+ {{ t("myelophone.toggleTheme") }}
72
+ <span class="dark:hidden"
73
+ ><UiIcon
74
+ name="solar:moon-stars-line-duotone"
75
+ class="theme-icon" /></span
76
+ ><span class="hidden dark:inline"
77
+ ><UiIcon name="solar:sun-broken" class="theme-icon"
78
+ /></span>
79
+ </button>
80
+ </p>
81
+ <p
82
+ class="text-sm max-w-xl mb-6 opacity-30 hover:opacity-100 transition-opacity duration-500 sticky top-[100vh]"
83
+ >
84
+ <MyelophoneCopyright />
85
+ </p>
86
+ </div>
87
+ </template>
88
+
89
+ <script setup lang="ts">
90
+ const pinia = useNuxtApp().$pinia;
91
+ const settingsStore = useSettingsStore(pinia);
92
+ const nuxtVersion = useNuxtVersion();
93
+
94
+ const config = useRuntimeConfig();
95
+
96
+ const { t } = useMultiLang(["myelophone"]);
97
+
98
+ const version = config.public?.version || "unknown";
99
+ </script>
100
+
101
+ <style scoped>
102
+ .theme-icon {
103
+ width: 1.5rem;
104
+ height: 1.5rem;
105
+ vertical-align: middle;
106
+ }
107
+ </style>