mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
Revert "Make the carousel swing!"
This reverts commit e2afdc242e69c97bc85861b999166094246ab830.
This commit is contained in:
parent
7277be6a82
commit
246b2de0a2
1 changed files with 10 additions and 10 deletions
|
|
@ -21,7 +21,7 @@ import Footer from '../components/footer'
|
|||
import { keyframes } from '@emotion/react'
|
||||
import { thousands } from '../lib/members'
|
||||
import StaticMention from '../components/mention'
|
||||
import { useEffect, useState, useRef } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
const ShipBadge = props => (
|
||||
<Badge
|
||||
|
|
@ -47,17 +47,17 @@ const waves = keyframes({
|
|||
|
||||
const ShipPage = ({ projects = [] }) => {
|
||||
|
||||
const projectIndexRef = useRef(0);
|
||||
const [project, setProject] = useState(projects[projectIndexRef.current]);
|
||||
|
||||
const [projectIndex, setProjectIndex] = useState(0)
|
||||
|
||||
useEffect(() => {
|
||||
const intervalId = setInterval(() => {
|
||||
const nextProjectIndex = (projectIndexRef.current + 1) % 2;
|
||||
projectIndexRef.current = nextProjectIndex;
|
||||
setProject(projects[projectIndexRef.current])
|
||||
}, 2 * 1000); // rapidly change while developing to see new things
|
||||
return () => clearInterval(intervalId);
|
||||
}, []);
|
||||
const nextProjectIndex = (projectIndex + 1) % 2
|
||||
setProjectIndex(nextProjectIndex)
|
||||
}, 2 * 1000) // rapidly change while developing to see new things
|
||||
return () => clearInterval(intervalId)
|
||||
}, [])
|
||||
|
||||
const project = projects[projectIndex]
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue