Navigation Menu

Skip to content

Commit

Permalink
user override
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Byrne committed Jul 24, 2020
1 parent 1beecb5 commit ac25ab6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 4 additions & 6 deletions components/styles/home.module.scss
Expand Up @@ -148,7 +148,7 @@
}
}

@keyframes heroTitleSpinOutSideways {
@keyframes heroTitleSpinSideways {
0% {
transform: translate3d(-50%, -50%, 0) rotateY(0deg);
}
Expand Down Expand Up @@ -196,11 +196,9 @@
}
}

.heroTitleFrameworkHide {
margin: 0 0.25em;
span {
animation: heroTitleSpinOutSideways 1 800ms 400ms ease-in both;
}
.heroTitleAnimateSideways {
animation: heroTitleSpinSideways 1 500ms cubic-bezier(0.905, 0.005, 1, 0.51)
both;
}

.heroTitleAnimate {
Expand Down
8 changes: 6 additions & 2 deletions pages/index.tsx
Expand Up @@ -123,6 +123,8 @@ const HomePage = (props: any) => {
const [userOverride, setUserOverride] = React.useState(false)

const randomizeLibraries = () => {
if (userOverride) return

const randomData = randElem(
libraries.filter(library => {
return library.type === 'data'
Expand Down Expand Up @@ -171,10 +173,9 @@ const HomePage = (props: any) => {
}

React.useEffect(() => {
if (userOverride) return
const intervalTime = 5000
const interval = setInterval(() => {
if (userOverride) return
console.log(userOverride)
randomizeLibraries()
}, intervalTime)
return () => clearInterval(interval)
Expand Down Expand Up @@ -433,6 +434,9 @@ const Framework = ({ activeLibraries }) => {
React.useEffect(() => {
if (
!frameworkSpanRef.current ||
!activeLibraries.filter(library => {
return library.type === 'framework'
})[0] ||
activeLibraries.filter(library => {
return library.type === 'framework'
})[0] === activeLibrary
Expand Down

0 comments on commit ac25ab6

Please sign in to comment.