Skip to content

Commit

Permalink
🚀 add random images for browse
Browse files Browse the repository at this point in the history
  • Loading branch information
chase-manning committed Jul 15, 2023
1 parent 3415101 commit 2a43550
Show file tree
Hide file tree
Showing 60 changed files with 7 additions and 17 deletions.
Binary file added public/assets/browse/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/12.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/13.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/14.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/15.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/16.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/17.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/18.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/19.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/21.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/22.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/23.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/24.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/26.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/27.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/28.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/29.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/30.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/31.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/32.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/browse/33.jpg
Binary file added public/assets/browse/34.jpg
Binary file added public/assets/browse/35.jpg
Binary file added public/assets/browse/36.jpg
Binary file added public/assets/browse/37.jpg
Binary file added public/assets/browse/38.jpg
Binary file added public/assets/browse/39.jpg
Binary file added public/assets/browse/4.jpg
Binary file added public/assets/browse/40.jpg
Binary file added public/assets/browse/41.jpg
Binary file added public/assets/browse/42.jpg
Binary file added public/assets/browse/43.jpg
Binary file added public/assets/browse/44.jpg
Binary file added public/assets/browse/45.jpg
Binary file added public/assets/browse/46.jpg
Binary file added public/assets/browse/47.jpg
Binary file added public/assets/browse/48.jpg
Binary file added public/assets/browse/49.jpg
Binary file added public/assets/browse/5.jpg
Binary file added public/assets/browse/50.jpg
Binary file added public/assets/browse/51.jpg
Binary file added public/assets/browse/52.png
Binary file added public/assets/browse/6.jpg
Binary file added public/assets/browse/7.jpg
Binary file added public/assets/browse/8.jpg
Binary file added public/assets/browse/9.jpg
Binary file removed src/assets/browse/1.png
Diff not rendered.
Binary file removed src/assets/browse/2.png
Diff not rendered.
Binary file removed src/assets/browse/3.png
Diff not rendered.
Binary file removed src/assets/browse/4.png
Diff not rendered.
Binary file removed src/assets/browse/5.png
Diff not rendered.
Binary file removed src/assets/browse/6.png
Diff not rendered.
Binary file removed src/assets/browse/7.png
Diff not rendered.
Binary file removed src/assets/browse/8.png
Diff not rendered.
24 changes: 7 additions & 17 deletions src/components/Browse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ import Section from "./Section";
import useFixedStyles from "../hooks/use-scroll-data";
import Button from "./Button";

import uwu1 from "../assets/browse/1.png";
import uwu2 from "../assets/browse/2.png";
import uwu3 from "../assets/browse/3.png";
import uwu4 from "../assets/browse/4.png";
import uwu5 from "../assets/browse/5.png";
import uwu6 from "../assets/browse/6.png";
import uwu7 from "../assets/browse/7.png";
const UWU_OPTIONS = 51;
const OFFSET = Math.round(Math.random() * UWU_OPTIONS);

interface UwuType {
src: string;
width: number; // Percentage of screen width
speed: number; // Percentage of scroll speed
left: number; // Percentage of screen width
Expand All @@ -22,49 +16,42 @@ interface UwuType {

const uwus: UwuType[] = [
{
src: uwu2,
width: 25,
speed: 0.35,
left: -5,
top: 130,
},
{
src: uwu1,
width: 25,
speed: 0.35,
left: 3,
top: -5,
},
{
src: uwu6,
width: 15,
speed: 0.6,
left: 25,
top: 110,
},
{
src: uwu3,
width: 18,
speed: 0.2,
left: 50,
top: 40,
},
{
src: uwu4,
width: 20,
speed: 0.35,
left: 78,
top: 60,
},
{
src: uwu5,
width: 10,
speed: 0.7,
left: 75,
top: 15,
},
{
src: uwu7,
width: 15,
speed: 0.6,
left: 75,
Expand All @@ -88,7 +75,7 @@ const Browse = () => {
{
// Render uwus
uwus.map((uwu, index) => {
const { src, width, speed, left, top } = uwu;
const { width, speed, left, top } = uwu;
const zIndex = speed > 0.5 ? 3 : 1;
const windowHeight = containerRef.current?.clientHeight || 0;
const translateY = percentScrolled * speed * windowHeight;
Expand All @@ -99,11 +86,14 @@ const Browse = () => {
transform: `translateY(${-translateY}px)`,
zIndex,
};
const image = `/assets/browse/${
((index + OFFSET) % UWU_OPTIONS) + 1
}.jpg`;
return (
<img
key={index}
className="browse-image"
src={src}
src={image}
alt="uwu"
style={style}
/>
Expand Down

0 comments on commit 2a43550

Please sign in to comment.