Refactor CSS (#785)

* Refactor CSS

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Refactor about section

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Refactor CSS for experiences section

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Update education section

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Update projects section

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Update publication + accomplishment section

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Update achievements section

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Refactor footer CSS

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Re-use section title adjustment css for top header

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Refactor navbar CSS

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Refactor sidebar CSS

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Use unified navbar for all pages

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Refactor 404 page CSS

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Refactor list page css

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Fix notes page css

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Refactor single page css

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Introduce color variables

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

---------

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
Emruz Hossain 2023-09-29 04:27:19 +06:00 committed by GitHub
parent 77447b7723
commit 6dc9d1d33d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 2532 additions and 3593 deletions

View file

@ -1,3 +1,10 @@
@mixin nav-item-hover-effect() {
color: $accent-color !important;
border-bottom: 2px solid $accent-color !important;
background: rgba($accent-color, 0.1);
@include transition();
}
.top-navbar {
position: fixed;
left: 0;
@ -5,294 +12,173 @@
width: 100%;
height: 50px;
z-index: 99999;
transition: all 0.4s ease-out;
margin: 0px;
padding-top: 0.4rem;
color: $heading-color;
text-align: center;
background-color: $bg-primary;
@include transition();
/* --- initial state start ------ */
&.initial-navbar {
background-color: transparent;
}
&.initial-navbar .navbar-brand {
color: #c0ccda;
.navbar-brand {
color: $heading-color;
font-weight: 600;
img {
width: 42px;
padding: 5px;
margin-left: -10px;
}
}
&.initial-navbar li a {
color: #c0ccda;
img {
display: inline-block;
}
&.initial-navbar .navbar-nav .active,
&.initial-navbar li a:hover {
color: #f9fafc;
transition: all 0.3s ease-out;
transform: translateY(-2px);
.sidebar-icon {
width: 32px;
height: 32px;
filter: invert(0.5);
}
.navbar-collapse {
margin-top: -5px;
li {
a {
color: $heading-color;
font-weight: 500;
@include transition();
border-bottom: 2px solid transparent;
&:hover {
@include nav-item-hover-effect();
}
}
}
.navbar-collapse.show,
.navbar-collapse.collapsing {
background-color: #f9fafc;
padding-left: 1rem;
.navbar-nav .active {
@include nav-item-hover-effect();
}
/* --- initial state end ------ */
/* --- state after scroll start --- */
&.final-navbar {
background-color: #f9fafc;
color: #1c2d41;
transition: all 0.3s ease-out;
}
&.final-navbar .navbar-brand {
color: #1c2d41;
font-weight: 600;
}
&.final-navbar li a {
color: #1c2d41;
font-weight: 500;
transition: all 0.3s ease-out;
border-bottom: 2px solid#F9FAFC;
}
&.final-navbar .navbar-nav .active,
&.final-navbar li a:hover {
color: #2098d1;
transition: all 0.3s ease-out;
border-bottom: 2px solid #2098d1;
background: rgb(2, 0, 36);
background: linear-gradient(
90deg,
rgba(2, 0, 36, 1) 0%,
rgba(34, 136, 168, 0.1) 0%
);
}
.navbar-collapse.show li a,
.navbar-collapse.collapsing li a {
color: #1c2d41;
font-weight: 500;
transition: all 0.3s ease-out;
}
.navbar-collapse.show .navbar-nav .active,
.navbar-collapse.show .navbar-nav a:hover {
color: #2098d1;
}
#top-navbar-divider {
margin-top: 10px;
}
/* --- state after scroll end --- */
#top-navbar-divider {
background: rgba(192, 204, 218, 0.8);
background-color: $muted-text-color;
height: 20px;
width: 2px;
}
&.final-navbar #top-navbar-divider {
background: rgba(0, 0, 0, 0.6);
}
#top-navbar-divider {
height: 20px;
width: 2px;
}
.navbar-brand img {
width: 42px;
padding: 5px;
margin-left: -10px;
}
.dropdown-menu {
box-shadow: 0px 8px 56px rgba(15, 80, 100, 0.16);
border: 1px solid #fff;
box-shadow: $box-shadow;
border: 1px solid $border-color;
max-height: 0vh;
overflow: hidden;
display: block;
visibility: hidden;
transition: all 0.3s ease-out;
@include transition();
&.show {
max-height: 100vh;
visibility: visible;
@include transition();
a {
color: $heading-color !important;
&:hover {
@include nav-item-hover-effect();
}
}
}
}
.dropdown-menu.show {
max-height: 100vh;
visibility: visible;
transition: all 0.3s ease-in;
.navbar-collapse {
margin-top: -5px;
&.show,
&.collapsing {
background-color: $bg-primary;
padding-left: 1rem;
li {
a {
color: $heading-color;
font-weight: 500;
@include transition();
}
}
.navbar-nav {
.active {
color: $accent-color;
}
a:hover {
color: $accent-color;
}
}
}
}
.dropdown-menu a {
color: #1c2d41;
border-bottom: none;
&.transparent-navbar {
background-color: transparent;
.navbar-brand {
color: $inverse-text-color;
font-weight: 600;
}
li {
a {
color: $inverse-text-color;
}
}
.feather-menu {
stroke: $inverse-text-color;
}
}
.dropdown-menu a:hover {
color: #2098d1;
transition: all 0.3s ease-out;
border-bottom: none;
background: rgb(2, 0, 36);
background: linear-gradient(
90deg,
rgba(2, 0, 36, 1) 0%,
rgba(34, 136, 168, 0.2) 0%
);
}
/* ============= Device specific fixes ======= */
/* Large screens such as TV */
@media only screen and (min-width: 1824px) {
}
/* Extra large devices (large desktops, 1200px and up) */
@media (max-width: 1400px) {
}
@media (max-width: 1200px) {
}
/* IPad Pro */
@media (max-width: 1024px) {
@include media('<=large') {
height: -moz-fit-content;
height: fit-content;
padding-bottom: 0px;
padding-top: 0px;
.container {
max-width: 100%;
}
&.initial-navbar .navbar-nav .active,
&.initial-navbar li a:hover {
color: #2098d1;
transition: all 0.3s ease-out;
}
&.final-navbar .navbar-nav .active,
&.final-navbar li a:hover {
color: #2098d1;
transition: none;
border-bottom: none;
background: transparent;
}
&.final-navbar li a {
border-bottom: none;
}
.dropdown-divider {
border-top: 1px solid #c0ccda;
&.transparent-navbar {
.navbar-nav .active,
li a:hover {
color: $accent-color;
@include transition();
}
}
#top-navbar-divider {
background: rgba(0, 0, 0, 0.6);
height: auto;
width: auto;
margin-right: 15px;
border-top: 1px solid #c0ccda;
}
.dropdown-menu {
text-align: center;
margin-bottom: 0.5rem;
margin-right: 1rem;
transition: all 0.3s ease-out;
@include transition();
}
.languageSelector {
position: fixed;
right: 0.5rem;
bottom: 1rem;
z-index: 10000000;
background-color: $bg-primary;
box-shadow: $box-shadow;
}
}
/* Large devices (desktops, 992px and up) */
@media (max-width: 992px) {
&.initial-navbar .navbar-nav .active,
&.initial-navbar li a:hover {
color: #2098d1;
transition: all 0.3s ease-out;
}
&.final-navbar .navbar-nav .active,
&.final-navbar li a:hover {
color: #2098d1;
transition: none;
border-bottom: none;
background: transparent;
}
&.final-navbar li a {
border-bottom: none;
}
.dropdown-divider {
border-top: 1px solid #c0ccda;
}
#top-navbar-divider {
background: rgba(0, 0, 0, 0.6);
height: auto;
width: auto;
margin-right: 15px;
}
}
/* Medium devices (tablets, 768px and up) */
@media only screen and (max-width: 768px) {
&.initial-navbar .navbar-nav .active,
&.initial-navbar li a:hover {
color: #2098d1;
transition: all 0.3s ease-out;
}
&.final-navbar .navbar-nav .active,
&.final-navbar li a:hover {
color: #2098d1;
transition: none;
border-bottom: none;
background: transparent;
}
&.final-navbar li a {
border-bottom: none;
}
.dropdown-divider {
border-top: 1px solid #c0ccda;
}
#top-navbar-divider {
background: rgba(0, 0, 0, 0.6);
height: auto;
width: auto;
margin-right: 15px;
}
}
/* Small devices (landscape phones, 576px and up) */
@media only screen and (max-width: 576px) {
@include media('<=small') {
.dropdown-menu {
margin-left: -1rem;
margin-right: 0rem;
}
}
/* iPhoneX, iPhone 6,7,8 */
@media only screen and (max-width: 375px) {
}
/* Galaxy S5, Moto G4 */
@media only screen and (max-width: 360px) {
}
/* iPhone 5 or before */
@media only screen and (max-width: 320px) {
}
}
}
.feather-sidebar,
.feather-menu {
width: 1.5rem;
height: 1.5rem;
stroke: $text-color;
}

View file

@ -2,162 +2,133 @@
order: 1;
flex: 20%;
max-width: 20%;
/* background-color: lightsalmon; */
transition: all ease-out 0.5s;
@include transition();
.sidebar-holder {
top: 2.5rem;
position: sticky;
background-color: #f9fafc;
background-color: $bg-primary;
height: 100vh;
overflow: auto;
box-shadow: 0px 8px 56px rgba(15, 80, 100, 0.16);
transition: all ease-out 0.3s;
box-shadow: $box-shadow;
@include transition();
.sidebar {
background: $bg-primary;
height: 100vh;
@include transition();
#search-box {
margin-left: 5%;
margin-right: 5%;
width: -webkit-fill-available;
height: 35px;
padding-left: 15px;
margin-top: 30px;
margin-bottom: 10px;
border-radius: 5px;
background-color: $bg-secondary;
@include transition();
border: 1px solid $border-color;
&:focus {
border: 1pt solid $accent-color;
outline: none;
}
}
#list-heading {
padding-left: 0px !important;
}
.sidebar-tree {
padding-left: 1rem;
position: relative;
width: -moz-max-content;
width: max-content;
.tree {
margin: 0;
padding: 0;
list-style: none;
li {
margin: 0;
padding: 0 1em;
line-height: 2em;
color: $heading-color;
position: relative;
i {
color: $heading-color;
font-size: 12px;
margin-right: 5px;
}
}
.shift-right {
margin-left: 5px;
}
.subtree {
padding-left: 0.7rem;
&:before {
content: '';
display: block;
width: 0;
position: absolute;
top: 2.5rem;
left: 1.5rem;
bottom: 0.9rem;
border-left: 1px solid $text-color;
}
li {
&:before {
content: '';
display: block;
width: 18px;
height: 0;
border-top: 1px solid $text-color;
margin-top: -1px;
position: absolute;
top: 18px;
left: -2px;
}
&:last-child:before {
background: $bg-primary;
height: auto;
top: 1.1rem;
bottom: 0;
}
ul {
position: relative;
padding-left: 0.5rem;
display: none;
list-style: none;
&.active {
display: block;
}
&:before {
content: '';
display: block;
width: 0;
position: absolute;
top: -8px;
left: 6px;
bottom: 0.8rem;
border-left: 1px solid;
}
}
}
}
}
}
}
}
.sidebar {
background: #f9fafc;
height: 100vh;
transition: all ease-out 0.3s;
}
.sidebar-tree {
padding-left: 1rem;
position: relative;
width: -moz-max-content;
width: max-content;
}
#search-box {
margin-left: 5%;
margin-right: 5%;
width: -webkit-fill-available;
height: 35px;
padding-left: 15px;
margin-top: 30px;
margin-bottom: 10px;
border-radius: 5px;
background-color: #e5e9f2;
transition: all 0.3s ease-out;
border: 1px solid #c0ccda;
}
#search-box:focus {
border: 1pt solid #248aaa;
outline: none;
}
#list-heading {
padding-left: 0px !important;
}
.tree,
.tree ul {
margin: 0;
padding: 0;
list-style: none;
}
.tree li {
margin: 0;
padding: 0 1em;
line-height: 2em;
color: #3c4858;
position: relative;
}
.tree li a {
text-decoration: none;
color: #131313;
transition: all 0.3s ease-out;
}
.tree li a.active {
display: inline;
color: #2098d1;
}
.tree li a:hover {
margin-left: 3px;
color: #2098d1;
transition: all 0.3s ease-out;
}
.tree i {
color: #3c4858;
font-size: 12px;
margin-right: 5px;
}
.tree .shift-right {
margin-left: 5px;
}
.tree .active,
.tree .active > ul {
display: block;
}
.subtree {
padding-left: 0.7rem;
}
.subtree:before {
content: "";
display: block;
width: 0;
position: absolute;
top: 2.5rem;
left: 1.5rem;
bottom: 0.9rem;
border-left: 1px solid;
}
.subtree ul,
ul > ul {
position: relative;
padding-left: 0.5rem;
display: none;
}
.subtree ul:before {
content: "";
display: block;
width: 0;
position: absolute;
top: -10px;
left: 0.3rem;
bottom: 0.9rem;
border-left: 1px solid;
}
.subtree li:before {
content: "";
display: block;
width: 20px;
height: 0;
border-top: 1px solid;
margin-top: -1px;
position: absolute;
top: 18px;
left: -3px;
}
.subtree li:last-child:before {
background: #f9fafc;
height: auto;
top: 1.1rem;
bottom: 0;
}
a.focused {
color: #2098d1 !important;
}
/* ============= Device specific fixes ======= */
/* Large screens such as TV */
@media only screen and (min-width: 1824px) {
@include media('<=ultra-large') {
flex: 15%;
max-width: 15%;
@ -165,79 +136,96 @@
max-width: 100%;
}
}
/* Extra large devices (large desktops, 1200px and up) */
@media (max-width: 1400px) {
@include media('<=extra-large') {
.sidebar-holder {
max-width: 20rem;
}
}
@media (max-width: 1200px) {
@include media('<=very-large') {
.sidebar-tree {
margin-left: 1rem;
}
}
/* IPad Pro */
@media (max-width: 1024px) {
@include media('<=large') {
flex: 0%;
max-width: 0%;
min-height: 100vh;
transition: all ease-out 0.3s;
@include transition();
.sidebar-holder {
position: sticky;
top: 2.5rem;
width: 100%;
padding-bottom: 1rem;
max-height: calc(100vh - 2.5rem);
}
&.hide {
&.expanded {
flex: 30%;
max-width: 30%;
margin-right: 0.5rem;
transition: all ease-out 0.3s;
@include transition();
}
}
/* Large devices (desktops, 992px and up) */
@media (max-width: 992px) {
}
/* Medium devices (tablets, 768px and up) */
@media only screen and (max-width: 768px) {
@include media('<=medium') {
flex: 0%;
max-width: 0%;
min-height: 100vh;
transition: all ease-out 0.3s;
@include transition();
.sidebar-holder {
position: sticky;
top: 2.5rem;
width: 100%;
}
&.hide {
&.expanded {
flex: 40%;
max-width: 40%;
margin-right: 0.5rem;
transition: all ease-out 0.3s;
@include transition();
}
}
/* Small devices (landscape phones, 576px and up) */
@media only screen and (max-width: 576px) {
@include media('<=small') {
width: 100%;
min-height: 0;
max-height: 0;
max-width: 100%;
transition: all ease-out 0.5s;
@include transition();
&.hide {
.sidebar-holder {
max-height: 0;
height: -moz-fit-content;
height: fit-content;
overflow: hidden;
max-width: 100%;
@include transition();
.sidebar {
position: relative;
height: -moz-fit-content;
height: fit-content;
max-height: -moz-fit-content;
max-height: fit-content;
width: 100vw;
min-height: 0;
overflow: hidden;
@include transition();
.sidebar-tree {
margin-left: 0rem;
max-height: 0;
@include transition();
}
}
}
&.expanded {
margin-top: 2rem;
position: relative;
height: -moz-fit-content;
@ -245,55 +233,23 @@
flex: none;
max-height: 300vh;
max-width: 100%;
transition: all ease-out 0.5s;
}
.sidebar-holder {
max-height: 0;
height: -moz-fit-content;
height: fit-content;
overflow: hidden;
max-width: 100%;
transition: all ease-out 0.5s;
}
&.hide .sidebar-holder {
max-height: 200vh;
transition: all ease-out 0.5s;
}
.sidebar {
position: relative;
height: -moz-fit-content;
height: fit-content;
max-height: -moz-fit-content;
max-height: fit-content;
width: 100vw;
min-height: 0;
overflow: hidden;
transition: all ease-out 0.5s;
}
.sidebar-tree {
margin-left: 0rem;
max-height: 0;
transition: all 0.5s ease-out;
}
&.hide .sidebar-tree {
max-height: 200vh;
transition: all 0.5s ease-out;
@include transition();
.sidebar-holder {
max-height: 200vh;
@include transition();
.sidebar-tree {
max-height: 200vh;
@include transition();
}
}
}
}
/* iPhoneX, iPhone 6,7,8 */
@media only screen and (max-width: 375px) {
}
/* Galaxy S5, Moto G4 */
@media only screen and (max-width: 360px) {
}
/* iPhone 5 or before */
@media only screen and (max-width: 320px) {
}
}
}
.feather-plus-circle,
.feather-minus-circle {
width: 1rem;
height: 1rem;
}