<!DOCTYPE html>
<html lang="fa">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>project15</title>
<script
src="https://kit.fontawesome.com/cac5ba1843.js"
crossorigin="anonymous"
></script>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
/>
<link rel="stylesheet" href="/assets/css/style.css" />
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: #f0d4c3;
position: relative;
}
ul {
list-style: none;
}
.container {
position: relative;
}
.left {
position: absolute;
width: 50%;
height: 100%;
left: 0;
}
.right {
position: absolute;
width: 50%;
height: 100%;
right: 0;
}
h1 {
position: absolute;
top: 200px;
left: 50%;
transform: translate(-50%, -50%);
font-size: 36px;
white-space: nowrap;
/* color: #fff; */
}
h1::after {
content: "";
position: absolute;
width: 0x;
height: 4px;
bottom: -8px;
color: #000;
left: 0;
transition: all 500ms ease-in-out;
}
.cta-btn {
position: absolute;
width: 100px;
height: 50px;
line-height: 1;
padding: 12px;
text-align: center;
font-size: 18px;
border: 2px solid #000;
transform: translate(-50%, -50%);
top: 600px;
left: 450px;
/* color: #fff; */
}
.cta-btn::after {
content: "";
position: absolute;
width: 100%;
height: 0;
color: #000;
left: 0;
bottom: 0;
transition: all 500ms ease-in-out;
}
.cta-btn:hover::after {
height: 4px;
}
h1:hover::after {
width: 100%;
}
.container {
position: relative;
width: 100%;
height: 100%;
background-color: blue;
}
.container .half {
position: absolute;
width: 50%;
height: 100%;
background-color: red;
}
.container .right {
position: absolute;
right: 0;
width: 50%;
height: 100%;
background: url(assets/img/a3.jpg);
background-size: cover;
transition: all 500ms ease-in-out;
}
.container .right::before {
content: "";
width: 100%;
height: 100%;
background: rgba(255, 0, 120, 0.5);
position: absolute;
}
.container .left {
position: absolute;
left: 0;
width: 50%;
height: 100%;
background: url(assets/img/a3.jpg);
background-size: cover;
transition: all 500ms ease-in-out;
}
.container .left::before {
content: "";
width: 100%;
height: 100%;
background: rgba(255, 0, 120, 0.5);
position: absolute;
transition: all 500ms ease-in-out;
}
.left-is-hovered .left {
width: 85%;
}
.left-is-hovered .left h1::after {
width: 100%;
}
.left-is-hovered .right {
width: 15%;
}
.left-is-hovered .right::before {
background: rgba(0, 0, 0, 0.65);
z-index: 2;
}
.right-is-hovered .right {
width: 85%;
}
.right-is-hovered .right h1::after {
width: 100%;
}
.right-is-hovered .left {
width: 15%;
}
.right-is-hovered .left::before {
background: rgba(0, 0, 0, 0.65);
z-index: 2;
}
</style>
</head>
<body>
<!-- <p class="course-title">پروژه شماره 15</p> -->
<div class="container">
<div class="half left">
<h1>دوره جامع طراحی وب</h1>
<a href="#" class="cta-btn">آماده ای؟</a>
</div>
<div class="half right">
<h1>دوره جامع وردپرس</h1>
<a href="#" class="cta-btn">بزن بریم</a>
</div>
</div>
<script
src="https://code.jquery.com/jquery-3.7.1.js"
integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
crossorigin="anonymous"
></script>
<script>
$(document).ready(function(){
var right= $('.right');
var left= $('left');
right.mouseenter(function(){
$('.container').addClass('right-is-hovered')
});
right.mouseleave(function(){
$('.container').removeClass('right-is-hovered')
});
left.mouseenter(function(){
$('.container').addClass('left-is-hovered')
});
left.mouseleave(function(){
$('.container').removeClass('left-is-hovered')
});
});
</script>
</body>
</html>