Refactor single page css

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
hossainemruz 2023-09-28 00:57:09 +06:00
parent dfeaea8b26
commit b34c6860be
5 changed files with 362 additions and 477 deletions

View file

@ -50,7 +50,6 @@
color: #8392a5; color: #8392a5;
} }
.tags { .tags {
text-align: left; text-align: left;
@ -66,3 +65,30 @@
color: #f9fafc; color: #f9fafc;
} }
} }
.icon-button {
background-color: #3c4858;
color: #e5e9f2 !important;
padding: 0.25rem 0.5rem;
line-height: 1.5;
border-radius: 0.2rem;
border: none;
&:hover,
&:focus {
background-color: #248aaa !important;
transition: all 0.3s ease-out !important;
}
}
.filled-button {
color: #f9fafc !important;
background-color: #248aaa !important;
transition: all 0.3s ease-out;
&:hover,
&:active {
background-color: #0cafe1 !important;
transition: all 0.3 ease-out;
}
}

View file

@ -2,10 +2,6 @@ body.kind-page {
background-color: #e5e9f2; background-color: #e5e9f2;
position: relative; position: relative;
.read-area {
background-color: #f9fafc;
}
.wrapper { .wrapper {
display: flex; display: flex;
padding: 0; padding: 0;
@ -13,269 +9,186 @@ body.kind-page {
width: 100%; width: 100%;
justify-content: space-between; justify-content: space-between;
position: relative; position: relative;
}
.content-section { .content-section {
flex: 60%; flex: 60%;
max-width: 60%; max-width: 60%;
order: 2; order: 2;
/* background-color: lightseagreen; */ padding: 0;
padding: 0; position: relative;
position: relative; padding-left: 1rem;
padding-left: 1rem; padding-right: 1rem;
padding-right: 1rem;
}
.content {
background: #e5e9f2;
}
.toc-section {
flex: 20%;
order: 3;
max-width: 20%;
/* background-color: lightpink; */
transition: all ease-out 0.5s;
}
.toc-holder { .content {
position: sticky; background: #e5e9f2;
top: 4.5rem; padding-top: 1.5rem;
overflow-x: hidden;
overflow-y: auto;
background-color: #f9fafc;
margin-right: 0.5rem;
/* box-shadow: 0px 8px 56px rgba(15, 80, 100, 0.16); */
transition: all ease-out 0.3s;
}
.toc { .read-area {
position: relative; background-color: #f9fafc;
padding-top: 0px;
transition: all ease-out 0.3s;
}
.toc nav { .hero-area {
padding-top: 0px; margin-top: 3rem;
margin-top: 0px; width: 100%;
display: flex; height: 400px;
flex-direction: column; background-position: center;
align-items: flex-start; background-repeat: no-repeat;
transition: all ease-out 0.3s; background-size: cover;
} }
.toc ul { .page-content {
list-style: none; width: 100%;
padding-left: 0.5rem; position: relative;
margin-bottom: 0rem; top: -4.5rem;
width: 100%; padding: 15px;
}
.toc .nav-link { .author-profile {
padding: 0; position: relative;
padding-left: 0.5rem; align-content: center;
transition: all ease-out 0.3s; text-align: center;
color: #1c2d41;
}
.toc .nav-link:hover, .author-name {
.toc .nav-link:focus, margin-top: 0px;
.toc .nav-link.active { }
padding-left: 1rem;
padding-right: 0.5rem;
background-color: #248aaa;
color: #f9f9f9;
transition: all ease-out 0.3s;
}
.hero-area { img {
margin-top: 3rem; height: 120px;
width: 100%; width: 120px;
height: 400px; -o-object-fit: cover;
background-position: center; object-fit: cover;
background-repeat: no-repeat; background-color: #f9fafc;
background-size: cover; padding: 5px;
} }
p {
color: #8392a5;
}
}
.page-content { .title {
width: 100%; text-align: center;
position: relative; }
top: -4.5rem; .tags {
padding: 15px; text-align: center;
} }
.author-profile { .post-content {
position: relative; padding: 15px;
align-content: center;
text-align: center;
}
.author-name { h1,
margin-top: 0px; h2 {
} margin-top: 1.4rem;
}
.author-profile img { h3,
height: 120px; h4,
width: 120px; h5,
-o-object-fit: cover; h6 {
object-fit: cover; margin-top: 1.3rem;
background-color: #f9fafc; }
padding: 5px;
}
.author-profile p {
color: #8392a5;
}
.title { blockquote {
text-align: center; border-left: 4px solid #248aaa;
} background-color: #248baa15;
padding: 0.3rem;
padding-left: 1rem;
.post-content { & > p {
padding: 15px; color: #3c4858;
} margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
}
}
.post-content h1, .next-prev-navigator {
h2 { padding-left: 1rem !important;
margin-top: 1.4rem; padding-right: 1rem !important;
}
.post-content h3, .next-article {
h4, text-align: right;
h5, }
h6 {
margin-top: 1.3rem;
}
.post-content blockquote { .next-prev-text {
border-left: 4px solid #248aaa; white-space: break-spaces;
background-color: #248baa15; }
padding: 0.3rem; }
padding-left: 1rem; }
} }
}
}
.post-content blockquote > p { .toc-section {
color: #3c4858; flex: 20%;
margin-top: 0.5rem; order: 3;
margin-bottom: 0.5rem; max-width: 20%;
} transition: all ease-out 0.5s;
.next-prev-navigator { .toc-holder {
padding-left: 10px; position: sticky;
padding-right: 10px; top: 4.5rem;
} padding-top: 1rem;
overflow-x: hidden;
overflow-y: auto;
background-color: #f9fafc;
margin-right: 0.5rem;
transition: all ease-out 0.3s;
.next-prev-navigator a { .toc {
color: #2098d1; position: relative;
transition: all 0.3s ease-out; padding-top: 0px;
} transition: all ease-out 0.3s;
.next-prev-navigator a:hover { nav {
color: #3c4858; padding-top: 0px;
transition: all 0.3 ease-out; margin-top: 0px;
} display: flex;
flex-direction: column;
align-items: flex-start;
transition: all ease-out 0.3s;
.next-prev-navigator .next-article { ul {
text-align: right; list-style: none;
} padding-left: 0.5rem;
margin-bottom: 0rem;
width: 100%;
}
.next-prev-navigator .next-article a { .nav-link {
transition: all 0.3s ease-out; padding: 0;
} padding-left: 0.5rem;
transition: all ease-out 0.3s;
color: #1c2d41;
.next-prev-navigator .previous-article a { &:hover,
transition: all 0.3s ease-out; &:focus,
} &.active {
padding-left: 1rem;
padding-right: 0.5rem;
background-color: #248aaa;
color: #f9f9f9;
transition: all ease-out 0.3s;
}
}
}
}
}
}
.next-prev-navigator .btn-outline-info { .disquss {
color: #f9fafc !important; padding: 10px;
border-color: #e5e9f2 !important; }
background-color: #248aaa !important;
transition: all 0.3s ease-out;
}
.next-prev-navigator .next-prev-text { .share-buttons {
white-space: break-spaces; @include brand-background();
} .btn {
border: none !important;
.next-prev-navigator .btn-outline-info:hover { }
color: #3c4858 !important; }
background-color: #e5e9f2 !important;
transition: all 0.3s ease-out;
}
.disquss {
padding: 10px;
}
.share-buttons .btn {
color: #e5e9f2 !important;
transition: all 0.3s ease-out !important;
}
.share-buttons .btn:hover,
.share-buttons .btn:focus {
background-color: #248aaa !important;
border-color: #248aaa !important;
transition: all 0.3s ease-out !important;
}
.share-buttons .facebook-btn {
background-color: #4267b2 !important;
border-color: #4267b2 !important;
}
.share-buttons .twitter-btn {
background-color: #1da1f2 !important;
border-color: #1da1f2 !important;
}
.share-buttons .reddit-btn {
background-color: #ff4500 !important;
border-color: #ff4500 !important;
}
.share-buttons .tumblr-btn {
background-color: #34465d !important;
border-color: #34465d !important;
}
.share-buttons .pocket-btn {
background-color: #ef4056 !important;
border-color: #ef4056 !important;
}
.share-buttons .linkedin-btn {
background-color: #2867b2 !important;
border-color: #2867b2 !important;
}
.share-buttons .diaspora-btn {
background-color: #3c4858 !important;
border-color: #3c4858 !important;
}
.share-buttons .mastodon-btn {
background-color: #2791da !important;
border-color: #2791da !important;
}
.share-buttons .whatsapp-btn {
background-color: #4ac959 !important;
border-color: #4ac959 !important;
}
.share-buttons .email-btn {
background-color: #3c4858 !important;
border-color: #3c4858 !important;
transition: all 0.3s ease-out !important;
} }
.btn-improve-page { .btn-improve-page {
text-align: right; text-align: right;
} }
.languageSelector {
display: none;
}
#scroll-to-top { #scroll-to-top {
position: fixed; position: fixed;
bottom: 0rem; bottom: 0rem;
@ -284,29 +197,22 @@ body.kind-page {
font-size: 24pt; font-size: 24pt;
z-index: 900000; z-index: 900000;
visibility: hidden; visibility: hidden;
&:hover {
color: #2098d1;
}
&.show {
visibility: visible;
}
i {
box-shadow: 0px 8px 56px rgba(15, 80, 100, 0.16);
background-color: #f9f9f9;
border-radius: 50%;
}
} }
#scroll-to-top i { @include media('<=ultra-large') {
box-shadow: 0px 8px 56px rgba(15, 80, 100, 0.16);
background-color: #f9f9f9;
border-radius: 50%;
}
#scroll-to-top:hover {
color: #2098d1;
}
#scroll-to-top.show {
visibility: visible;
}
.tags {
text-align: center;
}
/* ============= Device specific fixes ======= */
/* Large screens such as TV */
@media only screen and (min-width: 1824px) {
.content-section { .content-section {
flex: 65%; flex: 65%;
max-width: 65%; max-width: 65%;
@ -316,190 +222,116 @@ body.kind-page {
} }
} }
/* Extra large devices (large desktops, 1200px and up) */ @include media('<=large') {
@media (max-width: 1400px) {
}
@media (max-width: 1200px) {
}
/* IPad Pro */
@media (max-width: 1024px) {
.wrapper {
padding-left: 0px;
padding-right: 0px;
}
.content-section {
padding: 0;
flex: 60%;
max-width: 100%;
order: 2;
overflow: hidden;
}
.content {
overflow: hidden;
}
.container { .container {
max-width: 100%; max-width: 100%;
} }
.toc-section { .wrapper {
order: 3; padding-left: 0px;
flex: 0%; padding-right: 0px;
max-width: 0%;
transition: all ease-out 0.3s;
}
.toc-section.hide {
flex: 40%;
max-width: 40%;
margin-left: 0.5rem;
transition: all ease-out 0.3s;
}
.toc-holder { .content-section {
top: 3rem; padding: 0;
max-height: calc(100vh - 3rem); flex: 60%;
} max-width: 100%;
order: 2;
overflow: hidden;
.navbar-toggler { .content {
display: block; overflow: hidden;
}
.navbar-collapse.lang-selector { .read-area {
display: none; .hero-area {
} height: 300px;
margin-top: 1rem;
}
.languageSelector { .page-content {
display: block; padding: 0px;
} }
}
}
}
.toc-section {
display: none;
}
.hero-area { .share-buttons {
height: 300px; max-width: 48%;
margin-top: 1rem; }
}
.page-content { .btn-improve-page {
padding: 0px; margin-right: 1rem;
} max-width: 48%;
}
.btn-improve-page { #disqus_thread,
margin-right: 1rem; .dsq-brlink {
} padding: 5px;
}
#disqus_thread,
.dsq-brlink {
padding: 5px;
} }
} }
/* Large devices (desktops, 992px and up) */ @include media('<=small') {
@media (max-width: 992px) {
}
/* Medium devices (tablets, 768px and up) */
@media only screen and (max-width: 768px) {
#scroll-to-top {
right: 8rem;
}
}
/* Small devices (landscape phones, 576px and up) */
@media only screen and (max-width: 576px) {
.wrapper { .wrapper {
padding: 0px; padding: 0px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
}
.content-section { .content-section {
padding: 0; padding: 0;
flex: 100%; flex: 100%;
max-width: 100%; max-width: 100%;
order: 3; order: 3;
}
.toc-section { .content {
order: 2; .read-area {
width: 100%; .hero-area {
height: -moz-fit-content; height: 200px;
height: fit-content; margin-top: 1rem;
max-height: 0; }
max-width: 100%;
transition: all ease-out 0.5s;
}
.toc-section.hide { .page-content {
margin-top: 2.5rem; padding: 0px;
position: relative; .next-prev-navigator {
/* height: fit-content; */ .previous-article {
flex: 100%; text-align: center;
height: -moz-fit-content; margin: 5px;
height: fit-content;
max-height: 200vh;
max-width: 100%;
margin-left: 0;
padding-right: 0;
box-shadow: 0px 8px 56px rgba(15, 80, 100, 0.16);
transition: all ease-out 0.5s;
}
.toc-holder { a {
max-height: 0; width: 100%;
margin-right: 0; }
overflow: hidden; }
transition: all ease-out 0.5s; .next-article {
} text-align: center;
.toc-section.hide .toc-holder { margin: 5px;
max-height: 200vh; a {
transition: all ease-out 0.5s; width: 100%;
} }
}
}
}
}
}
}
.share-buttons {
max-width: 100%;
}
.navbar-toggler { .btn-improve-page {
display: block; text-align: start;
} max-width: 100%;
}
.hero-area { #scroll-to-top {
height: 200px; right: 0.5rem;
margin-top: 1rem; }
}
.page-content { #disqus_thread,
padding: 0px; .dsq-brlink {
padding: 5px;
}
} }
.next-prev-navigator .previous-article {
text-align: center;
margin: 5px;
}
.next-prev-navigator .next-article {
text-align: center;
margin: 5px;
}
.previous-article a,
.next-article a {
width: 100%;
}
#disqus_thread,
.dsq-brlink {
padding: 5px;
}
}
/* 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) {
} }
} }

View file

@ -1,3 +1,5 @@
@use 'sass:map';
$breakpoints: ( $breakpoints: (
tiny: 320px, tiny: 320px,
small: 640px, small: 640px,
@ -8,10 +10,35 @@ $breakpoints: (
ultra-large: 2560px, ultra-large: 2560px,
); );
@mixin section-title-adjustment(){ $brand-colors: (
'facebook': #3b5998,
'twitter': #1da1f2,
'linkedin': #0077b5,
'reddit': #ff4500,
'tumblr': #35465c,
'pocket': #ef4056,
'diaspora': #1e1e1e,
'whatsapp': #25d366,
);
@mixin reset-list {
margin: 0;
padding: 0;
list-style: none;
}
@mixin section-title-adjustment() {
h1 > span { h1 > span {
margin-top: -55px; /* Size of fixed header */ margin-top: -55px; /* Size of fixed header */
padding-bottom: 55px; padding-bottom: 55px;
display: block; display: block;
} }
} }
@mixin brand-background() {
@each $brand, $color in $brand-colors {
.bg-#{$brand} {
background-color: $color;
}
}
}

View file

@ -55,56 +55,56 @@
<!-- Share or Contribute --> <!-- Share or Contribute -->
<div class="row pl-3 pr-3"> <div class="row pl-3 pr-3">
<!--Social Media Share Buttons--> <!--Social Media Share Buttons-->
<div class="col-md-6 share-buttons"> <div class="col-md-6 share-buttons">
{{ if site.Params.features.blog.shareButtons }} {{ if site.Params.features.blog.shareButtons }}
<strong>{{ i18n "share_on" }}:</strong> <strong>{{ i18n "share_on" }}:</strong>
{{ if site.Params.features.blog.shareButtons.facebook }} {{ if site.Params.features.blog.shareButtons.facebook }}
<a class="btn btn-sm facebook-btn" href="https://www.facebook.com/sharer.php?u={{ .Permalink }}" target="_blank"> <a class="btn icon-button bg-facebook" href="https://www.facebook.com/sharer.php?u={{ .Permalink }}" target="_blank">
<i class="fab fa-facebook"></i> <i class="fab fa-facebook"></i>
</a> </a>
{{ end }} {{ end }}
{{ if site.Params.features.blog.shareButtons.twitter }} {{ if site.Params.features.blog.shareButtons.twitter }}
<a class="btn btn-sm twitter-btn" href="https://twitter.com/share?url={{ .Permalink }}&text={{ .Title }}&via={{- site.Title -}}" target="_blank"> <a class="btn icon-button bg-twitter" href="https://twitter.com/share?url={{ .Permalink }}&text={{ .Title }}&via={{- site.Title -}}" target="_blank">
<i class="fab fa-twitter"></i> <i class="fab fa-twitter"></i>
</a> </a>
{{ end }} {{ end }}
{{ if site.Params.features.blog.shareButtons.reddit }} {{ if site.Params.features.blog.shareButtons.reddit }}
<a class="btn btn-sm reddit-btn" href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" target="_blank"> <a class="btn icon-button bg-reddit" href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" target="_blank">
<i class="fab fa-reddit"></i> <i class="fab fa-reddit"></i>
</a> </a>
{{ end }} {{ end }}
{{ if site.Params.features.blog.shareButtons.tumblr }} {{ if site.Params.features.blog.shareButtons.tumblr }}
<a class="btn btn-sm tumblr-btn" href="https://www.tumblr.com/share/link?url={{ .Permalink }}&name={{ .Title }}{{- with .Params.description -}}&description={{- . -}}{{- end -}}" target="_blank"> <a class="btn icon-button bg-tumblr" href="https://www.tumblr.com/share/link?url={{ .Permalink }}&name={{ .Title }}{{- with .Params.description -}}&description={{- . -}}{{- end -}}" target="_blank">
<i class="fab fa-tumblr"></i> <i class="fab fa-tumblr"></i>
</a> </a>
{{ end }} {{ end }}
{{ if site.Params.features.blog.shareButtons.pocket }} {{ if site.Params.features.blog.shareButtons.pocket }}
<a class="btn btn-sm pocket-btn" href="https://getpocket.com/save?url={{ .Permalink }}&title={{ .Title }}" target="_blank"> <a class="btn icon-button bg-pocket" href="https://getpocket.com/save?url={{ .Permalink }}&title={{ .Title }}" target="_blank">
<i class="fab fa-get-pocket"></i> <i class="fab fa-get-pocket"></i>
</a> </a>
{{ end }} {{ end }}
{{ if site.Params.features.blog.shareButtons.linkedin }} {{ if site.Params.features.blog.shareButtons.linkedin }}
<a class="btn btn-sm linkedin-btn" href="https://www.linkedin.com/shareArticle?url={{ .Permalink }}&title={{ .Title }}" target="_blank"> <a class="btn icon-button bg-linkedin" href="https://www.linkedin.com/shareArticle?url={{ .Permalink }}&title={{ .Title }}" target="_blank">
<i class="fab fa-linkedin"></i> <i class="fab fa-linkedin"></i>
</a> </a>
{{ end }} {{ end }}
{{ if site.Params.features.blog.shareButtons.diaspora }} {{ if site.Params.features.blog.shareButtons.diaspora }}
<a class="btn btn-sm diaspora-btn" href="https://share.diasporafoundation.org/?title={{ .Title }}&url={{ .Permalink }}" rel="nofollow" target="_blank"> <a class="btn icon-button bg-diaspora" href="https://share.diasporafoundation.org/?title={{ .Title }}&url={{ .Permalink }}" rel="nofollow" target="_blank">
<i class="fab fa-diaspora"></i> <i class="fab fa-diaspora"></i>
</a> </a>
{{ end }} {{ end }}
{{ if site.Params.features.blog.shareButtons.mastodon }} {{ if site.Params.features.blog.shareButtons.mastodon }}
<a class="btn btn-sm mastodon-btn" href="https://mastodon.social/share?text={{ .Title }} - {{ .Permalink }}" target="_blank"> <a class="btn icon-button bg-mastodon" href="https://mastodon.social/share?text={{ .Title }} - {{ .Permalink }}" target="_blank">
<i class="fab fa-mastodon"></i> <i class="fab fa-mastodon"></i>
</a> </a>
{{ end }} {{ end }}
{{ if site.Params.features.blog.shareButtons.whatsapp }} {{ if site.Params.features.blog.shareButtons.whatsapp }}
<a class="btn btn-sm whatsapp-btn" href="https://api.whatsapp.com/send?text={{ .Title }} {{ .Permalink }}" target="_blank"> <a class="btn icon-button bg-whatsapp" href="https://api.whatsapp.com/send?text={{ .Title }} {{ .Permalink }}" target="_blank">
<i class="fab fa-whatsapp"></i> <i class="fab fa-whatsapp"></i>
</a> </a>
{{ end }} {{ end }}
{{ if site.Params.features.blog.shareButtons.email }} {{ if site.Params.features.blog.shareButtons.email }}
<a class="btn btn-sm email-btn" href="mailto:?subject={{ .Title }}&body={{ .Permalink }}" target="_blank"> <a class="btn icon-button" href="mailto:?subject={{ .Title }}&body={{ .Permalink }}" target="_blank">
<i class="fas fa-envelope-open-text"></i> <i class="fas fa-envelope-open-text"></i>
</a> </a>
{{ end }} {{ end }}

View file

@ -22,7 +22,7 @@
<div class="row next-prev-navigator"> <div class="row next-prev-navigator">
{{ if $prevPage }} {{ if $prevPage }}
<div class="col-md-6 previous-article"> <div class="col-md-6 previous-article">
<a href="{{ $prevPage.RelPermalink }}" title="{{ $prevPage.Title }}" class="btn btn-outline-info"> <a href="{{ $prevPage.RelPermalink }}" title="{{ $prevPage.Title }}" class="btn filled-button">
<div><i class="fas fa-chevron-circle-left"></i> {{ i18n "prev" }}</div> <div><i class="fas fa-chevron-circle-left"></i> {{ i18n "prev" }}</div>
<div class="next-prev-text">{{ $prevPage.Title }}</div> <div class="next-prev-text">{{ $prevPage.Title }}</div>
</a> </a>
@ -34,7 +34,7 @@
{{ $columnWidth = "col-md-6" }} {{ $columnWidth = "col-md-6" }}
{{ end}} {{ end}}
<div class="{{ $columnWidth }} next-article"> <div class="{{ $columnWidth }} next-article">
<a href="{{ $nextPage.RelPermalink }}" title="{{ $nextPage.Title }}" class="btn btn-outline-info"> <a href="{{ $nextPage.RelPermalink }}" title="{{ $nextPage.Title }}" class="btn filled-button">
<div>{{ i18n "next" }} <i class="fas fa-chevron-circle-right"></i></div> <div>{{ i18n "next" }} <i class="fas fa-chevron-circle-right"></i></div>
<div class="next-prev-text">{{ $nextPage.Title }}</div> <div class="next-prev-text">{{ $nextPage.Title }}</div>
</a> </a>