@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.
- package/.devcontainer/Dockerfile +7 -0
- package/.devcontainer/devcontainer.json +21 -0
- package/.editorconfig +43 -0
- package/.github/workflows/package.yml +73 -0
- package/.nuxtignore +6 -0
- package/.releaserc.js +132 -0
- package/.yarn/releases/yarn-4.18.0.cjs +1000 -0
- package/.yarnrc.yml +8 -0
- package/CHANGELOG.md +141 -0
- package/LICENSE +77 -0
- package/README.md +3004 -0
- package/app/app.vue +455 -0
- package/app/assets/css/animation.css +81 -0
- package/app/assets/css/backgrounds.css +57 -0
- package/app/assets/css/base.css +182 -0
- package/app/assets/css/index.css +9 -0
- package/app/assets/css/links.css +12 -0
- package/app/assets/css/multimedia.css +102 -0
- package/app/assets/css/preloader.css +68 -0
- package/app/assets/css/print.css +40 -0
- package/app/assets/css/tailwind.css +20 -0
- package/app/assets/css/theme.css +29 -0
- package/app/components/consent/GoogleMap.vue +59 -0
- package/app/components/consent/Youtube.vue +27 -0
- package/app/components/cookie/Banner.vue +70 -0
- package/app/components/cookie/ConsentWrapper.vue +71 -0
- package/app/components/cookie/PrivacyPolicy.vue +179 -0
- package/app/components/cookie/SettingsModal.vue +387 -0
- package/app/components/grid/Col.vue +262 -0
- package/app/components/grid/Container.vue +236 -0
- package/app/components/grid/Row.vue +248 -0
- package/app/components/grid/Stack.vue +233 -0
- package/app/components/myelophone/Copyright.vue +5 -0
- package/app/components/myelophone/Welcome.vue +107 -0
- package/app/components/page/FullscreenPreloader.vue +177 -0
- package/app/components/page/Preloader.vue +18 -0
- package/app/components/page/ReadyLocalized.vue +19 -0
- package/app/components/ready/.gitkeep +0 -0
- package/app/components/safe/Email.vue +52 -0
- package/app/components/safe/ImgWithLoader.vue +180 -0
- package/app/components/safe/NuxtImg.vue +25 -0
- package/app/components/safe/NuxtPicture.vue +29 -0
- package/app/components/section/.gitkeep +0 -0
- package/app/components/seo/BrandInfo.vue +76 -0
- package/app/components/seo/ContentNoIndex.vue +35 -0
- package/app/components/seo/NoIndex.vue +22 -0
- package/app/components/seo/OrgInfo.vue +130 -0
- package/app/components/seo/ProfileInfo.vue +137 -0
- package/app/components/ui/Accordion.vue +163 -0
- package/app/components/ui/Alert.vue +179 -0
- package/app/components/ui/Avatar.vue +88 -0
- package/app/components/ui/Badge.vue +150 -0
- package/app/components/ui/Banner.vue +133 -0
- package/app/components/ui/Button.vue +175 -0
- package/app/components/ui/Card.vue +66 -0
- package/app/components/ui/Checkbox.vue +134 -0
- package/app/components/ui/Chip.vue +136 -0
- package/app/components/ui/CommandPalette.vue +434 -0
- package/app/components/ui/Console.vue +583 -0
- package/app/components/ui/CursorCreative.vue +148 -0
- package/app/components/ui/FeatureAccordion.vue +165 -0
- package/app/components/ui/FileUpload.vue +705 -0
- package/app/components/ui/GeoDependent.vue +72 -0
- package/app/components/ui/Heading.vue +51 -0
- package/app/components/ui/Icon.vue +42 -0
- package/app/components/ui/Icon8.vue +39 -0
- package/app/components/ui/Input.vue +88 -0
- package/app/components/ui/LangLink.vue +34 -0
- package/app/components/ui/LangVisible.vue +33 -0
- package/app/components/ui/LanguageSelect.vue +202 -0
- package/app/components/ui/LightBox.vue +155 -0
- package/app/components/ui/LocalTime.vue +170 -0
- package/app/components/ui/Modal.vue +161 -0
- package/app/components/ui/Popup.vue +200 -0
- package/app/components/ui/PostContent.server.vue +23 -0
- package/app/components/ui/ProtectedEmail.vue +52 -0
- package/app/components/ui/RelativeTime.vue +141 -0
- package/app/components/ui/ScheduledContent.vue +150 -0
- package/app/components/ui/ScrollToTop.client.vue +48 -0
- package/app/components/ui/SegmentedControl.vue +148 -0
- package/app/components/ui/SiteSearch.vue +1191 -0
- package/app/components/ui/Skeleton.vue +91 -0
- package/app/components/ui/SmartContrast.vue +74 -0
- package/app/components/ui/SnapContainer.vue +222 -0
- package/app/components/ui/SnapSection.vue +294 -0
- package/app/components/ui/SonnerStyle.vue +7 -0
- package/app/components/ui/SplitSection.vue +99 -0
- package/app/components/ui/Steps.vue +858 -0
- package/app/components/ui/StickyWrapper.vue +46 -0
- package/app/components/ui/Table.vue +251 -0
- package/app/components/ui/Tabs.vue +451 -0
- package/app/components/ui/TextColumn.vue +36 -0
- package/app/components/ui/Textarea.vue +251 -0
- package/app/components/ui/Toggler.vue +40 -0
- package/app/components/ui/Tooltip.vue +524 -0
- package/app/components/ui/TruncateText.vue +105 -0
- package/app/components/ui/ViewportSpacer.vue +72 -0
- package/app/components/view/AnimatedCounter.vue +121 -0
- package/app/components/view/AnnouncementBar.vue +104 -0
- package/app/components/view/AvatarGroup.vue +104 -0
- package/app/components/view/Breadcrumbs.vue +97 -0
- package/app/components/view/ContentWithToc.vue +152 -0
- package/app/components/view/Copyright.vue +68 -0
- package/app/components/view/CountdownTimer.vue +184 -0
- package/app/components/view/CreativeCTA.vue +143 -0
- package/app/components/view/CurrencySelect.vue +254 -0
- package/app/components/view/FeatureBoxGrid.vue +142 -0
- package/app/components/view/HorizontalMenu.vue +97 -0
- package/app/components/view/ImageCompare.vue +141 -0
- package/app/components/view/ImgSlider.vue +333 -0
- package/app/components/view/InfiniteMarquee.vue +147 -0
- package/app/components/view/InfoBar.vue +86 -0
- package/app/components/view/LogoGrid.vue +106 -0
- package/app/components/view/LogoSlider.vue +83 -0
- package/app/components/view/NotFound.vue +81 -0
- package/app/components/view/PartialBackground.vue +313 -0
- package/app/components/view/QuoteBig.vue +111 -0
- package/app/components/view/ResponsiveMenu.vue +219 -0
- package/app/components/view/ReviewsSlider.vue +230 -0
- package/app/components/view/SocialBar.vue +78 -0
- package/app/components/view/StickyHeadingContent.vue +158 -0
- package/app/components/view/TallyForm.vue +295 -0
- package/app/components/view/WarningOutdated.vue +113 -0
- package/app/composables/useApi.ts +88 -0
- package/app/composables/useAppSeo.ts +78 -0
- package/app/composables/useBreadcrumbs.ts +106 -0
- package/app/composables/useChangeUrl.ts +73 -0
- package/app/composables/useCommand.ts +28 -0
- package/app/composables/useCookieControl.ts +111 -0
- package/app/composables/useCookieModal.ts +9 -0
- package/app/composables/useDevice.ts +109 -0
- package/app/composables/useGeoFetch.ts +139 -0
- package/app/composables/useLoadScript.ts +36 -0
- package/app/composables/useModalState.ts +37 -0
- package/app/composables/useMultiLang.ts +278 -0
- package/app/composables/useNetwork.ts +49 -0
- package/app/composables/useNuxtVersion.ts +5 -0
- package/app/composables/usePiniaStore.ts +5 -0
- package/app/composables/usePopupControl.ts +57 -0
- package/app/composables/useQuery.ts +307 -0
- package/app/composables/useReadyPage.ts +182 -0
- package/app/composables/useSafeList.ts +90 -0
- package/app/composables/useScriptLoader.ts +221 -0
- package/app/composables/useSiteSearch.ts +32 -0
- package/app/composables/useSnapScroll.ts +24 -0
- package/app/composables/useStatic.ts +5 -0
- package/app/composables/useStorage.ts +252 -0
- package/app/composables/useStoreBroadcast.ts +146 -0
- package/app/composables/useThemeSync.ts +81 -0
- package/app/constants/layout.ts +109 -0
- package/app/constants/predefinedCookieScripts.ts +1222 -0
- package/app/constants/ui-events.ts +1 -0
- package/app/error.vue +169 -0
- package/app/layouts/default-blog.vue +5 -0
- package/app/layouts/default.vue +3 -0
- package/app/locales/en/commands.json +5 -0
- package/app/locales/en/cookies.json +182 -0
- package/app/locales/en/error.json +4 -0
- package/app/locales/en/interface.json +33 -0
- package/app/locales/en/myelophone.json +8 -0
- package/app/locales/en/outdated.json +5 -0
- package/app/locales/en/times.json +18 -0
- package/app/locales/pl/commands.json +5 -0
- package/app/locales/pl/cookies.json +182 -0
- package/app/locales/pl/error.json +4 -0
- package/app/locales/pl/interface.json +33 -0
- package/app/locales/pl/myelophone.json +8 -0
- package/app/locales/pl/outdated.json +5 -0
- package/app/locales/pl/times.json +18 -0
- package/app/locales/ru/commands.json +5 -0
- package/app/locales/ru/cookies.json +182 -0
- package/app/locales/ru/error.json +4 -0
- package/app/locales/ru/interface.json +33 -0
- package/app/locales/ru/myelophone.json +8 -0
- package/app/locales/ru/outdated.json +5 -0
- package/app/locales/ru/times.json +18 -0
- package/app/middleware/blog-layout.ts +28 -0
- package/app/middleware/i18n.global.ts +17 -0
- package/app/middleware/not-found-status.ts +11 -0
- package/app/modules/default-blog/index.ts +39 -0
- package/app/modules/default-blog/posts.ts +80 -0
- package/app/modules/default-sitemap/index.ts +116 -0
- package/app/modules/default-sitemap/runtime/sitemap.get.ts +42 -0
- package/app/modules/fullscreen-preloader/module.ts +43 -0
- package/app/modules/htaccess/.htaccess +38 -0
- package/app/modules/htaccess/index.ts +23 -0
- package/app/modules/i18n-shaker.mjs +221 -0
- package/app/modules/multi18n/module.ts +71 -0
- package/app/modules/myelophone-config/module.ts +241 -0
- package/app/pages/[...all].vue +9 -0
- package/app/pages/index.vue +3 -0
- package/app/pages/post/[...slug].vue +30 -0
- package/app/plugins/bfcache-refresh.client.ts +9 -0
- package/app/plugins/canonical.ts +30 -0
- package/app/plugins/csp-nonce.server.ts +41 -0
- package/app/plugins/multi18n.client.ts +21 -0
- package/app/plugins/multi18n.server.ts +15 -0
- package/app/plugins/nuxt-version.client.ts +4 -0
- package/app/plugins/restore.client.ts +21 -0
- package/app/plugins/reveal.ts +89 -0
- package/app/plugins/url-helper.client.ts +66 -0
- package/app/server/api/exchange-rates.get.ts +216 -0
- package/app/server/api/healthz.ts +1 -0
- package/app/server/api/logout.post.ts +6 -0
- package/app/server/middleware/normalize-url.ts +14 -0
- package/app/server/middleware/security-headers.ts +147 -0
- package/app/server/middleware/url-helper.ts +43 -0
- package/app/server/plugins/clean-html-spaces.ts +15 -0
- package/app/server/plugins/clean-styles.ts +94 -0
- package/app/server/plugins/compression.ts +122 -0
- package/app/server/plugins/css-preload.ts +26 -0
- package/app/server/plugins/early-hints.ts +31 -0
- package/app/server/plugins/force-noindex.ts +43 -0
- package/app/server/plugins/html-one-line.ts +17 -0
- package/app/server/plugins/inline-style.ts +7 -0
- package/app/server/routes/healthz.get.ts +1 -0
- package/app/server/tsconfig.json +3 -0
- package/app/stores/cart.ts +945 -0
- package/app/stores/commands.ts +43 -0
- package/app/stores/device.ts +156 -0
- package/app/stores/querySync.ts +5 -0
- package/app/stores/settings.ts +145 -0
- package/app/stores/user.ts +607 -0
- package/app/types/cookie.ts +89 -0
- package/app/types/myelophone.d.ts +87 -0
- package/app/types/site-search.ts +110 -0
- package/app/utils/asyncRefresh.ts +4 -0
- package/app/utils/blog.server.ts +142 -0
- package/app/utils/jsonLd.ts +56 -0
- package/app/utils/myelophoneConfig.ts +4 -0
- package/app/utils/sortBy.ts +18 -0
- package/app/utils/transliterate.ts +75 -0
- package/app/utils/ytVideo.ts +37 -0
- package/app/workers/site-search.worker.ts +661 -0
- package/biome.json +94 -0
- package/commitlint.config.js +3 -0
- package/nuxt.config.ts +539 -0
- package/package.json +101 -0
- package/playground/content/.gitkeep +0 -0
- package/playground/locales/.gitkeep +0 -0
- package/playground/myelophone.dev.ts +45 -0
- package/playground/nuxt.config.ts +105 -0
- package/playground/package.json +5 -0
- package/playground/pages/.gitkeep +0 -0
- package/playground/tsconfig.json +3 -0
- package/playwright.config.ts +23 -0
- package/public/browsers/chrome.svg +77 -0
- package/public/browsers/edge.svg +98 -0
- package/public/browsers/firefox.svg +300 -0
- package/public/favicon.ico +0 -0
- package/public/myelophone_eng.png +0 -0
- package/public/myelophone_eng_white.png +0 -0
- package/spa-loading-template.html +72 -0
- package/tests/home.spec.ts +9 -0
- package/tests/utils.ts +23 -0
- package/tsconfig.json +16 -0
- package/vite/plugins/clean-css.ts +190 -0
- package/vite/plugins/postcss-add-viewportunits.ts +33 -0
- package/vite/plugins/postcss-viewport-fallback.ts +49 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="lightbox-grid">
|
|
3
|
+
<div
|
|
4
|
+
v-for="(img, index) in images"
|
|
5
|
+
:key="index"
|
|
6
|
+
:class="['pic-item', itemClass]"
|
|
7
|
+
:style="itemStyle"
|
|
8
|
+
@click="showImg(index)"
|
|
9
|
+
>
|
|
10
|
+
<SafeImgWithLoader
|
|
11
|
+
:src="extractSrc(img)"
|
|
12
|
+
:alt="extractTitle(img)"
|
|
13
|
+
crossorigin="anonymous"
|
|
14
|
+
:class="imgClass"
|
|
15
|
+
:style="[{ cursor: 'pointer' }, imgStyle]"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<ClientOnly>
|
|
20
|
+
<VueEasyLightbox
|
|
21
|
+
:visible="visibleRef"
|
|
22
|
+
:imgs="images"
|
|
23
|
+
:index="indexRef"
|
|
24
|
+
v-bind="lightboxProps"
|
|
25
|
+
@hide="onHide"
|
|
26
|
+
>
|
|
27
|
+
<template #loading>
|
|
28
|
+
<div class="lightbox-loader-overlay">
|
|
29
|
+
<svg
|
|
30
|
+
width="32"
|
|
31
|
+
height="32"
|
|
32
|
+
viewBox="0 0 32 32"
|
|
33
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
34
|
+
class="loadersvg-lightbox"
|
|
35
|
+
>
|
|
36
|
+
<g fill="none" fill-rule="evenodd">
|
|
37
|
+
<g fill="var(--loader-fill-color, #fff)">
|
|
38
|
+
<path
|
|
39
|
+
d="M16 32a16 16 0 110-32 16 16 0 010 32zm0-2a14 14 0 100-28 14 14 0 000 28z"
|
|
40
|
+
fill-rule="nonzero"
|
|
41
|
+
opacity=".1"
|
|
42
|
+
/>
|
|
43
|
+
<path
|
|
44
|
+
d="M16 2V0A16 16 0 000 16h2A14 14 0 0116 2z"
|
|
45
|
+
/>
|
|
46
|
+
</g>
|
|
47
|
+
</g>
|
|
48
|
+
</svg>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
</VueEasyLightbox>
|
|
52
|
+
</ClientOnly>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<script setup lang="ts">
|
|
57
|
+
interface LightboxImg {
|
|
58
|
+
src?: string;
|
|
59
|
+
title?: string;
|
|
60
|
+
alt?: string;
|
|
61
|
+
}
|
|
62
|
+
import type { PropType, CSSProperties } from "vue";
|
|
63
|
+
const VueEasyLightbox = defineAsyncComponent(() => import("vue-easy-lightbox"));
|
|
64
|
+
|
|
65
|
+
const props = defineProps({
|
|
66
|
+
images: {
|
|
67
|
+
type: Array as PropType<(string | LightboxImg)[]>,
|
|
68
|
+
required: true,
|
|
69
|
+
default: () => [],
|
|
70
|
+
},
|
|
71
|
+
itemStyle: {
|
|
72
|
+
type: [Object, Array] as PropType<CSSProperties | CSSProperties[]>,
|
|
73
|
+
default: () => ({}),
|
|
74
|
+
},
|
|
75
|
+
imgStyle: {
|
|
76
|
+
type: [Object, Array] as PropType<CSSProperties | CSSProperties[]>,
|
|
77
|
+
default: () => ({ maxWidth: "100%" }),
|
|
78
|
+
},
|
|
79
|
+
itemClass: {
|
|
80
|
+
type: [String, Object, Array] as PropType<
|
|
81
|
+
| string
|
|
82
|
+
| Record<string, unknown>
|
|
83
|
+
| (string | Record<string, unknown>)[]
|
|
84
|
+
>,
|
|
85
|
+
default: "",
|
|
86
|
+
},
|
|
87
|
+
imgClass: {
|
|
88
|
+
type: [String, Object, Array] as PropType<
|
|
89
|
+
| string
|
|
90
|
+
| Record<string, unknown>
|
|
91
|
+
| (string | Record<string, unknown>)[]
|
|
92
|
+
>,
|
|
93
|
+
default: "",
|
|
94
|
+
},
|
|
95
|
+
lightboxProps: { type: Object, default: () => ({}) },
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const visibleRef = ref(false);
|
|
99
|
+
const indexRef = ref(0);
|
|
100
|
+
|
|
101
|
+
const extractSrc = (img: any) =>
|
|
102
|
+
typeof img === "string" ? img : img?.src || "";
|
|
103
|
+
const extractTitle = (img: any) =>
|
|
104
|
+
typeof img === "object" ? img.title || "" : "";
|
|
105
|
+
|
|
106
|
+
const showImg = (index: number) => {
|
|
107
|
+
indexRef.value = index;
|
|
108
|
+
visibleRef.value = true;
|
|
109
|
+
};
|
|
110
|
+
const onHide = () => (visibleRef.value = false);
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<style scoped>
|
|
114
|
+
.lightbox-loader-overlay {
|
|
115
|
+
position: fixed;
|
|
116
|
+
top: 0;
|
|
117
|
+
left: 0;
|
|
118
|
+
width: 100vw;
|
|
119
|
+
height: 100vh;
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
justify-content: center;
|
|
123
|
+
pointer-events: none;
|
|
124
|
+
z-index: 9999;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.loadersvg-lightbox {
|
|
128
|
+
animation: rotate 0.8s linear infinite;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@keyframes rotate {
|
|
132
|
+
from {
|
|
133
|
+
transform: rotate(0deg);
|
|
134
|
+
}
|
|
135
|
+
to {
|
|
136
|
+
transform: rotate(360deg);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
:deep(.vel-loading) {
|
|
141
|
+
background: transparent !important;
|
|
142
|
+
display: block !important;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.lightbox-grid {
|
|
146
|
+
width: 100%;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.pic-item {
|
|
150
|
+
transition: opacity 0.2s;
|
|
151
|
+
}
|
|
152
|
+
.pic-item:hover {
|
|
153
|
+
opacity: 0.8;
|
|
154
|
+
}
|
|
155
|
+
</style>
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-local-time" :class="containerClass">
|
|
3
|
+
<div v-if="label" class="time-label">
|
|
4
|
+
{{ label }}
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div class="dynamic-content" :class="{ 'is-ready': isMounted }">
|
|
8
|
+
<div class="time-value">
|
|
9
|
+
<template v-if="!isMounted">
|
|
10
|
+
<span class="time-main">00:00</span>
|
|
11
|
+
<span v-if="showSeconds" class="time-seconds">:00</span>
|
|
12
|
+
<span v-if="!is24" class="time-period">AM</span>
|
|
13
|
+
</template>
|
|
14
|
+
<template v-else>
|
|
15
|
+
<span class="time-main"
|
|
16
|
+
>{{ timeParts.hours }}:{{ timeParts.minutes }}</span
|
|
17
|
+
>
|
|
18
|
+
<span v-if="showSeconds" class="time-seconds"
|
|
19
|
+
>:{{ timeParts.seconds }}</span
|
|
20
|
+
>
|
|
21
|
+
<span v-if="!is24" class="time-period">{{
|
|
22
|
+
timeParts.dayPeriod
|
|
23
|
+
}}</span>
|
|
24
|
+
</template>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div v-if="showDate" class="date-value">
|
|
28
|
+
<span v-if="!isMounted" class="date-placeholder"> </span>
|
|
29
|
+
<span v-else>{{ currentDate }}</span>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup>
|
|
36
|
+
const props = defineProps({
|
|
37
|
+
timezone: { type: String, required: true },
|
|
38
|
+
label: { type: String, default: "" },
|
|
39
|
+
showDate: { type: Boolean, default: false },
|
|
40
|
+
showSeconds: { type: Boolean, default: false },
|
|
41
|
+
is24: { type: Boolean, default: true },
|
|
42
|
+
containerClass: { type: String, default: "" },
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const settingsStore = useSettingsStore();
|
|
46
|
+
const now = ref(new Date());
|
|
47
|
+
const isMounted = ref(false);
|
|
48
|
+
let timer = null;
|
|
49
|
+
|
|
50
|
+
onMounted(() => {
|
|
51
|
+
isMounted.value = true;
|
|
52
|
+
timer = setInterval(() => {
|
|
53
|
+
now.value = new Date();
|
|
54
|
+
}, 1000);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
onBeforeUnmount(() => {
|
|
58
|
+
if (timer) clearInterval(timer);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const timeParts = computed(() => {
|
|
62
|
+
const formatter = new Intl.DateTimeFormat(
|
|
63
|
+
settingsStore.currentLocale || "en-US",
|
|
64
|
+
{
|
|
65
|
+
hour: "2-digit",
|
|
66
|
+
minute: "2-digit",
|
|
67
|
+
second: "2-digit",
|
|
68
|
+
hour12: !props.is24,
|
|
69
|
+
timeZone: props.timezone,
|
|
70
|
+
},
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const parts = formatter.formatToParts(now.value);
|
|
74
|
+
const getPart = (type) => parts.find((p) => p.type === type)?.value || "";
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
hours: getPart("hour"),
|
|
78
|
+
minutes: getPart("minute"),
|
|
79
|
+
seconds: getPart("second"),
|
|
80
|
+
dayPeriod: getPart("dayPeriod") || getPart("ampm"),
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const currentDate = computed(() => {
|
|
85
|
+
if (!props.showDate) return "";
|
|
86
|
+
return new Intl.DateTimeFormat(settingsStore.currentLocale || "en-US", {
|
|
87
|
+
day: "numeric",
|
|
88
|
+
month: "long",
|
|
89
|
+
year: "numeric",
|
|
90
|
+
timeZone: props.timezone,
|
|
91
|
+
}).format(now.value);
|
|
92
|
+
});
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<style scoped>
|
|
96
|
+
.ui-local-time {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
color: var(--ui-text);
|
|
100
|
+
font-variant-numeric: tabular-nums;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.time-label {
|
|
104
|
+
height: 14px;
|
|
105
|
+
font-size: 0.75rem;
|
|
106
|
+
opacity: 0.5;
|
|
107
|
+
text-transform: uppercase;
|
|
108
|
+
letter-spacing: 0.03em;
|
|
109
|
+
margin-bottom: 4px;
|
|
110
|
+
line-height: 1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.dynamic-content {
|
|
114
|
+
opacity: 0;
|
|
115
|
+
transition: opacity 0.4s ease-in-out;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.dynamic-content.is-ready {
|
|
119
|
+
opacity: 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.time-value {
|
|
123
|
+
height: 1.5rem;
|
|
124
|
+
font-size: 1.5rem;
|
|
125
|
+
line-height: 1.5rem;
|
|
126
|
+
font-weight: 400;
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: baseline;
|
|
129
|
+
white-space: nowrap;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.time-main {
|
|
133
|
+
font-size: 1.5rem;
|
|
134
|
+
line-height: 1;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.time-seconds {
|
|
138
|
+
opacity: 0.5;
|
|
139
|
+
font-size: 1rem;
|
|
140
|
+
margin-left: 1px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.time-period {
|
|
144
|
+
font-size: 0.9rem;
|
|
145
|
+
font-weight: 500;
|
|
146
|
+
text-transform: uppercase;
|
|
147
|
+
margin-left: 6px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.date-value {
|
|
151
|
+
height: 1.25rem;
|
|
152
|
+
line-height: 1.25rem;
|
|
153
|
+
font-size: 0.9rem;
|
|
154
|
+
opacity: 0.6;
|
|
155
|
+
margin-top: 4px;
|
|
156
|
+
text-transform: capitalize;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.is-compact .time-value {
|
|
160
|
+
height: 1rem;
|
|
161
|
+
line-height: 1rem;
|
|
162
|
+
}
|
|
163
|
+
.is-compact .time-main {
|
|
164
|
+
font-size: 1rem;
|
|
165
|
+
}
|
|
166
|
+
.is-compact .time-seconds,
|
|
167
|
+
.is-compact .time-period {
|
|
168
|
+
font-size: 0.7rem;
|
|
169
|
+
}
|
|
170
|
+
</style>
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
modelValue: boolean;
|
|
4
|
+
title?: string;
|
|
5
|
+
width?: string;
|
|
6
|
+
preventClose?: boolean;
|
|
7
|
+
bodyClass?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
11
|
+
modelValue: false,
|
|
12
|
+
width: "max-w-md",
|
|
13
|
+
preventClose: false,
|
|
14
|
+
bodyClass: "px-6 py-5 max-h-[70vh] overflow-y-auto custom-scrollbar",
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const emit = defineEmits(["update:modelValue", "close"]);
|
|
18
|
+
const uid = useId();
|
|
19
|
+
const { register, unregister, isTop } = useModalState();
|
|
20
|
+
const isMounted = ref(false);
|
|
21
|
+
|
|
22
|
+
onMounted(() => {
|
|
23
|
+
isMounted.value = true;
|
|
24
|
+
});
|
|
25
|
+
watch(
|
|
26
|
+
() => props.modelValue,
|
|
27
|
+
(isOpen) => {
|
|
28
|
+
if (isOpen) register(uid);
|
|
29
|
+
else unregister(uid);
|
|
30
|
+
},
|
|
31
|
+
);
|
|
32
|
+
onUnmounted(() => unregister(uid));
|
|
33
|
+
const close = () => {
|
|
34
|
+
if (props.preventClose) return;
|
|
35
|
+
emit("update:modelValue", false);
|
|
36
|
+
emit("close");
|
|
37
|
+
};
|
|
38
|
+
const handleBackdropClick = () => {
|
|
39
|
+
if (isTop(uid)) close();
|
|
40
|
+
};
|
|
41
|
+
const handleEsc = (e: KeyboardEvent) => {
|
|
42
|
+
if (e.key === "Escape" && props.modelValue && isTop(uid)) close();
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
onMounted(() => {
|
|
46
|
+
if (typeof window !== "undefined")
|
|
47
|
+
window.addEventListener("keydown", handleEsc);
|
|
48
|
+
});
|
|
49
|
+
onUnmounted(() => {
|
|
50
|
+
if (typeof window !== "undefined")
|
|
51
|
+
window.removeEventListener("keydown", handleEsc);
|
|
52
|
+
});
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
<Teleport v-if="isMounted" to="body">
|
|
57
|
+
<Transition
|
|
58
|
+
enter-active-class="transition duration-200 ease-out"
|
|
59
|
+
enter-from-class="opacity-0"
|
|
60
|
+
enter-to-class="opacity-100"
|
|
61
|
+
leave-active-class="transition duration-150 ease-in"
|
|
62
|
+
leave-from-class="opacity-100"
|
|
63
|
+
leave-to-class="opacity-0"
|
|
64
|
+
>
|
|
65
|
+
<div
|
|
66
|
+
v-if="modelValue"
|
|
67
|
+
class="relative z-80"
|
|
68
|
+
aria-modal="true"
|
|
69
|
+
role="dialog"
|
|
70
|
+
data-nosnippet
|
|
71
|
+
>
|
|
72
|
+
<div
|
|
73
|
+
class="fixed inset-0 bg-black/40 backdrop-blur-sm transition-opacity"
|
|
74
|
+
@click="handleBackdropClick"
|
|
75
|
+
></div>
|
|
76
|
+
|
|
77
|
+
<div class="fixed inset-0 z-10 overflow-y-auto w-screen">
|
|
78
|
+
<div
|
|
79
|
+
class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"
|
|
80
|
+
@click.self="handleBackdropClick"
|
|
81
|
+
>
|
|
82
|
+
<Transition
|
|
83
|
+
enter-active-class="transition duration-300 ease-out"
|
|
84
|
+
enter-from-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
85
|
+
enter-to-class="opacity-100 translate-y-0 sm:scale-100"
|
|
86
|
+
leave-active-class="transition duration-200 ease-in"
|
|
87
|
+
leave-from-class="opacity-100 translate-y-0 sm:scale-100"
|
|
88
|
+
leave-to-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
89
|
+
>
|
|
90
|
+
<div
|
|
91
|
+
class="relative transform overflow-hidden rounded-xl text-left shadow-2xl transition-all w-full bg-(--ui-bg) text-(--ui-text) border border-neutral-200 dark:border-neutral-800"
|
|
92
|
+
:class="[width]"
|
|
93
|
+
@click.stop
|
|
94
|
+
>
|
|
95
|
+
<div
|
|
96
|
+
v-if="title || $slots.header"
|
|
97
|
+
class="flex items-center justify-between px-6 py-4 border-b border-neutral-200/50 dark:border-neutral-800/50"
|
|
98
|
+
>
|
|
99
|
+
<slot name="header">
|
|
100
|
+
<h3
|
|
101
|
+
class="text-lg font-semibold leading-6 opacity-90"
|
|
102
|
+
>
|
|
103
|
+
{{ title }}
|
|
104
|
+
</h3>
|
|
105
|
+
</slot>
|
|
106
|
+
|
|
107
|
+
<button
|
|
108
|
+
v-if="!preventClose"
|
|
109
|
+
@click="close"
|
|
110
|
+
class="ml-4 -mr-1 rounded-md p-1 hover:bg-black/5 dark:hover:bg-white/10 transition-colors focus:outline-none"
|
|
111
|
+
>
|
|
112
|
+
<svg
|
|
113
|
+
class="h-5 w-5 opacity-50 hover:opacity-100"
|
|
114
|
+
fill="none"
|
|
115
|
+
viewBox="0 0 24 24"
|
|
116
|
+
stroke="currentColor"
|
|
117
|
+
>
|
|
118
|
+
<path
|
|
119
|
+
stroke-linecap="round"
|
|
120
|
+
stroke-linejoin="round"
|
|
121
|
+
stroke-width="2"
|
|
122
|
+
d="M6 18L18 6M6 6l12 12"
|
|
123
|
+
/>
|
|
124
|
+
</svg>
|
|
125
|
+
</button>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<div :class="bodyClass">
|
|
129
|
+
<slot />
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<div
|
|
133
|
+
v-if="$slots.footer"
|
|
134
|
+
class="bg-neutral-50/50 dark:bg-neutral-900/20 px-6 py-4 border-t border-neutral-200/50 dark:border-neutral-800/50 flex flex-col-reverse sm:flex-row sm:justify-end gap-3"
|
|
135
|
+
>
|
|
136
|
+
<slot name="footer" :close="close" />
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</Transition>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</Transition>
|
|
144
|
+
</Teleport>
|
|
145
|
+
</template>
|
|
146
|
+
|
|
147
|
+
<style scoped>
|
|
148
|
+
.custom-scrollbar::-webkit-scrollbar {
|
|
149
|
+
width: 6px;
|
|
150
|
+
}
|
|
151
|
+
.custom-scrollbar::-webkit-scrollbar-track {
|
|
152
|
+
background: transparent;
|
|
153
|
+
}
|
|
154
|
+
.custom-scrollbar::-webkit-scrollbar-thumb {
|
|
155
|
+
background-color: rgba(156, 163, 175, 0.3);
|
|
156
|
+
border-radius: 20px;
|
|
157
|
+
}
|
|
158
|
+
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
|
159
|
+
background-color: rgba(156, 163, 175, 0.5);
|
|
160
|
+
}
|
|
161
|
+
</style>
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
id: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
image?: string;
|
|
7
|
+
variant?:
|
|
8
|
+
| "simple"
|
|
9
|
+
| "image-left"
|
|
10
|
+
| "image-right"
|
|
11
|
+
| "bg-image"
|
|
12
|
+
| "modern-gradient";
|
|
13
|
+
frequencyDays?: number;
|
|
14
|
+
triggerDelay?: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
18
|
+
variant: "simple",
|
|
19
|
+
frequencyDays: 7,
|
|
20
|
+
triggerDelay: 2000,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const { isOpen, open, close } = usePopupControl(props.id, props.frequencyDays);
|
|
24
|
+
const isMounted = ref(false);
|
|
25
|
+
|
|
26
|
+
onMounted(() => {
|
|
27
|
+
isMounted.value = true;
|
|
28
|
+
setTimeout(() => {
|
|
29
|
+
open();
|
|
30
|
+
}, props.triggerDelay);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const isSideLayout = computed(() =>
|
|
34
|
+
["image-left", "image-right"].includes(props.variant),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const textColorClass = computed(() => {
|
|
38
|
+
if (props.variant === "bg-image") return "text-white";
|
|
39
|
+
return "text-gray-900 dark:text-white";
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const descColorClass = computed(() => {
|
|
43
|
+
if (props.variant === "bg-image") return "text-gray-200";
|
|
44
|
+
return "text-gray-500 dark:text-gray-400";
|
|
45
|
+
});
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<div
|
|
50
|
+
v-if="isMounted"
|
|
51
|
+
style="
|
|
52
|
+
position: fixed;
|
|
53
|
+
top: 0;
|
|
54
|
+
left: 0;
|
|
55
|
+
width: 0;
|
|
56
|
+
height: 0;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
z-index: -1;
|
|
60
|
+
"
|
|
61
|
+
aria-hidden="true"
|
|
62
|
+
>
|
|
63
|
+
<Teleport to="body">
|
|
64
|
+
<Transition
|
|
65
|
+
enter-active-class="transition duration-300 ease-out"
|
|
66
|
+
enter-from-class="opacity-0"
|
|
67
|
+
enter-to-class="opacity-100"
|
|
68
|
+
leave-active-class="transition duration-200 ease-in"
|
|
69
|
+
leave-from-class="opacity-100"
|
|
70
|
+
leave-to-class="opacity-0"
|
|
71
|
+
>
|
|
72
|
+
<div
|
|
73
|
+
v-if="isOpen"
|
|
74
|
+
class="fixed inset-0 z-50 flex items-center justify-center p-4 bg-gray-900/75"
|
|
75
|
+
style="pointer-events: auto"
|
|
76
|
+
@click.self="close(false)"
|
|
77
|
+
>
|
|
78
|
+
<Transition
|
|
79
|
+
enter-active-class="transition duration-300 ease-out"
|
|
80
|
+
enter-from-class="opacity-0 scale-95 translate-y-4"
|
|
81
|
+
enter-to-class="opacity-100 scale-100 translate-y-0"
|
|
82
|
+
leave-active-class="transition duration-200 ease-in"
|
|
83
|
+
leave-from-class="opacity-100 scale-100 translate-y-0"
|
|
84
|
+
leave-to-class="opacity-0 scale-95 translate-y-4"
|
|
85
|
+
>
|
|
86
|
+
<div
|
|
87
|
+
data-nosnippet
|
|
88
|
+
role="dialog"
|
|
89
|
+
aria-modal="true"
|
|
90
|
+
class="relative w-full overflow-hidden bg-white shadow-2xl rounded-2xl dark:bg-gray-800"
|
|
91
|
+
:class="{
|
|
92
|
+
'max-w-lg': !isSideLayout,
|
|
93
|
+
'max-w-2xl': isSideLayout,
|
|
94
|
+
'bg-linear-to-br from-indigo-50 to-white dark:from-gray-800 dark:to-gray-900':
|
|
95
|
+
variant === 'modern-gradient',
|
|
96
|
+
}"
|
|
97
|
+
>
|
|
98
|
+
<div
|
|
99
|
+
v-if="variant === 'bg-image' && image"
|
|
100
|
+
class="absolute inset-0 z-0"
|
|
101
|
+
>
|
|
102
|
+
<img
|
|
103
|
+
:src="image"
|
|
104
|
+
class="object-cover w-full h-full"
|
|
105
|
+
alt=""
|
|
106
|
+
loading="lazy"
|
|
107
|
+
/>
|
|
108
|
+
<div class="absolute inset-0 bg-black/70"></div>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<button
|
|
112
|
+
@click="close(true)"
|
|
113
|
+
class="absolute top-4 right-4 z-20 flex items-center justify-center w-8 h-8 transition-colors rounded-full cursor-pointer focus:outline-none focus:ring-2 focus:ring-indigo-500"
|
|
114
|
+
:class="
|
|
115
|
+
variant === 'bg-image'
|
|
116
|
+
? 'text-white/70 hover:bg-white/20 hover:text-white'
|
|
117
|
+
: 'text-gray-400 hover:bg-gray-100 hover:text-gray-500 dark:hover:bg-gray-700'
|
|
118
|
+
"
|
|
119
|
+
>
|
|
120
|
+
<UiIcon
|
|
121
|
+
name="heroicons:x-mark"
|
|
122
|
+
class="w-6 h-6"
|
|
123
|
+
/>
|
|
124
|
+
</button>
|
|
125
|
+
|
|
126
|
+
<div
|
|
127
|
+
class="relative z-10 flex flex-col"
|
|
128
|
+
:class="{
|
|
129
|
+
'md:flex-row': variant === 'image-left',
|
|
130
|
+
'md:flex-row-reverse':
|
|
131
|
+
variant === 'image-right',
|
|
132
|
+
}"
|
|
133
|
+
>
|
|
134
|
+
<div
|
|
135
|
+
v-if="
|
|
136
|
+
isSideLayout ||
|
|
137
|
+
(image && variant === 'simple')
|
|
138
|
+
"
|
|
139
|
+
class="relative shrink-0"
|
|
140
|
+
:class="{
|
|
141
|
+
'h-48 md:h-auto md:w-2/5': isSideLayout,
|
|
142
|
+
'h-48 w-full':
|
|
143
|
+
variant === 'simple' && image,
|
|
144
|
+
}"
|
|
145
|
+
>
|
|
146
|
+
<img
|
|
147
|
+
v-if="image"
|
|
148
|
+
:src="image"
|
|
149
|
+
alt=""
|
|
150
|
+
class="absolute inset-0 object-cover w-full h-full"
|
|
151
|
+
loading="lazy"
|
|
152
|
+
/>
|
|
153
|
+
<div
|
|
154
|
+
v-else
|
|
155
|
+
class="flex items-center justify-center w-full h-full bg-indigo-100 dark:bg-indigo-900/30"
|
|
156
|
+
>
|
|
157
|
+
<slot name="icon">
|
|
158
|
+
<UiIcon
|
|
159
|
+
name="heroicons:photo"
|
|
160
|
+
class="w-12 h-12 text-indigo-300"
|
|
161
|
+
/>
|
|
162
|
+
</slot>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
<div class="p-6 md:p-8 grow">
|
|
167
|
+
<div class="mb-5">
|
|
168
|
+
<h3
|
|
169
|
+
class="text-2xl font-bold tracking-tight"
|
|
170
|
+
:class="textColorClass"
|
|
171
|
+
>
|
|
172
|
+
{{ title }}
|
|
173
|
+
</h3>
|
|
174
|
+
<p
|
|
175
|
+
class="mt-2 text-base"
|
|
176
|
+
:class="descColorClass"
|
|
177
|
+
>
|
|
178
|
+
{{ description }}
|
|
179
|
+
</p>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<div class="space-y-4">
|
|
183
|
+
<slot :close="close" />
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<div
|
|
187
|
+
v-if="$slots.actions"
|
|
188
|
+
class="mt-8 flex flex-col gap-3 sm:flex-row sm:justify-end"
|
|
189
|
+
>
|
|
190
|
+
<slot name="actions" :close="close" />
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
</Transition>
|
|
196
|
+
</div>
|
|
197
|
+
</Transition>
|
|
198
|
+
</Teleport>
|
|
199
|
+
</div>
|
|
200
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { getPost, renderMarkdown } from "#myelophone/app/utils/blog.server";
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
slug: string;
|
|
6
|
+
}>();
|
|
7
|
+
|
|
8
|
+
const post = await getPost(props.slug);
|
|
9
|
+
const html = post ? renderMarkdown(post.content) : "";
|
|
10
|
+
|
|
11
|
+
if (post) {
|
|
12
|
+
useAppSeo({
|
|
13
|
+
title: post.meta.title,
|
|
14
|
+
description: post.meta.description,
|
|
15
|
+
image: post.meta.image,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<ViewNotFound v-if="!post" :set-response-status="false" />
|
|
22
|
+
<article v-else class="post-content" v-html="html" />
|
|
23
|
+
</template>
|