|
1 | 1 | import { useState, useEffect, useRef } from 'react'; |
2 | 2 | import './Reveal.css'; |
3 | | -import { useNavigate } from 'react-router-dom'; |
| 3 | +import SocialMedia from './SocialMedia'; |
| 4 | +import './Game.css'; |
| 5 | +// import { useNavigate } from 'react-router-dom'; |
4 | 6 |
|
5 | 7 | const easeInOutQuad = (t) => { |
6 | 8 | return t * t * (3. - 2. * t); |
7 | 9 | }; |
8 | 10 |
|
9 | 11 | export default function Reveal() { |
| 12 | + const scrollRef = useRef(null); // Create a ref for the element |
| 13 | + const [scrollPosition, setScrollPosition] = useState(0); |
| 14 | + |
| 15 | + useEffect(() => { |
| 16 | + const handleScroll = () => { |
| 17 | + if (scrollRef.current) { |
| 18 | + setScrollPosition(scrollRef.current.scrollTop); // Update scroll position |
| 19 | + } |
| 20 | + }; |
| 21 | + |
| 22 | + const element = scrollRef.current; |
| 23 | + if (element) { |
| 24 | + element.addEventListener('scroll', handleScroll); // Listen for scroll events |
| 25 | + } |
| 26 | + |
| 27 | + return () => { |
| 28 | + if (element) { |
| 29 | + element.removeEventListener('scroll', handleScroll); // Cleanup the event listener |
| 30 | + } |
| 31 | + }; |
| 32 | + }, []); |
| 33 | + |
10 | 34 | const [mousePos, setMousePos] = useState({ x: 0, y: 0 }); |
11 | 35 | const [circleSize, setCircleSize] = useState(200.0); // Starting circle size |
12 | 36 | // eslint-disable-next-line no-unused-vars |
13 | 37 | const [circleT, setCircleT] = useState(0.0); // Starting circle size |
14 | 38 | const animationRef = useRef(null); |
15 | 39 |
|
16 | | - const navigate = useNavigate(); |
| 40 | + // const navigate = useNavigate(); |
| 41 | + const [playing, setPlaying] = useState(false); |
17 | 42 | const handlePlay = () => { |
18 | | - navigate('/bleached/play/'); |
| 43 | + setPlaying(true) |
19 | 44 | }; |
20 | 45 |
|
21 | 46 | useEffect(() => { |
22 | 47 | const handleMouseMove = (e) => { |
23 | | - setMousePos({ x: e.clientX, y: e.clientY }); |
| 48 | + setMousePos({ x: e.clientX, y: scrollRef.current.scrollTop + e.clientY }); |
24 | 49 | }; |
25 | 50 |
|
26 | 51 | // Add event listener for mouse move globally (on the document) |
@@ -52,25 +77,218 @@ export default function Reveal() { |
52 | 77 | }, []); |
53 | 78 |
|
54 | 79 | return ( |
55 | | - <div |
| 80 | + <div className='layers' ref={scrollRef} |
56 | 81 | style={{ |
57 | 82 | '--mouse-x': `${mousePos.x}px`, |
58 | 83 | '--mouse-y': `${mousePos.y}px`, |
59 | 84 | '--circle-size': `${circleSize}px`, // Use animated circle size here |
60 | 85 | }} |
61 | 86 | > |
62 | | - {/* Hidden Layer (Red) */} |
| 87 | + |
| 88 | + <div className='layers2'> |
| 89 | + |
63 | 90 | <div className="hidden-layer"> |
64 | | - <h1>Hidden</h1> |
65 | | - <div>Hidden</div> |
| 91 | + <> |
| 92 | + <div className="game-container"> |
| 93 | + <div className="game-container2"> |
| 94 | + <h1 className="game-title"> |
| 95 | + Bleached |
| 96 | + </h1> |
| 97 | + <h3>A point-and-click story about life and color.</h3> |
| 98 | + |
| 99 | + <div style={{ height: '15px' }}></div> |
| 100 | + |
| 101 | + {!playing && ( |
| 102 | + <> |
66 | 103 | <button onClick={handlePlay}>Play the demo</button> |
| 104 | + <div style={{ height: '15px' }}></div></> |
| 105 | + ) |
| 106 | + } |
| 107 | + {playing && ( |
| 108 | + <div style={{ height: '740px' }}> |
| 109 | + </div> |
| 110 | + )} |
| 111 | + {/* {playing && ( |
| 112 | + <div> |
| 113 | + <div style={{ width: '1280px', height: '740px', border: 'none' }}> |
| 114 | + <iframe |
| 115 | + frameBorder="0" |
| 116 | + src="https://itch.io/embed-upload/12820034?color=ffe7d6" |
| 117 | + allowFullScreen |
| 118 | + width="1280" |
| 119 | + height="740" |
| 120 | + > |
| 121 | + <a href="https://thomas-bringer.itch.io/bleached">Play Bleached on itch.io</a> |
| 122 | + </iframe> |
| 123 | + </div> |
| 124 | + </div> |
| 125 | + )} */} |
| 126 | + |
| 127 | + <SocialMedia></SocialMedia> |
| 128 | + |
| 129 | + {/* <h3>Bleached is a point-and-click interactive story about life and color.</h3> |
| 130 | + <h3>When every day looks the same, tints slowly fade.</h3> |
| 131 | + <h3>One day, your canvas is empty. Can you paint something new?</h3> */} |
| 132 | + |
| 133 | + {/* <div style={{ height: '25px'}}></div> */} |
| 134 | + |
| 135 | + <div className='gif-container'> |
| 136 | + <div className='gif-text-container' style = {{textAlign: 'right'}}> |
| 137 | + <h3 className='gif-title'>Recolor the world around you.</h3> |
| 138 | + <div className='gif-text'>Your environment is turning white... and painting new shades isn't so simple. With time, perhaps new strokes can bring new perspectives.</div> |
| 139 | + </div> |
| 140 | + <div style={{ width: '50px'}}></div> |
| 141 | + <img className='gif' src='https://thomasbringer.github.io/bleached/gifs/home.gif' /> |
| 142 | + </div> |
| 143 | + |
| 144 | + <div style={{ height: '35px'}}></div> |
| 145 | + |
| 146 | + <div className='gif-container'> |
| 147 | + <img className='gif' src='https://thomasbringer.github.io/bleached/gifs/subway.gif' /> |
| 148 | + <div style={{ width: '50px'}}></div> |
| 149 | + <div className='gif-text-container' style = {{textAlign: 'left'}}> |
| 150 | + <h3 className='gif-title'>Point and click on anything.</h3> |
| 151 | + <div className='gif-text'>Walk around, talk to friends and colleagues, take care of pets, play minigames. Everything in the scenery is interactive.</div> |
| 152 | + </div> |
| 153 | + </div> |
| 154 | + |
| 155 | + <div className='gif-container'> |
| 156 | + <div className='gif-text-container' style = {{textAlign: 'right'}}> |
| 157 | + <h3 className='gif-title'>Wake up. Work. Sleep. Repeat.</h3> |
| 158 | + <div className='gif-text'>Each day is the exact same picture, except that your relationships—with yourself and others—evolve.</div> |
| 159 | + </div> |
| 160 | + <div style={{ width: '50px'}}></div> |
| 161 | + <img className='gif' src='https://thomasbringer.github.io/bleached/gifs/work.gif' /> |
| 162 | + </div> |
| 163 | + |
| 164 | + <div style={{ height: '25px'}}></div> |
| 165 | + <h2>Watch the Teaser Trailer for Bleached</h2> |
| 166 | + <div style={{ height: '10px'}}></div> |
| 167 | + |
| 168 | + <iframe |
| 169 | + width="960" |
| 170 | + height="540" |
| 171 | + src={`https://www.youtube.com/embed/nqyUEa46Dhs`} |
| 172 | + title="Bleached Teaser Trailer" |
| 173 | + frameBorder="0" |
| 174 | + allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" |
| 175 | + allowFullScreen |
| 176 | + ></iframe> |
| 177 | + |
| 178 | + <div style={{ height: '25px'}}></div> |
| 179 | + <h2>Play Bleached on itch.io</h2> |
| 180 | + <iframe |
| 181 | + frameBorder="0" |
| 182 | + src="https://itch.io/embed/3328660?border_width=0&bg_color=ffe7d6&fg_color=73464c&link_color=ab5675&border_color=ffe7d6" |
| 183 | + width="550" |
| 184 | + height="165" |
| 185 | + > |
| 186 | + <a href="https://thomas-bringer.itch.io/bleached">Bleached by Thomas Bringer</a> |
| 187 | + </iframe> |
| 188 | + |
| 189 | + </div></div> |
| 190 | + </> |
67 | 191 | </div> |
68 | 192 |
|
69 | | - {/* Visible Layer (Blue with Mask) */} |
70 | 193 | <div className="visible-layer"> |
71 | | - <h1>Visible</h1> |
72 | | - <div>Visible</div> |
73 | | - <button>Play the demo</button> |
| 194 | + <> |
| 195 | + <div className="game-container"> |
| 196 | + <div className="game-container2"> |
| 197 | + <h1 className="game-title"> |
| 198 | + Bleached |
| 199 | + </h1> |
| 200 | + <h3>A point-and-click story about life and color.</h3> |
| 201 | + |
| 202 | + <div style={{ height: '15px' }}></div> |
| 203 | + |
| 204 | + {!playing && ( |
| 205 | + <> |
| 206 | + <button onClick={handlePlay}>Play the demo</button> |
| 207 | + <div style={{ height: '15px' }}></div></> |
| 208 | + ) |
| 209 | + } |
| 210 | + {playing && ( |
| 211 | + <div> |
| 212 | + <div style={{ width: '1280px', height: '740px', border: 'none' }}> |
| 213 | + <iframe |
| 214 | + frameBorder="0" |
| 215 | + src="https://itch.io/embed-upload/12820034?color=ffe7d6" |
| 216 | + allowFullScreen |
| 217 | + width="1280" |
| 218 | + height="740" |
| 219 | + > |
| 220 | + <a href="https://thomas-bringer.itch.io/bleached">Play Bleached on itch.io</a> |
| 221 | + </iframe> |
| 222 | + </div> |
| 223 | + </div> |
| 224 | + )} |
| 225 | + |
| 226 | + <SocialMedia></SocialMedia> |
| 227 | + |
| 228 | + {/* <h3>Bleached is a point-and-click interactive story about life and color.</h3> |
| 229 | + <h3>When every day looks the same, tints slowly fade.</h3> |
| 230 | + <h3>One day, your canvas is empty. Can you paint something new?</h3> */} |
| 231 | + |
| 232 | + {/* <div style={{ height: '25px'}}></div> */} |
| 233 | + |
| 234 | + <div className='gif-container'> |
| 235 | + <div className='gif-text-container' style = {{textAlign: 'right'}}> |
| 236 | + <h3 className='gif-title'>Recolor the world around you.</h3> |
| 237 | + <div className='gif-text'>Your environment is turning white... and painting new shades isn't so simple. With time, perhaps new strokes can bring new perspectives.</div> |
| 238 | + </div> |
| 239 | + <div style={{ width: '50px'}}></div> |
| 240 | + <img className='gif' src='https://thomasbringer.github.io/bleached/gifs/home.gif' /> |
| 241 | + </div> |
| 242 | + |
| 243 | + <div style={{ height: '35px'}}></div> |
| 244 | + |
| 245 | + <div className='gif-container'> |
| 246 | + <img className='gif' src='https://thomasbringer.github.io/bleached/gifs/subway.gif' /> |
| 247 | + <div style={{ width: '50px'}}></div> |
| 248 | + <div className='gif-text-container' style = {{textAlign: 'left'}}> |
| 249 | + <h3 className='gif-title'>Point and click on anything.</h3> |
| 250 | + <div className='gif-text'>Walk around, talk to friends and colleagues, take care of pets, play minigames. Everything in the scenery is interactive.</div> |
| 251 | + </div> |
| 252 | + </div> |
| 253 | + |
| 254 | + <div className='gif-container'> |
| 255 | + <div className='gif-text-container' style = {{textAlign: 'right'}}> |
| 256 | + <h3 className='gif-title'>Wake up. Work. Sleep. Repeat.</h3> |
| 257 | + <div className='gif-text'>Each day is the exact same picture, except that your relationships—with yourself and others—evolve.</div> |
| 258 | + </div> |
| 259 | + <div style={{ width: '50px'}}></div> |
| 260 | + <img className='gif' src='https://thomasbringer.github.io/bleached/gifs/work.gif' /> |
| 261 | + </div> |
| 262 | + |
| 263 | + <div style={{ height: '25px'}}></div> |
| 264 | + <h2>Watch the Teaser Trailer for Bleached</h2> |
| 265 | + <div style={{ height: '10px'}}></div> |
| 266 | + |
| 267 | + <iframe |
| 268 | + width="960" |
| 269 | + height="540" |
| 270 | + src={`https://www.youtube.com/embed/nqyUEa46Dhs`} |
| 271 | + title="Bleached Teaser Trailer" |
| 272 | + frameBorder="0" |
| 273 | + allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" |
| 274 | + allowFullScreen |
| 275 | + ></iframe> |
| 276 | + |
| 277 | + <div style={{ height: '25px'}}></div> |
| 278 | + <h2>Play Bleached on itch.io</h2> |
| 279 | + <iframe |
| 280 | + frameBorder="0" |
| 281 | + src="https://itch.io/embed/3328660?border_width=0&bg_color=ffe7d6&fg_color=73464c&link_color=ab5675&border_color=ffe7d6" |
| 282 | + width="550" |
| 283 | + height="165" |
| 284 | + > |
| 285 | + <a href="https://thomas-bringer.itch.io/bleached">Bleached by Thomas Bringer</a> |
| 286 | + </iframe> |
| 287 | + |
| 288 | + </div></div> |
| 289 | + </> |
| 290 | + </div> |
| 291 | + |
74 | 292 | </div> |
75 | 293 | </div> |
76 | 294 | ); |
|
0 commit comments