DEV Community

Cover image for Day 7 | 50 Projects in 50 Days
Augusta Igboama
Augusta Igboama

Posted on

Day 7 | 50 Projects in 50 Days

Split Landing Page

This project shows two sections side by side — one for PlayStation 5 and one for Xbox Series X. When you hover over a section, it expands while the other one shrinks.

Each side has a background image, but I added a linear gradient overlay to make the text and buttons stand out more. I didn’t even know before that you can make a gradient go from one color to the same color — it just creates a soft, semi-transparent overlay. That felt like a small win.

For the interactivity, I used mouseenter and mouseleave in JavaScript to toggle an active class. When a section becomes active, its flex value increases, making it grow wider while the other side shrinks back.

My layout was quite different from the instructor’s. He used absolute positioning, but I used Flexbox. The funny thing is, both methods gave almost the same result, just with different behaviors underneath.

Absolute positioning made the hover animations more independent and easier to control, while Flexbox made things resize smoothly but also pushed elements around a bit. For this project, absolute positioning was probably the better fit, but I like that I’m learning these differences by trying things my own way. That’s really the point of this whole process for me.

Here is what it looks like normally
Normal page not hovered on any section

And when one side is hovered (the XBox Side)
Hover on XBox Series X

For a live demo of the project, click here

To view the code on GitHub, click here

Top comments (2)

Collapse
 
usman_awan profile image
MUHAMMAD USMAN AWAN

Nice, keep up the good work 🙌

Collapse
 
augusta08 profile image
Augusta Igboama

Thank you! I will

Some comments may only be visible to logged-in visitors. Sign in to view all comments.