bump, improve/update now playing component to use listenbrainz, update deploy link, update env variables in readme

This commit is contained in:
Aidan 2025-02-17 18:02:30 -05:00
parent ffe9419db1
commit b6b99d26f4
6 changed files with 340 additions and 67 deletions

View file

@ -0,0 +1,47 @@
"use client"
import type React from "react"
import { useEffect, useRef, useState } from "react"
interface ScrollTxtProps {
text: string
className?: string
}
const ScrollTxt: React.FC<ScrollTxtProps> = ({ text, className = "" }) => {
const containerRef = useRef<HTMLDivElement>(null)
const textRef = useRef<HTMLDivElement>(null)
const [shouldScroll, setShouldScroll] = useState(false)
useEffect(() => {
if (containerRef.current && textRef.current) {
const containerWidth = containerRef.current.offsetWidth
const textWidth = textRef.current.offsetWidth
setShouldScroll(textWidth > containerWidth)
}
}, []) // Updated dependency array
return (
<div ref={containerRef} className={`overflow-hidden ${className}`}>
<div
ref={textRef}
className={`whitespace-nowrap inline-block ${shouldScroll ? "animate-marquee hover:pause" : ""}`}
>
{shouldScroll ? (
<>
<span>{text}</span>
<span className="mx-4">&bull;</span>
<span>{text}</span>
<span className="mx-4">&bull;</span>
<span>{text}</span>
</>
) : (
text
)}
</div>
</div>
)
}
export default ScrollTxt