Refactor sidebar logic + fix responsiveness

This commit is contained in:
hossainemruz 2020-07-22 03:36:53 +06:00
parent 647578e88b
commit 8ec90ee255
53 changed files with 1712 additions and 671 deletions

View file

@ -3,193 +3,50 @@
padding: 0;
margin: 0;
width: 100%;
overflow: hidden;
}
.sidebar {
width: 400px;
background: #f9fafc;
min-height: 100vh;
overflow: auto;
transition: all ease-out 0.3s;
-webkit-transition: all ease-out 0.3s;
}
.sidebar.hide {
position: relative;
width: 0;
transition: all ease-out 0.3s;
-webkit-transition: all ease-out 0.3s;
z-index: -1001;
}
#search-box {
width: 250px;
height: 35px;
padding-left: 15px;
margin-top: 30px;
margin-bottom: 10px;
border-radius: 5px;
background-color: #e5e9f2;
transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
border: 1px solid #c0ccda;
}
#search-box:focus {
border: 1pt solid #248aaa;
outline: none;
}
.sidebar-tree {
margin-left: 2rem;
margin-top: 2.5rem;
position: fixed;
}
#list-heading {
padding-left: 0px !important;
}
.tree,
.tree ul {
margin: 0;
.content-section {
flex: 80%;
order: 2;
/* background-color: lightseagreen; */
padding: 0;
list-style: none;
}
.tree ul {
margin-left: 0.5rem;
position: relative;
}
.tree ul ul {
margin-left: 0.5em;
}
.tree ul:before {
content: "";
display: block;
width: 0;
position: absolute;
top: -10px;
left: -3px;
bottom: 16px;
border-left: 1px solid;
}
.subtree {
padding-left: 0.7rem;
}
.subtree:before {
content: "";
display: block;
width: 0;
position: absolute;
top: 6.5rem;
left: 0.5rem;
bottom: 16px;
border-left: 1px solid;
}
.tree li {
margin: 0;
padding: 0 1em;
line-height: 2em;
color: #3c4858;
position: relative;
}
.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: 1em;
bottom: 0;
}
.tree li a {
text-decoration: none;
color: #131313;
transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
}
.tree li a:hover {
margin-left: 3px;
color: #2098d1;
transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
}
.tree i {
color: #3c4858;
font-size: 12px;
margin-right: 5px;
}
.tree .shift-right {
margin-left: 5px;
}
.tree ul {
display: none;
}
.tree .expand,
.tree .expand > ul {
display: block;
}
a.focused {
color: #2098d1 !important;
padding-left: 0.5rem;
padding-right: 0.5rem;
}
.content {
width: 100%;
background: #e5e9f2;
padding: 0;
position: relative;
padding-top: 2rem;
min-height: 130vh;
}
.content-cards {
padding-top: 30px;
width: 100%;
padding-left: 28px;
padding-bottom: 20px;
.post-card-holder {
margin-top: 32px;
margin-left: auto;
padding: 0;
display: flex;
flex-flow: wrap;
}
.post-cards {
margin: 32px;
.post-card-holder .post-card {
width: calc(100% / 3);
display: inline-flex;
}
.post-cards .filtr-item {
width: 23rem !important;
}
.post-cards .card {
.post-card-holder .card {
margin: 5px;
position: relative;
}
.post-cards .card .card-footer span {
.post-card-holder .card .card-footer span {
font-size: 10pt;
color: #6c757d !important;
padding-top: 5px;
}
.post-cards .card .card-footer {
.post-card-holder .card .card-footer {
background: #fff;
margin-top: auto;
}
@ -205,20 +62,20 @@ a.focused {
-webkit-box-orient: vertical;
}
.post-cards .post-card-link{
.post-card-holder .post-card-link {
text-decoration: none;
}
.content-cards .paginator{
.content-cards .paginator {
width: fit-content;
margin: auto;
}
.content-cards .paginator .page-item>a{
.content-cards .paginator .page-item > a {
color: #248aaa;
}
.content-cards .paginator .page-item.active>a{
.content-cards .paginator .page-item.active > a {
background-color: #248aaa;
color: #f9fafc;
}
@ -227,60 +84,70 @@ a.focused {
display: none;
}
/*-------------- Media Queries ---------- */
.pagination {
margin-left: auto;
margin-right: auto;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
width: fit-content;
}
@media (max-width: 1200px) {
.sidebar-tree {
margin-left: 1rem;
/* ============= Device specific fixes ======= */
/* Large screens such as TV */
@media only screen and (min-width: 1824px) {
.content-section {
padding-left: 1rem;
padding-right: 1rem;
flex: 85%;
}
.content-cards {
padding-left: 0px;
}
.post-cards {
margin-left: 15px;
}
.post-cards .filtr-item {
width: 22rem !important;
padding: 3px;
.post-card-holder .post-card {
width: calc(100% / 5);
}
}
@media only screen and (max-width: 768px) {
.content {
width: 100vw;
padding-left: 15px;
/* Extra large devices (large desktops, 1200px and up) */
@media (max-width: 1400px) {
.content-cards {
padding-left: 0px;
}
.content.overley {
width: 60vw;
padding-left: 3px;
.post-card-holder {
margin-left: 0px;
}
.post-card-holder .post-card {
width: calc(100% / 3);
}
}
@media (max-width: 1200px) {
}
/* IPad Pro */
@media (max-width: 1024px) {
.wrapper {
padding-left: 0px;
padding-right: 0px;
}
.content-section {
padding: 0;
flex: 60%;
order: 2;
padding-bottom: 0.5rem;
}
.content {
overflow: hidden;
}
.container {
max-width: 100%;
}
.navbar-toggler {
display: block;
}
.sidebar {
width: 0;
}
.sidebar nav {
display: none;
transition: all ease-out 0.3s;
-webkit-transition: all ease-out 0.3s;
}
.sidebar.hide {
position: relative;
z-index: 1001;
width: 40vw;
}
.sidebar-tree {
margin-left: -20rem;
transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
}
.sidebar.hide .sidebar-tree {
margin-left: 1.5rem;
transition: all 0.3s ease-out;
#toc-toggler {
visibility: hidden;
}
.content-cards {
@ -289,85 +156,153 @@ a.focused {
padding-left: 0px;
}
.post-cards {
.post-card-holder {
margin: 0;
margin-top: 32px;
margin-top: 1.5rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
position: relative;
}
.post-cards .filtr-item {
margin: 10px;
width: 47vw !important;
.post-card-holder .post-card {
width: calc(100% / 3);
}
.post-cards .card {
max-width: 47vw !important;
}
.content.overley .post-cards .filtr-item {
margin: 10px;
width: 55vw !important;
}
.content.overley .post-cards .card {
max-width: 55vw !important;
.content-section.hide .post-card-holder .post-card {
width: 50%;
}
}
/* Large devices (desktops, 992px and up) */
@media (max-width: 992px) {
.wrapper {
padding-left: 0px;
padding-right: 0px;
}
.content-section {
padding: 0;
flex: 60%;
order: 2;
padding-bottom: 0.5rem;
}
.content {
overflow: hidden;
}
.container {
max-width: 100%;
}
.navbar-toggler {
display: block;
}
#toc-toggler {
visibility: hidden;
}
.content-cards {
padding-top: 20px;
width: 100%;
padding-left: 0px;
}
.post-card-holder {
margin: 0;
margin-top: 1.5rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
position: relative;
}
.post-card-holder .post-card {
width: 50%;
}
.content-section.hide .post-card-holder .post-card {
width: 100%;
}
}
/* Medium devices (tablets, 768px and up) */
@media only screen and (max-width: 768px) {
.wrapper {
padding-left: 0px;
padding-right: 0px;
}
.content-section {
padding: 0;
flex: 60%;
order: 2;
padding-bottom: 0.5rem;
}
.content {
overflow: hidden;
}
.container {
max-width: 100%;
}
.navbar-toggler {
display: block;
}
#toc-toggler {
visibility: hidden;
}
.content-cards {
padding-top: 20px;
width: 100%;
padding-left: 0px;
}
.post-card-holder {
margin: 0;
margin-top: 1.5rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
position: relative;
}
.post-card-holder .post-card {
width: 50%;
}
.content-section.hide .post-card-holder .post-card {
width: 100%;
}
}
/* Small devices (landscape phones, 576px and up) */
@media only screen and (max-width: 576px) {
.wrapper {
display: block;
padding-left: 0px;
padding-right: 0px;
flex-flow: column;
overflow: hidden;
}
.content-section {
flex: 100%;
padding-left: 0;
width: 100%;
}
#search-box {
width: 85vw;
height: 35px;
padding-left: 5px;
margin-top: 30px;
}
.content {
width: 100vw;
left: 0;
display: block;
padding-left: 2vw;
width: 100%;
padding-left: 0;
padding-right: 0;
}
.content.overley {
width: 100vw;
left: 0;
padding-left: 2vw;
.content-section.hide .content {
margin-top: 0;
padding-top: 0;
}
.sidebar {
position: relative;
max-height: 0;
width: 100vw;
min-height: 0;
overflow: hidden;
transition: all ease-out 0.5s;
-webkit-transition: all ease-out 0.5s;
}
.sidebar-tree {
position: relative;
}
.sidebar.hide {
position: relative;
z-index: 1001;
width: 100vw;
max-height: 100vh;
overflow: hidden;
transition: all ease-out 0.5s;
-webkit-transition: all ease-out 0.5s;
}
.sidebar-tree {
margin-left: 1.5rem;
}
.sidebar.hide .sidebar-tree {
margin-left: 1.5rem;
transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
#toc-toggler {
visibility: hidden;
}
.content-cards {
@ -377,41 +312,34 @@ a.focused {
-webkit-transition: all ease-out 0.5s;
}
.content.overley .content-cards {
padding-top: 0px;
padding-left: 0px;
transition: all ease-out 0.5s;
-webkit-transition: all ease-out 0.5s;
}
.post-cards {
.post-card-holder {
margin: 0;
margin-top: 32px;
margin-top: 1.5rem;
padding-right: 0;
padding-left: 0;
transition: all ease-out 0.5s;
-webkit-transition: all ease-out 0.5s;
}
.content.overley .post-cards {
margin: 0;
transition: all ease-out 0.5s;
-webkit-transition: all ease-out 0.5s;
.post-card-holder.hide {
margin-top: 0;
}
.post-cards .filtr-item {
margin: 0px;
width: 95vw !important;
}
.post-cards .card {
max-width: 90vw !important;
}
.content.overley .post-cards .filtr-item {
margin: 0px;
width: 95vw !important;
}
.content.overley .post-cards .card {
max-width: 95vw !important;
.post-card-holder .post-card {
margin-left: 1%;
margin-right: 1%;
width: 98%;
}
}
/* 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) {
}