-
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.
- Loading branch information
Showing
5 changed files
with
183 additions
and
0 deletions.
There are no files selected for viewing
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.
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,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="./style.css" /> | ||
<title>Split | Landing | Page</title> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="split left"> | ||
<h1>Playstation 5</h1> | ||
<a href="#" class="btn">Buy Now</a> | ||
</div> | ||
<div class="split right"> | ||
<h1>XBox Series X</h1> | ||
<a href="#" class="btn">Buy Now</a> | ||
</div> | ||
</div> | ||
|
||
<script src="./script.js"></script> | ||
</body> | ||
</html> |
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,13 @@ | ||
// Block Elements and Variables | ||
const left = document.querySelector(".left"); | ||
const right = document.querySelector(".right"); | ||
const container = document.querySelector(".container"); | ||
|
||
|
||
// Add Event Listener | ||
left.addEventListener("mouseenter", () => container.classList.add("hover-left")); | ||
left.addEventListener("mouseleave", () => container.classList.remove("hover-left")); | ||
|
||
|
||
right.addEventListener("mouseenter", () => container.classList.add("hover-right")); | ||
right.addEventListener("mouseleave", () => container.classList.remove("hover-right")); |
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,146 @@ | ||
@import url("https://fonts.googleapis.com/css2?family=Roboto&family=Pattaya&display=swap"); | ||
|
||
:root { | ||
--left-bg-color: rgba(87, 84, 236, 0.7); | ||
--right-bg-color: rgba(43, 43, 43, 0.8); | ||
--left-btn-hover-color: rgba(87, 84, 236, 1); | ||
--right-btn-hover-color: rgba(18, 122, 28, 1); | ||
--hover-width: 75%; | ||
--other-width: 25%; | ||
--speed: 1000ms; | ||
} | ||
|
||
*::after, | ||
*::before { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
font-family: "Roboto", sans-serif; | ||
overflow-x: hidden; | ||
height: 100vh; | ||
margin: 0; | ||
} | ||
|
||
h1 { | ||
font-size: 2.5rem; | ||
color: #fff; | ||
position: absolute; | ||
left: 50%; | ||
top: 16%; | ||
transform: translateX(-50%); | ||
white-space: nowrap; | ||
} | ||
|
||
.btn { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
position: absolute; | ||
left: 50%; | ||
top: 40%; | ||
transform: translateX(-50%); | ||
text-decoration: none; | ||
color: #fff; | ||
border: 0.2rem solid #fff; | ||
font-size: 0.8rem; | ||
font-weight: bold; | ||
text-transform: uppercase; | ||
width: 6rem; | ||
padding: 0.7rem; | ||
} | ||
|
||
.split.left .btn:hover { | ||
background-color: var(--left-btn-hover-color); | ||
border-color: var(--left-btn-hover-color); | ||
} | ||
|
||
.split.right .btn:hover { | ||
background-color: var(--right-btn-hover-color); | ||
border-color: var(--right-btn-hover-color); | ||
} | ||
|
||
.container { | ||
position: relative; | ||
width: 100%; | ||
height: 100%; | ||
background: #333; | ||
} | ||
|
||
.split { | ||
position: absolute; | ||
width: 50%; | ||
height: 100%; | ||
overflow: hidden; | ||
} | ||
|
||
.split.left { | ||
left: 0; | ||
background: url("./PS-5.jpg"); | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
} | ||
|
||
.split.left::before { | ||
content: ""; | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
background-color: var(--left-bg-color); | ||
} | ||
|
||
.split.right { | ||
right: 0; | ||
background: url("./Xbox.jpg"); | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
} | ||
|
||
.split.right::before { | ||
content: ""; | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
background-color: var(--right-bg-color); | ||
} | ||
|
||
.split.right, | ||
.split.left, | ||
.split.right::before, | ||
.split.left::before { | ||
transition: all var(--speed) ease-in-out; | ||
} | ||
|
||
/* Left Right Hover nd Other Width*/ | ||
|
||
.hover-left .left { | ||
width: var(--hover-width); | ||
} | ||
|
||
.hover-left .right { | ||
width: var(--other-width); | ||
} | ||
|
||
/* Right Left Hover nd Other Width*/ | ||
|
||
.hover-right .right { | ||
width: var(--hover-width); | ||
} | ||
|
||
.hover-right .left { | ||
width: var(--other-width); | ||
} | ||
|
||
@media (max-width: 800px) { | ||
h1 { | ||
font-size: 1.5rem; | ||
top: 25%; | ||
} | ||
|
||
.btn { | ||
width: 4rem; | ||
padding: 0.6rem; | ||
} | ||
} |