2022-04-04 00:24:45 +02:00
|
|
|
<script lang="ts" setup>
|
2023-04-10 13:00:38 +02:00
|
|
|
import { NIcon, useThemeVars } from 'naive-ui';
|
2023-06-10 17:14:50 +02:00
|
|
|
|
2023-04-10 13:00:38 +02:00
|
|
|
import { RouterLink } from 'vue-router';
|
2023-05-28 23:13:24 +02:00
|
|
|
import { Heart, Home2, Menu2 } from '@vicons/tabler';
|
2023-06-19 00:21:36 +02:00
|
|
|
|
2023-11-01 15:38:19 +01:00
|
|
|
import { storeToRefs } from 'pinia';
|
2023-05-28 23:13:24 +02:00
|
|
|
import HeroGradient from '../assets/hero-gradient.svg?component';
|
|
|
|
import MenuLayout from '../components/MenuLayout.vue';
|
|
|
|
import NavbarButtons from '../components/NavbarButtons.vue';
|
2024-04-21 10:37:40 +08:00
|
|
|
import CLink from '@/ui/c-link/c-link.vue';
|
|
|
|
import CTooltip from '@/ui/c-tooltip/c-tooltip.vue';
|
|
|
|
import CButton from '@/ui/c-button/c-button.vue';
|
|
|
|
import CommandPalette from '@/modules/command-palette/command-palette.vue';
|
|
|
|
import LocaleSelector from '@/modules/i18n/components/locale-selector.vue';
|
2022-04-04 01:52:59 +02:00
|
|
|
import { useStyleStore } from '@/stores/style.store';
|
2022-05-24 00:07:54 +02:00
|
|
|
import { config } from '@/config';
|
2023-04-10 13:00:38 +02:00
|
|
|
import type { ToolCategory } from '@/tools/tools.types';
|
2022-12-17 15:33:52 +01:00
|
|
|
import { useToolStore } from '@/tools/tools.store';
|
2022-12-21 21:02:57 +01:00
|
|
|
import { useTracker } from '@/modules/tracker/tracker.services';
|
2023-03-30 23:35:34 +02:00
|
|
|
import CollapsibleToolMenu from '@/components/CollapsibleToolMenu.vue';
|
2022-04-22 23:31:40 +02:00
|
|
|
|
|
|
|
const themeVars = useThemeVars();
|
|
|
|
const styleStore = useStyleStore();
|
2022-05-24 00:07:54 +02:00
|
|
|
const version = config.app.version;
|
|
|
|
const commitSha = config.app.lastCommitSha.slice(0, 7);
|
2022-04-16 11:45:50 +02:00
|
|
|
|
2022-12-21 21:02:57 +01:00
|
|
|
const { tracker } = useTracker();
|
2023-11-01 15:38:19 +01:00
|
|
|
const { t } = useI18n();
|
2022-12-21 21:02:57 +01:00
|
|
|
|
2022-12-17 15:33:52 +01:00
|
|
|
const toolStore = useToolStore();
|
2023-11-01 15:38:19 +01:00
|
|
|
const { favoriteTools, toolsByCategory } = storeToRefs(toolStore);
|
2022-12-17 15:33:52 +01:00
|
|
|
|
2023-03-30 23:35:34 +02:00
|
|
|
const tools = computed<ToolCategory[]>(() => [
|
2023-11-01 15:38:19 +01:00
|
|
|
...(favoriteTools.value.length > 0 ? [{ name: t('tools.categories.favorite-tools'), components: favoriteTools.value }] : []),
|
|
|
|
...toolsByCategory.value,
|
2023-03-30 23:35:34 +02:00
|
|
|
]);
|
2022-03-31 00:33:29 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-05-28 23:13:24 +02:00
|
|
|
<MenuLayout class="menu-layout" :class="{ isSmallScreen: styleStore.isSmallScreen }">
|
2022-04-15 23:10:47 +02:00
|
|
|
<template #sider>
|
2023-05-28 23:13:24 +02:00
|
|
|
<RouterLink to="/" class="hero-wrapper">
|
2024-04-23 00:08:15 +08:00
|
|
|
<h2 class='text-center logo'>极客日志</h2>
|
|
|
|
<!-- <div class="text-wrapper">-->
|
|
|
|
<!-- <div class="title">-->
|
|
|
|
<!-- IT - TOOLS-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- <div class="divider" />-->
|
|
|
|
<!-- <div class="subtitle">-->
|
|
|
|
<!-- {{ $t('home.subtitle') }}-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- </div>-->
|
2023-05-28 23:13:24 +02:00
|
|
|
</RouterLink>
|
2022-04-15 23:10:47 +02:00
|
|
|
|
|
|
|
<div class="sider-content">
|
2023-11-01 15:38:19 +01:00
|
|
|
<div v-if="styleStore.isSmallScreen" flex flex-col items-center>
|
2024-04-21 10:37:40 +08:00
|
|
|
<LocaleSelector w="90%" />
|
2023-11-01 15:38:19 +01:00
|
|
|
|
|
|
|
<div flex justify-center>
|
|
|
|
<NavbarButtons />
|
|
|
|
</div>
|
2023-05-27 17:36:15 +02:00
|
|
|
</div>
|
2022-04-15 23:10:47 +02:00
|
|
|
|
2023-05-28 23:13:24 +02:00
|
|
|
<CollapsibleToolMenu :tools-by-category="tools" />
|
2022-04-16 11:45:50 +02:00
|
|
|
|
|
|
|
<div class="footer">
|
|
|
|
<div>
|
2022-04-16 15:12:33 +02:00
|
|
|
IT-Tools
|
|
|
|
|
2024-04-23 00:08:15 +08:00
|
|
|
<CLink target="_blank" rel="noopener" :href="`https://github.com/zeeklog/it-tools/tree/v${version}`">
|
2022-04-16 11:45:50 +02:00
|
|
|
v{{ version }}
|
2024-04-21 10:37:40 +08:00
|
|
|
</CLink>
|
2022-04-16 15:12:33 +02:00
|
|
|
|
|
|
|
<template v-if="commitSha && commitSha.length > 0">
|
|
|
|
-
|
2024-04-21 10:37:40 +08:00
|
|
|
<CLink
|
2022-04-16 21:01:31 +02:00
|
|
|
target="_blank"
|
|
|
|
rel="noopener"
|
|
|
|
type="primary"
|
2024-04-23 00:08:15 +08:00
|
|
|
:href="`https://github.com/zeeklog/it-tools/tree/${commitSha}`"
|
2022-04-16 21:01:31 +02:00
|
|
|
>
|
2022-04-16 15:12:33 +02:00
|
|
|
{{ commitSha }}
|
2024-04-21 10:37:40 +08:00
|
|
|
</CLink>
|
2022-04-16 15:12:33 +02:00
|
|
|
</template>
|
2022-04-16 11:45:50 +02:00
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
© {{ new Date().getFullYear() }}
|
2024-04-23 00:08:15 +08:00
|
|
|
<CLink target="_blank" rel="noopener" href="https://github.com/zeeklog">
|
|
|
|
Ne0inHK
|
2024-04-21 10:37:40 +08:00
|
|
|
</CLink>
|
2022-04-16 11:45:50 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-04-15 23:10:47 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<template #content>
|
2023-06-27 18:47:32 +02:00
|
|
|
<div flex items-center justify-center gap-2>
|
2024-04-22 23:42:56 +08:00
|
|
|
<!-- <CButton-->
|
|
|
|
<!-- circle-->
|
|
|
|
<!-- variant="text"-->
|
|
|
|
<!-- :aria-label="$t('home.toggleMenu')"-->
|
|
|
|
<!-- @click="styleStore.isMenuCollapsed = !styleStore.isMenuCollapsed"-->
|
|
|
|
<!-- >-->
|
|
|
|
<!-- <NIcon size="25" :component="Menu2" />-->
|
|
|
|
<!-- </CButton>-->
|
2023-04-19 21:38:59 +02:00
|
|
|
|
2024-04-21 10:37:40 +08:00
|
|
|
<CTooltip :tooltip="$t('home.home')" position="bottom">
|
|
|
|
<CButton to="/" circle variant="text" :aria-label="$t('home.home')">
|
2023-10-14 18:24:54 +02:00
|
|
|
<NIcon size="25" :component="Home2" />
|
2024-04-21 10:37:40 +08:00
|
|
|
</CButton>
|
|
|
|
</CTooltip>
|
2023-10-14 18:24:54 +02:00
|
|
|
|
2024-04-21 10:37:40 +08:00
|
|
|
<CTooltip :tooltip="$t('home.uiLib')" position="bottom">
|
|
|
|
<CButton v-if="config.app.env === 'development'" to="/c-lib" circle variant="text" :aria-label="$t('home.uiLib')">
|
2023-10-14 18:24:54 +02:00
|
|
|
<icon-mdi:brush-variant text-20px />
|
2024-04-21 10:37:40 +08:00
|
|
|
</CButton>
|
|
|
|
</CTooltip>
|
2023-08-07 17:30:00 +02:00
|
|
|
|
2024-04-21 10:37:40 +08:00
|
|
|
<CommandPalette />
|
2022-04-15 23:10:47 +02:00
|
|
|
|
2024-04-21 10:37:40 +08:00
|
|
|
<LocaleSelector v-if="!styleStore.isSmallScreen" />
|
2023-11-01 15:38:19 +01:00
|
|
|
|
2023-06-27 18:47:32 +02:00
|
|
|
<div>
|
|
|
|
<NavbarButtons v-if="!styleStore.isSmallScreen" />
|
|
|
|
</div>
|
2022-11-13 23:16:57 +01:00
|
|
|
|
2024-04-22 23:42:56 +08:00
|
|
|
<!-- <CTooltip position="bottom" :tooltip="$t('home.support')">-->
|
|
|
|
<!-- <CButton-->
|
|
|
|
<!-- round-->
|
|
|
|
<!-- href="https://www.buymeacoffee.com/cthmsst"-->
|
|
|
|
<!-- rel="noopener"-->
|
|
|
|
<!-- target="_blank"-->
|
|
|
|
<!-- class="support-button"-->
|
|
|
|
<!-- :bordered="false"-->
|
|
|
|
<!-- @click="() => tracker.trackEvent({ eventName: 'Support button clicked' })"-->
|
|
|
|
<!-- >-->
|
|
|
|
<!-- {{ $t('home.buyMeACoffee') }}-->
|
|
|
|
<!-- <NIcon v-if="!styleStore.isSmallScreen" :component="Heart" ml-2 />-->
|
|
|
|
<!-- </CButton>-->
|
|
|
|
<!-- </CTooltip>-->
|
2022-04-15 23:10:47 +02:00
|
|
|
</div>
|
|
|
|
<slot />
|
|
|
|
</template>
|
2023-05-28 23:13:24 +02:00
|
|
|
</MenuLayout>
|
2022-03-31 00:33:29 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
2024-04-23 00:08:15 +08:00
|
|
|
.logo {
|
|
|
|
text-decoration: unset;
|
|
|
|
color: #000000;
|
|
|
|
}
|
2022-04-14 23:12:36 +02:00
|
|
|
// ::v-deep(.n-layout-scroll-container) {
|
|
|
|
// @percent: 4%;
|
|
|
|
// @position: 25px;
|
|
|
|
// @size: 50px;
|
|
|
|
// @color: #eeeeee25;
|
|
|
|
// background-image: radial-gradient(@color @percent, transparent @percent),
|
|
|
|
// radial-gradient(@color @percent, transparent @percent);
|
|
|
|
// background-position: 0 0, @position @position;
|
|
|
|
// background-size: @size @size;
|
|
|
|
// }
|
|
|
|
|
2022-12-17 01:30:27 +01:00
|
|
|
.support-button {
|
|
|
|
background: rgb(37, 99, 108);
|
|
|
|
background: linear-gradient(48deg, rgba(37, 99, 108, 1) 0%, rgba(59, 149, 111, 1) 60%, rgba(20, 160, 88, 1) 100%);
|
2023-04-19 21:38:59 +02:00
|
|
|
color: #fff !important;
|
|
|
|
transition: padding ease 0.2s !important;
|
2022-12-17 01:30:27 +01:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: #fff;
|
|
|
|
padding-left: 30px;
|
|
|
|
padding-right: 30px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-16 11:45:50 +02:00
|
|
|
.footer {
|
|
|
|
text-align: center;
|
|
|
|
color: #838587;
|
|
|
|
margin-top: 20px;
|
|
|
|
padding: 20px 0;
|
|
|
|
}
|
|
|
|
|
2022-04-15 12:21:09 +02:00
|
|
|
.sider-content {
|
2024-04-23 00:08:15 +08:00
|
|
|
//padding-top: 3em;
|
2022-04-16 11:13:30 +02:00
|
|
|
padding-bottom: 200px;
|
2022-04-14 22:41:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.hero-wrapper {
|
2024-04-23 00:08:15 +08:00
|
|
|
//position: absolute;
|
2022-04-16 11:13:30 +02:00
|
|
|
display: block;
|
2024-04-23 00:08:15 +08:00
|
|
|
//left: 0;
|
2022-04-16 11:13:30 +02:00
|
|
|
width: 100%;
|
|
|
|
z-index: 10;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
.gradient {
|
|
|
|
margin-top: -65px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.text-wrapper {
|
2022-04-14 22:41:51 +02:00
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
2022-04-16 11:13:30 +02:00
|
|
|
text-align: center;
|
|
|
|
top: 16px;
|
|
|
|
color: #fff;
|
2022-04-14 22:41:51 +02:00
|
|
|
|
2022-04-16 11:13:30 +02:00
|
|
|
.title {
|
|
|
|
font-size: 25px;
|
|
|
|
font-weight: 600;
|
2022-04-14 22:41:51 +02:00
|
|
|
}
|
|
|
|
|
2022-04-16 11:13:30 +02:00
|
|
|
.divider {
|
|
|
|
width: 50px;
|
|
|
|
height: 2px;
|
|
|
|
border-radius: 4px;
|
|
|
|
background-color: v-bind('themeVars.primaryColor');
|
|
|
|
margin: 0 auto 5px;
|
|
|
|
}
|
2022-04-14 22:41:51 +02:00
|
|
|
|
2022-04-16 11:13:30 +02:00
|
|
|
.subtitle {
|
|
|
|
font-size: 16px;
|
2022-04-14 22:41:51 +02:00
|
|
|
}
|
2022-04-16 11:13:30 +02:00
|
|
|
}
|
2022-04-14 22:41:51 +02:00
|
|
|
}
|
2022-04-22 23:31:40 +02:00
|
|
|
</style>
|