Skip to content

Commit 7c6be56

Browse files
committed
Added WhatsApp Modal
1 parent c6e6a45 commit 7c6be56

File tree

3 files changed

+82
-7
lines changed

3 files changed

+82
-7
lines changed

assets/css/style.css

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,46 @@ textarea.input-field {
10261026
}
10271027

10281028

1029+
/*-----------------------------------*\
1030+
* #WhatsApp Modal
1031+
\*-----------------------------------*/
1032+
.modal {
1033+
display: none;
1034+
position: fixed;
1035+
z-index: 1000;
1036+
left: 0;
1037+
top: 0;
1038+
width: 100%;
1039+
height: 100%;
1040+
background: rgba(0,0,0,0.6);
1041+
}
1042+
1043+
.modal-content {
1044+
background: #fff;
1045+
margin: 5% auto;
1046+
padding: 0;
1047+
width: 80%;
1048+
height: 80%;
1049+
border-radius: 10px;
1050+
position: relative;
1051+
}
1052+
1053+
.modal-content iframe {
1054+
width: 100%;
1055+
height: 100%;
1056+
border: none;
1057+
border-radius: 10px;
1058+
}
1059+
1060+
.close {
1061+
position: absolute;
1062+
top: 10px;
1063+
right: 20px;
1064+
font-size: 30px;
1065+
cursor: pointer;
1066+
color: #333;
1067+
}
1068+
10291069
/*-----------------------------------*\
10301070
* #MEDIA QUERIES
10311071
\*-----------------------------------*/
@@ -1445,3 +1485,4 @@ textarea.input-field {
14451485
}
14461486

14471487
}
1488+

assets/js/script.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,29 @@ if (preloader) {
153153
setTimeout(() => {
154154
if (preloader.parentNode) preloader.parentNode.removeChild(preloader);
155155
}, 1000);
156-
}, 2000); // <-- duration before fade-out (in ms)
156+
}, 1500); // <-- duration before fade-out (in ms)
157157
});
158158
}
159+
160+
document.addEventListener("DOMContentLoaded", () => {
161+
const modal = document.getElementById("myModal");
162+
const openModal = document.getElementById("openModal");
163+
const closeModal = document.getElementById("closeModal");
164+
165+
if (openModal && modal && closeModal) {
166+
openModal.onclick = (e) => {
167+
e.preventDefault();
168+
modal.style.display = "block";
169+
};
170+
171+
closeModal.onclick = () => {
172+
modal.style.display = "none";
173+
};
174+
175+
window.onclick = (event) => {
176+
if (event.target === modal) {
177+
modal.style.display = "none";
178+
}
179+
};
180+
}
181+
});

index.html

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ <h2 class="h2 hero-title">Turning Ideas into Robust, Cloud-Native Applications</
118118
</a>
119119
</li>
120120
<li>
121-
<a class="hero-social-link" href="https://www.facebook.com/muhammadowaismushtaq/" target="_blank">
122-
<ion-icon name="logo-facebook"></ion-icon>
123-
<div class="tooltip">Facebook</div>
121+
<a class="hero-social-link" href="#" id="openModal">
122+
<ion-icon name="logo-whatsapp"></ion-icon>
123+
<div class="tooltip">Chat with Owais 👋</div>
124124
</a>
125125
</li>
126126
</ul>
@@ -760,7 +760,6 @@ <h3 class="h4 contact-item-title">Email:</h3>
760760
</article>
761761
</main>
762762

763-
764763
<!--
765764
- #FOOTER
766765
-->
@@ -780,11 +779,23 @@ <h3 class="h4 contact-item-title">Email:</h3>
780779

781780
</div>
782781
</footer>
782+
783+
<!-- Modal -->
784+
<div id="myModal" class="modal">
785+
<div class="modal-content">
786+
<span class="close" id="closeModal">&times;</span>
787+
<!-- The other static site or page you want to show -->
788+
<iframe src="https://muhammadowaismushtaq.github.io/portfolio-whatsapp/" title="Other Site"></iframe>
789+
</div>
790+
</div>
791+
783792
<a class="go-top" data-go-top href="#top" title="Go to Top">
784793
<ion-icon name="arrow-up"></ion-icon>
785794
</a>
795+
786796
<script src="./assets/js/script.js"></script>
787-
<script src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js" type="module"></script>
788-
<script nomodule src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>
797+
<!-- Ionicons for modern browsers -->
798+
<script type="module" src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"></script>
799+
789800
</body>
790801
</html>

0 commit comments

Comments
 (0)