Skip to content

Commit

Permalink
make hero image random
Browse files Browse the repository at this point in the history
  • Loading branch information
Highfire1 committed Dec 3, 2024
1 parent 776b094 commit b71f789
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/src/app/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import hero3 from '../../public/hero_images/langara3.png'
import hero4 from '../../public/hero_images/langara4.png'
import hero5 from '../../public/hero_images/langara5.png'

// otherwise next.js will cache the total route result and it will not be random
export const dynamic = 'force-dynamic';

export default function Hero() {
const images = [hero1, hero2, hero3, hero4, hero5]
const randomImage = images[Math.floor(Math.random() * 5)]
Expand Down

0 comments on commit b71f789

Please sign in to comment.