forked from HackDavis/hackdavis-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from HackDavis/feat/river-effects
Feat/river effects
- Loading branch information
Showing
9 changed files
with
87 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 27 additions & 2 deletions
29
app/(pages)/(index-page)/_components/RiverCow/RightTree.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
app/(pages)/(index-page)/_components/RiverCow/RiverCowAnimation.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@use 'app/(pages)/_globals/mixins'; | ||
|
||
.river_cow_container { | ||
width: 600px; | ||
margin-top: 5%; | ||
margin-right: -5%; | ||
|
||
@include mixins.phone { | ||
width: 300px; | ||
align-self: flex-start; | ||
} | ||
} | ||
|
||
.river_cow { | ||
width: 100%; | ||
height: auto; | ||
} |
37 changes: 37 additions & 0 deletions
37
app/(pages)/(index-page)/_components/RiverCow/RiverCowAnimation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { useState, useEffect } from 'react'; | ||
import Image from 'next/image'; | ||
|
||
import styles from './RiverCowAnimation.module.scss'; | ||
import riverCow from 'public/index/RiverCow/river-cow.png'; | ||
import riverCow2 from 'public/index/RiverCow/river-cow-2.png'; | ||
import riverCow3 from 'public/index/RiverCow/river-cow-3.png'; | ||
|
||
const cowFrames = [riverCow, riverCow2, riverCow3]; | ||
|
||
export default function RiverCowAnimation() { | ||
const [cowIndex, setCowIndex] = useState(0); | ||
|
||
const handleNextFrame = () => { | ||
setCowIndex((prev) => (prev + 1) % cowFrames.length); | ||
}; | ||
|
||
useEffect(() => { | ||
const interval = setInterval(() => { | ||
handleNextFrame(); | ||
}, 2000); | ||
|
||
return () => clearInterval(interval); | ||
}, []); | ||
|
||
return ( | ||
<div className={styles.river_cow_container}> | ||
<Image | ||
src={cowFrames[cowIndex]} | ||
alt="Cow sitting on rock reminiscing on past adventures by looking at polaroids." | ||
placeholder="blur" | ||
className={styles.river_cow} | ||
sizes="(min-width: 780px) 600px, 300px" | ||
/> | ||
</div> | ||
); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.