mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 11:12:54 +02:00

- Implement underline-animation UnoCSS shortcut for navbar links - Add dynamic hover and page transition effects for navigation - Update Navbar component to use new underline-animation class - Remove CDN configuration from preload settings - Modify font class for date display in index page - Add inline script to handle link animations during page transitions
64 lines
1.7 KiB
TypeScript
64 lines
1.7 KiB
TypeScript
import type { Theme } from 'unocss/preset-uno'
|
|
import {
|
|
defineConfig,
|
|
presetAttributify,
|
|
presetTypography,
|
|
presetUno,
|
|
transformerDirectives,
|
|
transformerVariantGroup,
|
|
} from 'unocss'
|
|
import presetTheme from 'unocss-preset-theme'
|
|
import { themeConfig } from './src/config'
|
|
|
|
const { light, dark } = themeConfig.color
|
|
|
|
export default defineConfig({
|
|
presets: [
|
|
presetUno(),
|
|
presetAttributify(),
|
|
presetTypography(),
|
|
presetTheme<Theme>({
|
|
theme: {
|
|
dark: {
|
|
colors: dark,
|
|
},
|
|
},
|
|
}),
|
|
],
|
|
theme: {
|
|
colors: light,
|
|
fontFamily: {
|
|
title: ['Snell-Black', 'EarlySummer-subset', 'EarlySummer', 'ui-serif', 'Georgia', 'Cambria', 'Times New Roman', 'Times', 'serif'],
|
|
navbar: ['STIX-italic', 'EarlySummer-subset', 'EarlySummer', 'ui-serif', 'Georgia', 'Cambria', 'Times New Roman', 'Times', 'serif'],
|
|
time: ['Snell-Bold', 'ui-serif', 'Georgia', 'Cambria', 'Times New Roman', 'Times', 'serif'],
|
|
serif: ['STIX', 'EarlySummer', 'Georgia', 'ui-serif', 'Georgia', 'Cambria', 'Times New Roman', 'Times', 'serif'],
|
|
},
|
|
},
|
|
shortcuts: {
|
|
'underline-animation': [
|
|
'relative',
|
|
'after:content-empty',
|
|
'after:absolute',
|
|
'after:left-0',
|
|
'after:bottom--1',
|
|
'after:w-full',
|
|
'after:h-0.4',
|
|
'after:bg-secondary',
|
|
'after:scale-x-0',
|
|
'after:origin-right',
|
|
'after:transition-transform',
|
|
'after:duration-300',
|
|
'after:ease-out',
|
|
'hover:after:scale-x-100',
|
|
'hover:after:origin-left',
|
|
'transition-ready',
|
|
'[&.force-leave]:after:scale-x-0',
|
|
'[&.force-leave]:after:origin-right',
|
|
],
|
|
},
|
|
rules: [],
|
|
transformers: [
|
|
transformerDirectives(),
|
|
transformerVariantGroup(),
|
|
],
|
|
})
|