Skip to content

Commit

Permalink
End Project
Browse files Browse the repository at this point in the history
  • Loading branch information
parsfront committed Jul 16, 2022
1 parent ef4c2c4 commit 382dc56
Show file tree
Hide file tree
Showing 16 changed files with 174 additions and 0 deletions.
Binary file added fonts/isans.eot
Binary file not shown.
Binary file added fonts/isans.ttf
Binary file not shown.
Binary file added fonts/isans.woff
Binary file not shown.
Binary file added fonts/isans.woff2
Binary file not shown.
Binary file added fonts/vazir-Black.eot
Binary file not shown.
Binary file added fonts/vazir-Black.ttf
Binary file not shown.
Binary file added fonts/vazir-Black.woff
Binary file not shown.
Binary file added fonts/vazir-Black.woff2
Binary file not shown.
Binary file added fonts/vazir.eot
Binary file not shown.
Binary file added fonts/vazir.ttf
Binary file not shown.
Binary file added fonts/vazir.woff
Binary file not shown.
Binary file added fonts/vazir.woff2
Binary file not shown.
33 changes: 33 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="fa" dir="rtl">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./styles/style.css">
<title>Js Project</title>
</head>

<body>


<div class="search-icon">
<i class="fas fa-search search-btn"></i>
</div>

<div class="search-overlay"></div>

<div class="search-popup">
<form class="search-form">
<div class="form-group">
<input type="text" class="form-control" placeholder="جستجو کنید">
<button class="submit-btn"><i class="fas fa-search"></i></button>
</div>
</form>
</div>

<script src="./js/all.min.js"></script>
<script src="./js/script.js"></script>
</body>

</html>
5 changes: 5 additions & 0 deletions js/all.min.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions js/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const btn = document.querySelector(".search-icon");
const overlay = document.querySelector(".search-overlay");
const popup = document.querySelector(".search-popup");

btn.addEventListener("click", function () {
overlay.classList.add("active");
popup.classList.add("active");
});

overlay.addEventListener("click", function () {
overlay.classList.remove("active");
popup.classList.remove("active");
});
123 changes: 123 additions & 0 deletions styles/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
@font-face {
font-family: "vazir";
src: url("../fonts/vazir.eot") format("eot"), url("../fonts/vazir.ttf") format("truetype"), url("../fonts/vazir.woff") format("woff"), url("../fonts/vazir.woff2") format("woff2");
}

* {
padding: 0;
margin: 0;
}

body {
font-family: "vazir";
overflow-x: hidden;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
}

.search-icon {
background: #ff0071;
width: 50px;
height: 50px;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}

.search-icon svg {
color: #fff;
font-size: 25px;
}

.search-overlay {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: #000;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
}

.search-overlay.active {
opacity: 1;
visibility: visible;
}

.search-popup {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
width: 600px;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
}

.search-popup.active {
opacity: 1;
visibility: visible;
}

.search-popup .form-group {
width: 100%;
position: relative;
}

.search-popup .form-group input {
width: 100%;
height: 60px;
border: none;
font-family: "vazir";
outline: none;
font-size: 18px;
border-radius: 30px;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
-ms-border-radius: 30px;
-o-border-radius: 30px;
padding: 0 20px 0 90px;
box-sizing: border-box;
}

.search-popup .form-group .submit-btn {
position: absolute;
left: 0;
top: 0;
width: 70px;
height: 60px;
background: #ff0071;
border: none;
color: #fff;
font-size: 18px;
border-radius: 30px 0 0 30px;
-webkit-border-radius: 30px 0 0 30px;
-moz-border-radius: 30px 0 0 30px;
-ms-border-radius: 30px 0 0 30px;
-o-border-radius: 30px 0 0 30px;
cursor: pointer;
}

0 comments on commit 382dc56

Please sign in to comment.