Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Refactor Webflow guide and enhance marquee animations for improved performance

Bill Yang3b7471fedfea
diff --git a/docs/content/docs/guides/webflow.mdx b/docs/content/docs/guides/webflow.mdx
index a4438e2de..ce5ba1df7 100644
--- a/docs/content/docs/guides/webflow.mdx
+++ b/docs/content/docs/guides/webflow.mdx
@@ -6,8 +6,6 @@ description: "Enable analytics, custom events, and more on your Webflow site wit
import { Step, Steps } from "fumadocs-ui/components/steps";
import { Callout } from "fumadocs-ui/components/callout";
-# Webflow
-
Rybbit enables you to collect analytics, capture custom events, and more on your Webflow site.
## How to Add Rybbit to Webflow
diff --git a/docs/src/app/(home)/page.tsx b/docs/src/app/(home)/page.tsx
index dca4a677a..5abf33bb7 100644
--- a/docs/src/app/(home)/page.tsx
+++ b/docs/src/app/(home)/page.tsx
@@ -469,7 +469,7 @@ export default function HomePage() {
</Marquee>
{/* Column 2 - hidden on mobile */}
- <Marquee vertical pauseOnHover reverse className="hidden md:flex [--duration:45s]" repeat={2}>
+ <Marquee vertical pauseOnHover reverse className="hidden md:flex [--duration:60s]" repeat={2}>
<TweetCard id="1920899082253434950" />
<TweetCard id="2000788904778326334" />
<TweetCard id="2015102995789381815" />
diff --git a/docs/src/app/global.css b/docs/src/app/global.css
index 48aa48504..bc995c91d 100644
--- a/docs/src/app/global.css
+++ b/docs/src/app/global.css
@@ -42,32 +42,28 @@ pre {
}
}
-@keyframes marquee {
- from {
- transform: translateX(0);
- }
- to {
- transform: translateX(calc(-100% - var(--gap)));
- }
-}
-
-@keyframes marquee-vertical {
- from {
- transform: translateY(0);
+@theme inline {
+ --animate-marquee: marquee var(--duration) infinite linear;
+ --animate-marquee-vertical: marquee-vertical var(--duration) linear infinite;
+
+ @keyframes marquee {
+ from {
+ transform: translateX(0);
+ }
+ to {
+ transform: translateX(calc(-100% - var(--gap)));
+ }
}
- to {
- transform: translateY(calc(-100% - var(--gap)));
+ @keyframes marquee-vertical {
+ from {
+ transform: translateY(0);
+ }
+ to {
+ transform: translateY(calc(-100% - var(--gap)));
+ }
}
}
-.animate-marquee {
- animation: marquee var(--duration) linear infinite;
-}
-
-.animate-marquee-vertical {
- animation: marquee-vertical var(--duration) linear infinite;
-}
-
/* Override prose list styles for tool pages */
.prose ul li.flex,
.prose ol li.flex {
diff --git a/docs/src/components/magicui/marquee.tsx b/docs/src/components/magicui/marquee.tsx
index 627550a82..b04836ec7 100644
--- a/docs/src/components/magicui/marquee.tsx
+++ b/docs/src/components/magicui/marquee.tsx
@@ -1,35 +1,36 @@
-import { cn } from "@/lib/utils";
-import { ComponentPropsWithoutRef } from "react";
+import { ComponentPropsWithoutRef } from "react"
+
+import { cn } from "@/lib/utils"
interface MarqueeProps extends ComponentPropsWithoutRef<"div"> {
/**
* Optional CSS class name to apply custom styles
*/
- className?: string;
+ className?: string
/**
* Whether to reverse the animation direction
* @default false
*/
- reverse?: boolean;
+ reverse?: boolean
/**
* Whether to pause the animation on hover
* @default false
*/
- pauseOnHover?: boolean;
+ pauseOnHover?: boolean
/**
* Content to be displayed in the marquee
*/
- children: React.ReactNode;
+ children: React.ReactNode
/**
* Whether to animate vertically instead of horizontally
* @default false
*/
- vertical?: boolean;
+ vertical?: boolean
/**
* Number of times to repeat the content
* @default 4
*/
- repeat?: number;
+ repeat?: number
}
export function Marquee({
@@ -44,7 +45,14 @@ export function Marquee({
return (
<div
{...props}
- className={cn("group flex overflow-hidden p-2 [--duration:40s] [--gap:1rem] [gap:var(--gap)]", { "flex-row": !vertical, "flex-col": vertical }, className)}
+ className={cn(
+ "group flex [gap:var(--gap)] overflow-hidden p-2 [--duration:40s] [--gap:1rem]",
+ {
+ "flex-row": !vertical,
+ "flex-col": vertical,
+ },
+ className
+ )}
>
{Array(repeat)
.fill(0)
@@ -53,15 +61,14 @@ export function Marquee({
key={i}
className={cn("flex shrink-0 justify-around [gap:var(--gap)]", {
"animate-marquee flex-row": !vertical,
- "animate-marquee-vertical flex-col": vertical && !reverse,
- "animate-marquee-vertical-reverse flex-col": vertical && reverse,
+ "animate-marquee-vertical flex-col": vertical,
"group-hover:[animation-play-state:paused]": pauseOnHover,
- "[animation-direction:reverse]": reverse && !vertical,
+ "[animation-direction:reverse]": reverse,
})}
>
{children}
</div>
))}
</div>
- );
-}
\ No newline at end of file
+ )
+}