From e070335865b8a76ce822152bf236f5fec3d102c3 Mon Sep 17 00:00:00 2001 From: Haidar <16521522@mahasiswa.itb.ac.id> Date: Mon, 9 Oct 2023 12:37:31 +0700 Subject: [PATCH] feat: add landing page css and js --- public/css/Hall-of-Fame.css | 2 + public/css/landingPage.css | 156 ++++++++++++++++++++++-------------- public/js/landing.js | 25 ++++++ 3 files changed, 122 insertions(+), 61 deletions(-) create mode 100644 public/js/landing.js diff --git a/public/css/Hall-of-Fame.css b/public/css/Hall-of-Fame.css index 41e96b8..a030ca8 100644 --- a/public/css/Hall-of-Fame.css +++ b/public/css/Hall-of-Fame.css @@ -99,6 +99,8 @@ table { margin-top: 20px; border: 1px solid #192e3a; border-top: 2px solid crimson; + position: relative; + left: 5%; } tr { diff --git a/public/css/landingPage.css b/public/css/landingPage.css index eae1854..333e141 100644 --- a/public/css/landingPage.css +++ b/public/css/landingPage.css @@ -37,7 +37,9 @@ a { width: 100%; min-height: 100vh; overflow: hidden; - background-color: var(--backgroundColor); + /* background: linear-gradient(to bottom, #3a1919, #0c1b28); */ + background-image: url('../img/landingPage.jpg'); + background-size: cover; display: flex; flex-direction: column; justify-content: space-between; @@ -58,7 +60,7 @@ header .container{ display: flex; justify-content: space-between; align-items: center; - /* padding-bottom: 2rem; */ + } @@ -109,7 +111,7 @@ header .container{ display: inline-block; padding: 0.9rem 1.9rem; color: #fff !important; - background-color: var(--mainColor); + background-color: crimson; border-radius: 16px; text-transform: capitalize; transition: 0.3s; @@ -131,70 +133,102 @@ header .container{ justify-content: center; } -.person{ - width: 100%; - margin-top: 2rem; - transform: translate(0%, 25px); -} - -.big-title{ - font-size: 1.4rem; - color: var(--lightOne); - text-transform: capitalize; - line-height: 1.4; - -} -.text{ +.text { + height: 290px; color: var(--lightOne); font-size: 1.1rem; margin: 1.9rem 0 2.5rem; - max-width: 600px; + max-width: 500px; line-height: 1.4; + animation: textAnimation 4s linear infinite; Apply animation + z-index: 1; + } + + + @keyframes textAnimation { + 0% { + opacity: 0.3; + } + 50% { + opacity: 0.7; + } + 100% { + opacity: 0.3; + } + } + + .big-title { + font-size: 1.4rem; + color: var(--lightOne); + text-transform: capitalize; + line-height: 1.4; + animation: scaleIn 2s ease-in-out infinite; + } + + + + @keyframes scaleIn { + 0% { + transform: scale(1); + opacity: 0.7; + } + 50% { + transform: scale(1.05); + opacity: 1; + } + 100% { + transform: scale(1); + opacity: 0.7; + } + } + + +.popup { + display: none; + position: fixed; + top: 20%; + left: 50%; + border-radius: 20px; + transform: translate(-50%, -50%); + width: 400px; + height: 200px; + background-color: black; + color: white; + padding: 20px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); + text-align: center; + animation: fadeIn 0.5s ease-in-out; + margin-right: 400px; + } + + @keyframes fadeIn { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } + } + + +.close { + position: absolute; + top: 10px; + right: 10px; + font-size: 20px; + cursor: pointer; } -/* footer */ -footer .container{ - display: flex; - justify-content: space-between; - align-items: center; - margin-top: 10rem; - background-color: var(--darkThree); - height: 80px; -} - -.links2 ul{ - display: flex; - list-style: none; - align-items: center; - -} - -.links2 a{ - position: relative; - color: var(--lightTwo); - margin-right: 4.5rem; - display: inline-block; - transition: 0.3s; - -} - -.links2 img{ - width: 40px; - margin-right: 0.6rem; -} - -.links2 svg{ - margin-right: 0.2rem; - width: 2.25%; - height: 2.25% - - -} - -.links2 a:hover{ - color: var(--mainColor); - transform: scale(1); +@media screen and (max-width: 768px){ + .popup { + position: fixed; + top:90%; + bottom: 0; + z-index: 10001; + background-color: black; + + } } - + diff --git a/public/js/landing.js b/public/js/landing.js new file mode 100644 index 0000000..5c22770 --- /dev/null +++ b/public/js/landing.js @@ -0,0 +1,25 @@ +const openPopupButton = document.getElementById("openPopup"); +const closePopupButton = document.getElementById("closePopup"); +const popup = document.getElementById("popup"); +const texts = document.getElementById("text"); + +function openPopup() { + popup.style.display = "block"; + texts.style.display = "none"; + +} + +// Function to close the popup +function closePopup() { + popup.style.display = "none"; + texts.style.display = "block"; +} + +openPopupButton.addEventListener("click", openPopup); +closePopupButton.addEventListener("click", closePopup); + +window.addEventListener("click", (e) => { + if (e.target === popup) { + closePopup(); + } +}); -- GitLab