Refactor classes

This commit is contained in:
Nicola Spadari
2024-06-16 23:07:18 +02:00
parent ba240a9faa
commit 7308ad03cb
17 changed files with 133 additions and 111 deletions

View File

@@ -1,38 +1,36 @@
<template>
<Body bg-dark-800 text-white>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</Body>
<Html min-h-screen>
<Body overflow-x-hidden bg-dark-800 text-white>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</Body>
</Html>
</template>
<style lang="scss">
html {
-webkit-tap-highlight-color: transparent;
scroll-behavior: smooth;
@apply min-h-screen;
}
body {
@apply overflow-x-hidden;
}
img {
-webkit-user-drag: none;
@apply select-none;
}
html {
-webkit-tap-highlight-color: transparent;
scroll-behavior: smooth;
}
img {
-webkit-user-drag: none;
@apply select-none;
}
// Transitions
.page-enter-active,
.page-leave-active {
@apply transition-opacity ease-in-out duration-300;
}
.layout-enter-active,
.layout-leave-active {
@apply transition-opacity ease-in-out duration-500;
}
.page-enter-from,
.page-leave-to,
.layout-enter-from,
.layout-leave-to {
@apply opacity-0;
}
// Transitions
.page-enter-active,
.page-leave-active {
@apply transition-opacity ease-in-out duration-300;
}
.layout-enter-active,
.layout-leave-active {
@apply transition-opacity ease-in-out duration-500;
}
.page-enter-from,
.page-leave-to,
.layout-enter-from,
.layout-leave-to {
@apply opacity-0;
}
</style>

View File

@@ -1,5 +1,11 @@
<template>
<div class="pointer-events-none absolute inset-x-0 top-1/5 transform-gpu blur-3xl -z-10" aria-hidden="true">
<div class="relative left-[calc(50%+36rem)] aspect-[1155/678] w-[72.1875rem] from-[#00DC82] to-[#FFC131] bg-gradient-to-tr opacity-30 -translate-x-1/2" style="clip-path: polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)" />
<div pointer-events-none absolute inset-x-0 top="1/5" transform-gpu blur-3xl z="-10" aria-hidden="true">
<div class="blob" relative left="[calc(50%+36rem)]" aspect="[1155/678]" w="[72.1875rem]" from-emerald-500 to-amber-400 bg-gradient-to-tr opacity-30 translate-x="-1/2" />
</div>
</template>
<style scoped>
.blob{
clip-path: polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%);
}
</style>

View File

@@ -1,5 +1,11 @@
<template>
<div class="pointer-events-none absolute inset-x-0 transform-gpu blur-3xl -top-1/4 -z-10" aria-hidden="true">
<div class="relative left-[calc(50%-30rem)] aspect-[1155/678] w-[72.1875rem] rotate-[30deg] from-[#FFC131] to-[#00DC82] bg-gradient-to-tr opacity-30 -translate-x-1/2" style="clip-path: polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)" />
<div pointer-events-none absolute inset-x-0 transform-gpu blur-3xl top="-1/4" z="-10" aria-hidden="true">
<div class="blob" relative left="[calc(50%-30rem)]" aspect="[1155/678]" w="[72.1875rem]" rotate-30 from-amber-400 to-emerald-500 bg-gradient-to-tr opacity-30 translate-x="-1/2" />
</div>
</template>
<style scoped>
.blob{
clip-path: polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%);
}
</style>

View File

@@ -1,16 +1,16 @@
<template>
<div class="grid grid-cols-1 lg:grid-cols-2">
<div class="px-6 pb-10 pt-12 lg:px-8 lg:pt-22 sm:pt-16">
<div class="mx-auto max-w-xl lg:mx-0 lg:max-w-lg">
<h2 class="text-3xl text-white font-bold tracking-tight">
<div grid grid-cols-1 lg="grid-cols-2">
<div px-6 pb-10 pt-12 lg="px-8 pt-22" sm="pt-16">
<div mx-auto max-w-xl lg="mx-0 max-w-lg">
<h2 text-3xl text-white font-bold tracking-tight>
{{ props.title }}
</h2>
<p class="mt-6 text-lg text-gray-300 leading-8">
<p mt-6 text-lg text-gray-300 leading-8>
{{ props.description }}
</p>
</div>
</div>
<div class="px-6 pb-10 pt-12 lg:px-8 lg:pt-22 sm:pt-16">
<div px-6 pb-10 pt-12 lg="px-8 pt-22" sm="pt-16">
<slot />
</div>
</div>

View File

@@ -0,0 +1,5 @@
<template>
<NuxtLink lg="inline text-sm py-0" text-white font-semibold leading-6 py-2 block>
<slot />
</NuxtLink>
</template>

View File

@@ -1,33 +1,32 @@
<template>
<header class="top-0 z-10">
<header top-0 z-10>
<nav flex items-center justify-between py-6 crate>
<div class="flex lg:flex-1">
<NuxtLink to="/" class="home p-1.5 -m-1.5">
<span class="sr-only">{{ name }}</span>
<div flex lg="flex-1">
<NuxtLink to="/" class="home" p-1.5 m="-1.5">
<SvgoLogo :font-controlled="false" size-8 />
</NuxtLink>
</div>
<div class="flex lg:hidden">
<button type="button" @click="showSidebar = true" class="inline-flex items-center justify-center rounded-md p-2.5 text-neutral-300 -m-2.5">
<div flex lg="hidden">
<button type="button" @click="showSidebar = true" inline-flex items-center justify-center rounded-md p-2.5 text-neutral-300 m="-2.5">
<i-heroicons-solid-bars-3 size-6 />
</button>
</div>
<div hidden lg="flex gap-x-12">
<NuxtLink to="/commands" class="text-sm text-white font-semibold leading-6">
<NavLink to="/commands">
Commands
</NuxtLink>
<NuxtLink to="/notifications" class="text-sm text-white font-semibold leading-6">
</NavLink>
<NavLink to="/notifications">
Notifications
</NuxtLink>
<NuxtLink to="/os" class="text-sm text-white font-semibold leading-6">
</NavLink>
<NavLink to="/os">
OS Informations
</NuxtLink>
<NuxtLink to="/foo" class="text-sm text-white font-semibold leading-6">
</NavLink>
<NavLink to="/foo">
404
</NuxtLink>
</NavLink>
</div>
<div hidden lg="flex flex-1 justify-end">
<p class="text-sm text-white font-semibold leading-6">
<p text-sm text-white font-semibold leading-6>
v{{ tauriVersion }}
</p>
</div>
@@ -36,7 +35,6 @@
</template>
<script lang="ts" setup>
const { name } = useConstants();
const { showSidebar } = useSidebar();
const tauriVersion = await getTauriVersion();
</script>

View File

@@ -3,35 +3,35 @@
enter-from-class="opacity-0" enter-active-class="ease-in-out duration-500" enter-to-class="opacity-100"
leave-from-class="opacity-100" leave-active-class="ease-in-out duration-500" leave-to-class="opacity-0"
>
<div v-if="showSidebar" class="relative z-20 lg:hidden" role="dialog" aria-modal="true">
<div class="fixed inset-0 overflow-hidden">
<div class="h-full flex flex-col overflow-y-auto bg-neutral-800/70 px-4 py-6 backdrop-blur-md">
<div class="flex items-center justify-between">
<NuxtLink to="/" class="p-1.5 -m-1.5">
<div v-if="showSidebar" relative z-20 lg="hidden" role="dialog" aria-modal="true">
<div fixed inset-0 overflow-hidden>
<div crate h-full flex flex-col overflow-y-auto bg="neutral-800/70" py-6 backdrop-blur-md>
<div flex items-center justify-between>
<NuxtLink to="/" p-1.5 m="-1.5">
<SvgoLogo :filled="true" :font-controlled="false" size-8 />
</NuxtLink>
<button type="button" class="rounded-md p-2.5 text-neutral-300 -m-2.5" @click="showSidebar = false">
<button type="button" rounded-md p-2.5 text-neutral-300 m="2.5" @click="showSidebar = false">
<i-heroicons-solid-x-mark size-6 />
</button>
</div>
<div class="mt-6 flow-root">
<div class="-my-6 divide-y divide-gray-500/25">
<div class="py-6 space-y-2">
<NuxtLink to="/commands" class="block px-3 py-2 text-base text-white font-semibold leading-7 -mx-3">
<div mt-6 flow-root>
<div my="-6" divide-y divide="gray-500/25">
<div py-6 space-y-2>
<NavLink to="/commands">
Commands
</NuxtLink>
<NuxtLink to="/notifications" class="block px-3 py-2 text-base text-white font-semibold leading-7 -mx-3">
</NavLink>
<NavLink to="/notifications">
Notifications
</NuxtLink>
<NuxtLink to="/os" class="block px-3 py-2 text-base text-white font-semibold leading-7 -mx-3">
</NavLink>
<NavLink to="/os">
OS Informations
</NuxtLink>
<NuxtLink to="/foo" class="block px-3 py-2 text-base text-white font-semibold leading-7 -mx-3">
</NavLink>
<NavLink to="/foo">
404
</NuxtLink>
</NavLink>
</div>
<div class="py-6">
<p class="px-3 text-base text-white font-semibold leading-7 -mx-3">
<div py-6>
<p px-3 text-base text-white font-semibold leading-7 mx="-3">
v{{ tauriVersion }}
</p>
</div>

View File

@@ -1,9 +1,9 @@
<template>
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="flex items-center text-sm text-light-200 font-medium">
<div px-4 py-6 sm="grid grid-cols-3 gap-4 px-6">
<dt flex items-center text-sm text-light-200 font-medium>
{{ props.heading }}
</dt>
<dd class="flex items-center text-sm text-neutral-300 leading-6 sm:col-span-2 sm:mt-0">
<dd flex items-center text-sm text-neutral-300 leading-6 sm="col-span-2 mt-0">
{{ props.body }}
</dd>
</div>

View File

@@ -1,6 +1,8 @@
<template>
<div>
<SiteNavbar />
<SiteNavbar sticky />
<SiteSidebar />
<slot />
</div>
</template>

View File

@@ -1,6 +1,7 @@
<template>
<div>
<SiteNavbar sticky />
<SiteSidebar />
<div crate>
<slot />

View File

@@ -3,7 +3,7 @@
<SiteNavbar class="fixed w-full" />
<SiteSidebar />
<div relative isolate overflow-hidden px-6 lg="px-8">
<div relative overflow-hidden px-6 lg="px-8">
<DesignTopBlob />
<DesignBottomBlob />

View File

@@ -1,22 +1,22 @@
<template>
<main class="grid place-items-center px-6 py-24 lg:px-8 sm:py-32">
<div class="text-center">
<p class="text-base text-emerald-500 font-semibold">
<div grid place-items-center px-6 py-24 sm="py-32" lg="px-8">
<div text-center>
<p text-base text-emerald-500 font-semibold>
404
</p>
<h1 class="mt-4 text-3xl text-neutral-300 font-bold tracking-tight sm:text-5xl">
<h1 mt-4 text-3xl text-neutral-300 font-bold tracking-tight sm="text-5xl">
Page not found
</h1>
<p class="mt-6 text-base text-neutral-400 leading-7">
<p mt-6 text-base text-neutral-400 leading-7>
Sorry, we couldn't find the page you're looking for.
</p>
<div class="mt-10 flex items-center justify-center gap-x-6">
<Hyperlink to="/">
<div mt-10 flex items-center justify-center gap-x-6>
<Hyperlink to="/" px-7>
Back
</Hyperlink>
</div>
</div>
</main>
</div>
</template>
<script lang="ts" setup>

View File

@@ -4,23 +4,23 @@
description="Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application."
>
<form @submit.prevent="sendCommand()">
<div class="mx-auto max-w-xl lg:mr-0 lg:max-w-lg">
<div class="grid grid-cols-1 gap-x-8 gap-y-6">
<div mx-auto max-w-xl lg="mr-0 max-w-lg">
<div grid grid-cols-1 gap-x-8 gap-y-6>
<div>
<label for="command-input" class="block text-sm text-white font-semibold leading-6">Command input</label>
<div class="mt-2.5">
<input id="command-input" v-model="input" type="text" name="command-input" class="block w-full border-0 rounded-md bg-white/5 px-3.5 py-2 text-white shadow-sm ring-1 ring-white/10 ring-inset sm:text-sm sm:leading-6 focus:ring-2 focus:ring-emerald-500 focus:ring-inset">
<label for="command-input" block text-sm text-white font-semibold leading-6>Command input</label>
<div mt="2.5">
<input id="command-input" v-model="input" type="text" name="command-input" block w-full border-0 rounded-md bg="white/5" px="3.5" py-2 text-white shadow-sm ring-1 ring="white/10" ring-inset sm="text-sm leading-6" focus="ring-2 ring-emerald-500 ring-inset">
</div>
</div>
<div class="flex justify-end">
<div flex justify-end>
<Btn type="submit">
Send command
</Btn>
</div>
<div mt-8>
<label for="command-output" class="block text-sm text-white font-semibold leading-6">Command Output</label>
<div class="mt-2.5">
<textarea id="command-output" v-model="result" name="command-output" rows="10" class="block w-full border-0 rounded-md bg-white/5 px-3.5 py-2 text-white shadow-sm ring-1 ring-white/10 ring-inset sm:text-sm sm:leading-6 focus:ring-2 focus:ring-indigo-500 focus:ring-inset" />
<label for="command-output" block text-sm text-white font-semibold leading-6>Command Output</label>
<div mt="2.5">
<textarea id="command-output" v-model="result" name="command-output" rows="10" block w-full border-0 rounded-md bg="white/5" px="3.5" py-2 text-white shadow-sm ring-1 ring="white/10" ring-inset sm="text-sm leading-6" focus="ring-2 ring-emerald-500 ring-inset" />
</div>
</div>
</div>

View File

@@ -1,5 +1,5 @@
<template>
<div relative isolate overflow-hidden px-6 lg="px-8">
<div relative overflow-hidden px-6 lg="px-8">
<div grid mx-auto h-screen max-w-2xl place-content-center>
<SvgoLogo :filled="true" :font-controlled="false" mx-auto mb-8 size-40 />
@@ -23,11 +23,15 @@
</p>
<div mt-15>
<Hyperlink :to="repo">
Made by {{ author }}
Star on GitHub
</Hyperlink>
</div>
</div>
</div>
<div fixed text-sm bottom-6 absolute-center-h>
<p text-sm text-neutral-500>Made by {{ author }}</p>
</div>
</div>
</template>

View File

@@ -7,15 +7,15 @@
<div class="mx-auto max-w-xl lg:mr-0 lg:max-w-lg">
<div class="grid grid-cols-1 gap-x-8 gap-y-6">
<div>
<label for="notification-title" class="block text-sm text-white font-semibold leading-6">Notification title</label>
<div class="mt-2.5">
<input id="notification-title" v-model="notificationTitle" type="text" name="notification-title" class="block w-full border-0 rounded-md bg-white/5 px-3.5 py-2 text-white shadow-sm ring-1 ring-white/10 ring-inset sm:text-sm sm:leading-6 focus:ring-2 focus:ring-emerald-500 focus:ring-inset">
<label for="notification-title" block text-sm text-white font-semibold leading-6>Notification title</label>
<div mt="2.5">
<input id="notification-title" v-model="notificationTitle" type="text" name="notification-title" block w-full border-0 rounded-md bg="white/5" px="3.5" py-2 text-white shadow-sm ring-1 ring="white/10" ring-inset sm="text-sm leading-6" focus="ring-2 ring-emerald-500 ring-inset">
</div>
</div>
<div>
<label for="notification-body" class="block text-sm text-white font-semibold leading-6">Notification body</label>
<div class="mt-2.5">
<input id="notification-body" v-model="notificationBody" type="text" name="notification-body" class="block w-full border-0 rounded-md bg-white/5 px-3.5 py-2 text-white shadow-sm ring-1 ring-white/10 ring-inset sm:text-sm sm:leading-6 focus:ring-2 focus:ring-emerald-500 focus:ring-inset">
<label for="notification-body" block text-sm text-white font-semibold leading-6>Notification body</label>
<div mt="2.5">
<input id="notification-body" v-model="notificationBody" type="text" name="notification-body" block w-full border-0 rounded-md bg="white/5" px="3.5" py-2 text-white shadow-sm ring-1 ring="white/10" ring-inset sm="text-sm leading-6" focus="ring-2 ring-emerald-500 ring-inset">
</div>
</div>
@@ -25,7 +25,7 @@
</Btn>
</div>
<p v-if="permissionError" class="mt-3 text-right text-sm text-red-500 font-semibold leading-6">
<p v-if="permissionError" mt-3 text-right text-sm text-red-500 font-semibold leading-6>
Missing permissions
</p>
</div>

View File

@@ -3,8 +3,8 @@
title="OS Information"
description="Read information about the operating system using the OS Information plugin."
>
<div class="overflow-hidden bg-neutral-800 shadow sm:rounded-lg">
<dl class="divide-y divide-neutral-600">
<div overflow-hidden bg-neutral-800 shadow rounded-lg>
<dl divide-y divide-neutral-600>
<TabRow heading="Platform" :body="`${currentPlatform} ${currentVersion}`" />
<TabRow heading="Arch" :body="currentArch" />
<TabRow heading="Locale" :body="currentLocale" />

View File

@@ -13,7 +13,9 @@ import {
export default defineConfig({
shortcuts: [
["crate", "mx-auto max-w-7xl px-4 lg:px-8 sm:px-6"],
["flex-center", "flex justify-center items-center"]
["flex-center", "flex justify-center items-center"],
["absolute-center-h", "left-50% transform -translate-x-50%"],
["absolute-center-v", "top-50% transform -translate-y-50%"]
],
presets: [
presetUno(),