aboutsummaryrefslogtreecommitdiff
path: root/src/layouts/tool.layout.vue
blob: 01c8cc16fcc9dffb0afd9b6f4d1a635fbb50201b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<script lang="ts" setup>
import { useRoute } from 'vue-router';
import BaseLayout from './base.layout.vue';
import { useHead } from '@vueuse/head'
import type { HeadObject } from '@vueuse/head'
import { reactive } from 'vue';

const route = useRoute()

const head = reactive<HeadObject>({
    title: `${route.meta.name} - IT Tools`,
    meta: [
        {
            name: 'description',
            content: route.meta.description
        },
        {
            name: 'keywords',
            content: route.meta.keywords
        }
    ]
})
useHead(head)
</script>

<template>
    <base-layout>
        <div class="tool-layout">
            <div class="tool-header">
                <n-h1>{{ route.meta.name }}</n-h1>
                <div class="separator" />
                <div class="description">{{ route.meta.description }}</div>
            </div>

            <slot />
        </div>
    </base-layout>
</template>

<style lang="less" scoped>
.tool-layout {
    max-width: 700px;
    margin: 0 auto;
    box-sizing: border-box;

    .tool-header {
        padding: 40px 0;
        .n-h1 {
            opacity: 0.9;
            font-size: 40px;
            font-weight: 400;
            margin: 0;
        }
        .separator {
            width: 200px;
            height: 2px;
            background: rgb(161, 161, 161);

            margin-bottom: 10px;
        }
        .description {
            margin: 0;

            opacity: 0.7;
        }
    }
}
</style>