-
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
programmer
committed
Oct 11, 2024
1 parent
b6f9251
commit f71c8ba
Showing
3 changed files
with
155 additions
and
7 deletions.
There are no files selected for viewing
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,87 @@ | ||
.modal { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
gap: 0.4rem; | ||
width: 90%; | ||
/* استخدام عرض نسبي */ | ||
max-width: 450px; | ||
/* أقصى عرض */ | ||
padding: 1.3rem; | ||
min-height: 250px; | ||
position: absolute; | ||
z-index: 2; | ||
top: 10%; | ||
left: 50%; | ||
/* محاذاة إلى المركز */ | ||
transform: translateX(-50%); | ||
/* تحريك إلى اليسار بنسبة 50% */ | ||
background-color: white; | ||
border: 1px solid #ddd; | ||
border-radius: 15px; | ||
} | ||
|
||
.modal .flex { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
|
||
.btns-download-cv { | ||
display: flex; | ||
justify-content: center; | ||
padding-top: 30px; | ||
} | ||
|
||
.btn-close { | ||
padding: 0.5rem 0.7rem; | ||
background: #ee6b6b; | ||
border-radius: 20%; | ||
transform: translate(10px, -20px); | ||
} | ||
|
||
.overlay { | ||
position: fixed; | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: rgba(0, 0, 0, 0.5); | ||
backdrop-filter: blur(3px); | ||
z-index: 1; | ||
} | ||
|
||
.hidden { | ||
display: none; | ||
} | ||
|
||
/* Media Queries لتعديل التصميم على أحجام الشاشة المختلفة */ | ||
@media (max-width: 600px) { | ||
.modal { | ||
width: 95%; | ||
/* عرض أكبر على الشاشات الصغيرة */ | ||
padding: 1rem; | ||
/* تقليل الحشوة */ | ||
min-height: 200px; | ||
/* تقليل الحد الأدنى للطول */ | ||
} | ||
|
||
.btn-close { | ||
padding: 0.3rem 0.5rem; | ||
/* تقليل حجم الأزرار */ | ||
} | ||
} | ||
|
||
@media (max-width: 400px) { | ||
.modal { | ||
padding: 0.8rem; | ||
/* حشوة أقل على الشاشات الصغيرة جدًا */ | ||
} | ||
|
||
.btn-close { | ||
padding: 0.2rem 0.4rem; | ||
/* تقليل حجم الأزرار أكثر */ | ||
} | ||
} |
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,29 @@ | ||
const modal = document.querySelector(".modal"); | ||
const overlay = document.querySelector(".overlay"); | ||
const openModalBtn = document.querySelector(".btn-open"); | ||
const closeModalBtn = document.querySelector(".btn-close"); | ||
|
||
// close modal function | ||
const closeModal = function () { | ||
modal.classList.add("hidden"); | ||
overlay.classList.add("hidden"); | ||
}; | ||
|
||
// close the modal when the close button and overlay is clicked | ||
closeModalBtn.addEventListener("click", closeModal); | ||
overlay.addEventListener("click", closeModal); | ||
|
||
// close modal when the Esc key is pressed | ||
document.addEventListener("keydown", function (e) { | ||
if (e.key === "Escape" && !modal.classList.contains("hidden")) { | ||
closeModal(); | ||
} | ||
}); | ||
|
||
// open modal function | ||
const openModal = function () { | ||
modal.classList.remove("hidden"); | ||
overlay.classList.remove("hidden"); | ||
}; | ||
// open modal event | ||
openModalBtn.addEventListener("click", openModal); |
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