this repo has no description

use css3 based marquee because the element causes mad cpu usage

Joe a0a81156 5f2816b1

+38 -17
+5 -1
astro.config.mjs
··· 4 4 5 5 // https://astro.build/config 6 6 export default defineConfig({ 7 - integrations: [UnoCSS()], 7 + integrations: [ 8 + UnoCSS({ 9 + injectReset: "@unocss/reset/tailwind-compat.css", 10 + }), 11 + ], 8 12 });
+20
src/components/Marquee.astro
··· 1 + <style> 2 + @keyframes marquee { 3 + from { 4 + transform: translate(0%); 5 + } 6 + 7 + to { 8 + transform: translate(-100%); 9 + } 10 + } 11 + </style> 12 + <marquee-container class=":uno: flex whitespace-nowrap overflow-hidden gap-15"> 13 + { 14 + [0, 1].map((item) => ( 15 + <marquee-item class="animate-[marquee_10s_linear_infinite]"> 16 + <slot /> 17 + </marquee-item> 18 + )) 19 + } 20 + </marquee-container>
-1
src/layouts/Layout.astro
··· 1 1 --- 2 - import "@unocss/reset/tailwind-compat.css"; 3 2 import { getImage } from "astro:assets"; 4 3 import backgroundImg from "../assets/draconium.png"; 5 4 const background = await getImage({ src: backgroundImg });
+11 -13
src/pages/index.astro
··· 1 1 --- 2 2 import Layout from "../layouts/Layout.astro"; 3 + import Marquee from "../components/Marquee.astro"; 3 4 --- 4 5 5 6 <Layout> 6 - <marquee 7 - behavior="scroll" 8 - scrolldelay="50" 9 - scrollamount="10" 10 - truespeed 11 - class="text-[5rem] font-mmd" 12 - >Your local <span 13 - class="bg-gradient-to-r from-green-300 via-blue-500 to-purple-600 bg-clip-text text-transparent" 14 - >gay</span 15 - > Dragon</marquee 16 - > 7 + <Marquee> 8 + <span class="text-[5rem] font-mmd text-nowrap"> 9 + Your local <span 10 + class=":uno: bg-gradient-to-r from-green-300 via-blue-500 to-purple-600 bg-clip-text text-transparent" 11 + >gay</span 12 + > Dragon 13 + </span> 14 + </Marquee> 17 15 <article class="p-2"> 18 16 this is a lil landing page for drac, who is gay. you might know me by a 19 17 few other names. ··· 35 33 <li> 36 34 <a 37 35 href="https://cozydsp.space" 38 - class="hover:underline text-cyan" 39 - >VST plugins by cozy dsp</a> 36 + class="hover:underline text-cyan">VST plugins by cozy dsp</a 37 + > 40 38 </li> 41 39 </ul> 42 40 </article>
+2 -2
uno.config.ts
··· 1 - import { defineConfig } from "unocss"; 1 + import { defineConfig, transformerCompileClass } from "unocss"; 2 2 import { presetUno, presetWebFonts, transformerVariantGroup } from "unocss"; 3 3 4 4 export default defineConfig({ ··· 13 13 }, 14 14 }), 15 15 ], 16 - transformers: [transformerVariantGroup()], 16 + transformers: [transformerVariantGroup(), transformerCompileClass()], 17 17 });