From eae4eb1d3b891ad6b03467d8aaaa0bfd0c9f7dfe Mon Sep 17 00:00:00 2001 From: Mohammed Elmir <mohammed.elmir@ashesi.edu.gh> Date: Mon, 19 Jun 2023 10:12:00 +0000 Subject: [PATCH] Update style.css --- static/style.css | 354 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 354 insertions(+) diff --git a/static/style.css b/static/style.css index 1159978..3161fa4 100644 --- a/static/style.css +++ b/static/style.css @@ -16,3 +16,357 @@ body { padding-top: 56px; } /* footer */ footer a { color: white; font-weight: bold; text-decoration: none; } footer a:hover { color: white; text-decoration: underline; } + +/*navbar*/ +@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300&display=swap'); +*{ + margin: 0; + padding: 0; + box-sizing: border-box; +} + + + +/* HEADER SECTION STYLES*/ +.header{ + background: #ffffff; + ;position: relative; + max-width: 100vw; + margin: auto; + display: flex; + align-items: center; + justify-content: space-between; + padding: 1rem 2rem; + z-index: 1; + font-family: 'Nunito', sans-serif; + top: 0; + width: 100%; + box-shadow: 10px #122331; +} + + +/* -------------------- */ +/* only makes the unordered list visible to the user horizontal and not all unordered lists */ +.header .menu-items{ + display: flex; + align-items: center; +} +/* -------------------- */ + + +/* --------------------- */ +/* makes all unordered list items have no styles */ +.header ul{ + list-style: none; + font-weight: normal; + margin-right: 80px; +} +/* -------------------- */ + + +.logo{ + padding-left: 80px; + color: #122331; + font-size: 2rem; + font-weight: bold; +} + +.header a{ + text-decoration: none; + color: #122331; + padding: 0.5rem 1rem; + transition: all 0.2s ease-in-out; + font-weight: bold; +} +.second{ + color:#6497b1; +} + +span{ + padding-right: 5px; +} + +.header a:hover{ + background: #6497b1; + color: #ffffff; + font-weight: normal; +} +/* end of HEADER SECTION STYLES*/ + + + + +/* DROPDOWN MENU STYLES */ +.dropdown{ + display: relative; +} +.dropdown-menu{ + position: absolute; + background: #ffffff; + width: 230px; + top: 50px; + opacity: 0; + visibility: hidden; + transition: all 0.2s ease; +} + +.menu-item{ + display: flex; + justify-content: space-between; + width: 100%; +} + +.dropdown:hover .dropdown-menu{ + top: 65px; + opacity: 1; + visibility: visible; +} +/* end of DROPDOWN MENU STYLES */ + + + + +/* MEGA MENU STYLES */ +.mega-menu{ + position: absolute; + left: 200; + width: 80vw; + top: 80px; + opacity: 0; + visibility: hidden; + transition: all 0.3s ease; +} + +.mega-menu .content{ + background: #ffffff; + padding: 1rem; + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 1rem; + width: 100%; + justify-content: space-between; +} + +.mega-menu .content_1{ + background: #ffffff; + padding: 1rem; + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 1rem; + width: 100%; + justify-content: space-between; +} + +.content .col{ + display: flex; + flex-direction: column; + justify-content: space-between; + line-height: 3rem; +} + +.content_1 .col{ + display: flex; + flex-direction: column; + justify-content: space-between; + line-height: 3rem; +} + +.content .col #mega-links{ + border-left: 1px solid #1a3246; +} + + +.content_1 .col #mega-links{ + border-left: 1px solid #1a3246; +} + +.col .mega-links li{ + padding-left: 0.4rem; +} + +/* hover */ +.menu-items li:hover .mega-menu{ + top: 65px; + opacity: 1; + visibility: visible; +} + +/* end of MEGA MENU STYLES */ + + + + +/* -----------------RESPONSIVENESS --------------------*/ + +/* HAMBURGER STYLES */ +.menu-btn{ + position: relative; + display: none; + justify-content: center; + align-items: center; + width: 1.5rem; + height: 1.5rem; + cursor: pointer; + z-index: 2; +} +.menu-btn_lines::before, .menu-btn_lines::after{ + content: " "; + position: absolute; +} + +.menu-btn_lines, .menu-btn_lines::before,.menu-btn_lines::after{ + width: 1.5rem; + height: 0.2rem; + background: #6497b1; + transition: all 0.5s ease-in-out; +} + +.menu-btn_lines::before{ + transform: translateY(-0.5rem); +} +.menu-btn_lines::after{ + transform: translateY(0.5rem); +} + +/* animation */ +.menu-btn.open .menu-btn_lines{ + /* targetting middle line */ + transform: translateX(2rem); + background: transparent; +} + +.menu-btn.open .menu-btn_lines::before{ + transform: rotate(45deg) translate(-1.5rem, 1.5rem); + background: #6497b1; +} + +.menu-btn.open .menu-btn_lines::after{ + transform: rotate(-45deg) translate(-1.5rem, -1.5rem); + background: #6497b1; +} + +/* END OF HAMBURGER STYLES */ + +/* MEDIA QUERIES */ +@media screen and (max-width: 970px){ + .menu-btn{ + display: flex; + } + .header{ + justify-content: space-between; + display: flex; + } + .header .menu-items{ + position: absolute; + /* items should begin at the bottom of the header */ + height: calc(200vh - 100%); + width: 100%; + max-width: 350px; + top: 100%; + right: 0; + background: #ffffff; + display: block; + padding: 1rem; + line-height: 3rem; + overflow-y: auto; + opacity: 0; + transform: translateY(-10vh); + transition: all 0.3s ease-out; + z-index: -1; + } + .menu-items.open{ + opacity: 1; + transform: translateY(0); + } + .menu-items li{ + margin: 15px 10px; + } + .menu-items li a{ + padding: 0 1rem; + display: block; + font-size: 1.2rem; + } + .header a:hover{ + background-color: transparent; + color: #122331; + font-weight: normal; + } + + /* dropdown and mega menu */ + .menu-items .dropdown-menu, .menu-items .mega-menu{ + position: static; + opacity: 1; + visibility: visible; + top: 4rem; + padding-left: 1rem; + width: 100%; + max-height: 0; + transform: scaleY(0); + transform-origin: top; + overflow: hidden; + transition: all 0.3s ease; + } + .expand-btn.open + .expandable{ + max-height: 100%; + transform: scaleY(1); + } + .expandable li{ + margin: 0; + } + .expandable li a{ + font-size: 1rem; + } + /* styling mega menu elements */ + .mega-menu .content{ + grid-template-columns: auto; + padding: 1rem 1rem 0 1rem; + overflow-y: auto + } + + .mega-menu .content_1{ + grid-template-columns: auto; + padding: 1rem 1rem 0 1rem; + overflow-y: auto + } + + .mega-menu .content .col{ + width: 100%; + padding-top: 1rem; + margin-bottom: 0.5rem; + border-top: 1px solid #1a3246; + } + + .mega-menu .content_1 .col{ + width: 100%; + padding-top: 1rem; + margin-bottom: 0.5rem; + border-top: 1px solid #1a3246; + } + + + .mega-menu .content .col:nth-child(1){ + border-top: 0px; + } + + .mega-menu .content_1 .col:nth-child(1){ + border-top: 0px; + } + + .content .col #mega-links{ + border-left: 0px; + padding-left: 1rem; + } + + .content_1 .col #mega-links{ + border-left: 0px; + padding-left: 1rem; + } + + .col .mega-links{ + margin: 0; + } + +} +/* MEDIA QUERIES */ + +/* -----------------end of RESPONSIVENESS SECTION--------------------*/ -- GitLab