Skip to content

Commit 90d3376

Browse files
committed
chore(docs): cleanup marquee and add orbit animation
1 parent 417a4e6 commit 90d3376

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

docs/components/LogosMarquee/index.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useEffect, useState } from "react"
22
import { motion } from "framer-motion"
3-
import Img from "next/image"
43
import manifest from "@/data/manifest.json"
54

65
const clamp = (min: number, num: number, max: number) =>
@@ -47,29 +46,30 @@ export const LogosMarquee = () => {
4746
{Object.entries(manifest.providersOAuth)
4847
.sort(() => Math.random() - 0.5)
4948
.filter((_, i) => i < logoCount!)
50-
.map(([key, name]) => (
49+
.map(([id, name]) => (
5150
<motion.div
52-
initial={{x: `${randomFloat(-20, 10)}%`, offsetDistance: "0%" }}
53-
animate={{ x: "100vw", offsetDistance: "100%" }}
51+
initial={{ x: `${randomFloat(-10, 80)}vw` }}
52+
animate={{ x: "100vw" }}
5453
transition={{
5554
delay: randomFloat(-10, 2),
56-
duration: randomFloat(30, 40),
55+
duration: randomFloat(40, 70),
5756
ease: "linear",
5857
repeat: Infinity,
5958
repeatType: "loop",
6059
}}
6160
style={{
62-
offsetPath: "M43.25.25a43,43,0,1,1-43,43,43,43,0,0,1,43-43",
6361
width: (scale ?? 60) * randomFloat(0.8, 1.2),
6462
}}
65-
key={`company-${key}`}
66-
//initDeg={randomIntFromInterval(0, 360)}
67-
//direction={Math.random() > 0.5 ? "clockwise" : "counterclockwise"}
68-
//velocity={10}
63+
key={`company-${id}`}
6964
>
7065
<motion.img
71-
src={`/img/providers/${key}.svg`}
72-
className="opacity-40 grayscale dark:invert"
66+
src={`/img/providers/${id}.svg`}
67+
className="opacity-40 animate-orbit grayscale dark:invert"
68+
style={{
69+
// @ts-expect-error
70+
"--duration": randomFloat(20, 30),
71+
"--radius": randomFloat(10, 20),
72+
}}
7373
width={logoSize}
7474
height={logoSize}
7575
alt={`${name} logo`}

docs/tailwind.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ module.exports = {
1010
extend: {
1111
animation: {
1212
blob: "blob 12s infinite",
13+
orbit: "orbit calc(var(--duration)*1s) linear infinite",
1314
},
1415
keyframes: {
16+
orbit: {
17+
"0%": {
18+
transform: "rotate(0deg) translateY(calc(var(--radius) * 1px)) rotate(0deg)",
19+
},
20+
"100%": {
21+
transform: "rotate(360deg) translateY(calc(var(--radius) * 1px)) rotate(-360deg)",
22+
},
23+
},
1524
blob: {
1625
"0%": {
1726
transform: "translate(0px, 0px) scale(1)",

0 commit comments

Comments
 (0)