1
0
Fork 0
mirror of https://github.com/CorentinTh/it-tools.git synced 2025-07-18 20:59:37 +02:00
it-tools/src/layouts/tool.layout.vue
Corentin Thomasset 0fd99deca9
wip
2023-04-15 21:47:00 +02:00

102 lines
1.9 KiB
Vue

<script lang="ts" setup>
import { useHead } from '@vueuse/head';
import type { HeadObject } from '@vueuse/head';
import { computed } from 'vue';
import FavoriteButton from '@/components/FavoriteButton.vue';
import type { Tool } from '@/tools/tools.types';
import BaseLayout from './base.layout.vue';
const route = useRoute();
const head = computed<HeadObject>(() => ({
title: `${route.meta.name} - IT Tools`,
meta: [
{
name: 'description',
content: route.meta?.description as string,
},
{
name: 'keywords',
content: ((route.meta.keywords ?? []) as string[]).join(','),
},
],
}));
useHead(head);
</script>
<template>
<base-layout>
<div class="tool-layout">
<div class="tool-header">
<n-space align="center" justify="space-between" :wrap="false">
<n-h1>
{{ route.meta.name }}
</n-h1>
<div>
<favorite-button :tool="{name: route.meta.name} as Tool" />
</div>
</n-space>
<div class="separator" />
<div class="description">
{{ route.meta.description }}
</div>
</div>
</div>
<div class="tool-content">
<slot />
</div>
</base-layout>
</template>
<style lang="less" scoped>
.tool-content {
display: flex;
flex-direction: row;
justify-content: center;
align-items: flex-start;
flex-wrap: wrap;
gap: 16px;
::v-deep(& > *) {
flex: 0 1 600px;
}
}
.tool-layout {
max-width: 600px;
margin: 0 auto;
box-sizing: border-box;
.tool-header {
padding: 40px 0;
width: 100%;
.n-h1 {
opacity: 0.9;
font-size: 40px;
font-weight: 400;
margin: 0;
line-height: 1;
}
.separator {
width: 200px;
height: 2px;
background: rgb(161, 161, 161);
opacity: 0.2;
margin: 10px 0;
}
.description {
margin: 0;
opacity: 0.7;
}
}
}
</style>