|
1 | 1 | import { useEffect, useState } from "react"
|
2 | 2 | import { motion } from "framer-motion"
|
3 |
| -import Img from "next/image" |
4 | 3 | import manifest from "@/data/manifest.json"
|
5 | 4 |
|
6 | 5 | const clamp = (min: number, num: number, max: number) =>
|
@@ -47,29 +46,30 @@ export const LogosMarquee = () => {
|
47 | 46 | {Object.entries(manifest.providersOAuth)
|
48 | 47 | .sort(() => Math.random() - 0.5)
|
49 | 48 | .filter((_, i) => i < logoCount!)
|
50 |
| - .map(([key, name]) => ( |
| 49 | + .map(([id, name]) => ( |
51 | 50 | <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" }} |
54 | 53 | transition={{
|
55 | 54 | delay: randomFloat(-10, 2),
|
56 |
| - duration: randomFloat(30, 40), |
| 55 | + duration: randomFloat(40, 70), |
57 | 56 | ease: "linear",
|
58 | 57 | repeat: Infinity,
|
59 | 58 | repeatType: "loop",
|
60 | 59 | }}
|
61 | 60 | style={{
|
62 |
| - offsetPath: "M43.25.25a43,43,0,1,1-43,43,43,43,0,0,1,43-43", |
63 | 61 | width: (scale ?? 60) * randomFloat(0.8, 1.2),
|
64 | 62 | }}
|
65 |
| - key={`company-${key}`} |
66 |
| - //initDeg={randomIntFromInterval(0, 360)} |
67 |
| - //direction={Math.random() > 0.5 ? "clockwise" : "counterclockwise"} |
68 |
| - //velocity={10} |
| 63 | + key={`company-${id}`} |
69 | 64 | >
|
70 | 65 | <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 | + }} |
73 | 73 | width={logoSize}
|
74 | 74 | height={logoSize}
|
75 | 75 | alt={`${name} logo`}
|
|
0 commit comments