2024-01-15 12:33:15 +00:00
|
|
|
'use client'
|
|
|
|
|
2024-02-29 16:28:45 +00:00
|
|
|
import { useRef } from 'react'
|
2024-01-15 12:33:15 +00:00
|
|
|
|
|
|
|
export default function FancyBox() {
|
|
|
|
const rContainer = useRef<HTMLDivElement>(null)
|
2024-02-29 16:28:45 +00:00
|
|
|
// const [items, setItems] = useState<number[]>([])
|
2024-01-15 12:33:15 +00:00
|
|
|
|
2024-02-29 16:28:45 +00:00
|
|
|
// useEffect(() => {
|
|
|
|
// const populate = debounce(() => {
|
|
|
|
// const elm = rContainer.current
|
|
|
|
// if (!elm) return
|
2024-01-15 12:33:15 +00:00
|
|
|
|
2024-02-29 16:28:45 +00:00
|
|
|
// const width = elm.clientWidth
|
|
|
|
// const height = elm.clientHeight
|
2024-01-15 12:33:15 +00:00
|
|
|
|
2024-02-29 16:28:45 +00:00
|
|
|
// const SIZE = 32
|
2024-01-15 12:33:15 +00:00
|
|
|
|
2024-02-29 16:28:45 +00:00
|
|
|
// const cols = Math.ceil(width / SIZE)
|
|
|
|
// const rows = Math.ceil(height / SIZE)
|
2024-01-15 12:33:15 +00:00
|
|
|
|
2024-02-29 16:28:45 +00:00
|
|
|
// const items = Array.from(Array(cols * rows)).map((_, i) => i)
|
2024-01-15 12:33:15 +00:00
|
|
|
|
2024-02-29 16:28:45 +00:00
|
|
|
// setItems(items)
|
|
|
|
// }, 100)
|
2024-01-15 12:33:15 +00:00
|
|
|
|
2024-02-29 16:28:45 +00:00
|
|
|
// populate()
|
2024-01-15 12:33:15 +00:00
|
|
|
|
2024-02-29 16:28:45 +00:00
|
|
|
// window.addEventListener('resize', populate)
|
|
|
|
// return () => {
|
|
|
|
// window.removeEventListener('resize', populate)
|
|
|
|
// }
|
|
|
|
// }, [])
|
2024-01-15 12:33:15 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="footer__fancybox" ref={rContainer}>
|
2024-02-29 16:28:45 +00:00
|
|
|
{/* {items.map((i) => {
|
2024-01-15 12:33:15 +00:00
|
|
|
const c = 1 + (i % 7)
|
|
|
|
return <div key={i} className="footer__fancybox__item" data-c={c} />
|
2024-02-29 16:28:45 +00:00
|
|
|
})} */}
|
2024-01-15 12:33:15 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|