Add image variant

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-10-27 11:16:33 +00:00
parent 8524b5af13
commit ca43b64220
27 changed files with 703 additions and 32 deletions

108
assets/css/image/feed.css Normal file
View File

@@ -0,0 +1,108 @@
:root {
--grid-gap: 12px;
}
.post-caption {
display: none;
}
.post-link {
display: block;
}
.post-link:hover {
opacity: 1;
}
.post-lightbox {
position: absolute;
right: 15px;
bottom: 15px;
display: flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
line-height: 30px;
text-align: center;
background-color: var(--color-white);
border-radius: 50%;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
opacity: 0;
transition: opacity 0.2s ease, transform 0.2s ease;
transform: scale(0.8);
}
.post-link:hover+.post-lightbox,
.post-lightbox:hover {
opacity: 1;
transform: scale(1);
}
.post-feed {
margin: 0 auto;
visibility: hidden;
opacity: 0;
transition: opacity 0.3s var(--animation-base);
}
.post-feed.initialized {
visibility: visible;
opacity: 1;
}
.post-feed .grid-item {
position: absolute;
width: 330px;
}
.post-feed .post {
position: relative;
margin: var(--grid-gap);
}
.post-feed .post-image {
width: 100%;
}
@media (max-width: 640px) {
.post-feed {
--grid-gap: 4px;
max-width: calc(100% - (calc(var(--gap) - var(--grid-gap))) * 2);
}
.post-feed .grid-item {
width: 50%;
}
}
@media (min-width: 641px) and (max-width: 1019px) {
.post-feed {
--grid-gap: 8px;
max-width: calc(100% - (calc(var(--gap) - var(--grid-gap))) * 2);
}
.post-feed .grid-item {
width: calc(100% / 3);
}
}
@media (min-width: 1020px) {
.post-feed {
max-width: 990px;
}
}
@media (min-width: 1350px) {
.post-feed {
max-width: 1320px;
}
}
@media (min-width: 1680px) {
.post-feed {
max-width: 1650px;
}
}

19
assets/css/image/main.css Normal file
View File

@@ -0,0 +1,19 @@
@import "@tryghost/shared-theme-assets/assets/css/v1/screen.css";
@import "../common/article.css";
@import "../common/author.css";
@import "../common/gscan.css";
@import "../common/head.css";
@import "../common/pagehead.css";
@import "../common/root.css";
@import "../common/section.css";
@import "../common/tag.css";
@import "../lib/prism.css";
@import "../lib/commento.css";
@import "../lib/tocbot.css";
@import "feed.css";
@import "masonry.css";
@import "pswp.css";
@import "site.css";

View File

@@ -0,0 +1,217 @@
/*
Brother .
https: //github.com/TryGhost/Edge/blob/main/assets/css/general/masonry.css
*/
.flexmasonry {
display: flex;
flex-flow: column wrap;
align-content: space-between;
}
.flexmasonry-item {
width: 100%;
}
.flexmasonry-cols-2 .flexmasonry-item {
width: 50%;
}
.flexmasonry-cols-3 .flexmasonry-item {
width: 33.333%;
}
.flexmasonry-cols-4 .flexmasonry-item {
width: 25%;
}
.flexmasonry-cols-5 .flexmasonry-item {
width: 20%;
}
.flexmasonry-cols-6 .flexmasonry-item {
width: 16.666%;
}
.flexmasonry-cols-7 .flexmasonry-item {
width: 14.285%;
}
.flexmasonry-cols-8 .flexmasonry-item {
width: 12.5%;
}
.flexmasonry-cols-2 .flexmasonry-item:nth-child(2n+1) {
order: 1;
}
.flexmasonry-cols-2 .flexmasonry-item:nth-child(2n) {
order: 2;
}
.flexmasonry-cols-3 .flexmasonry-item:nth-child(3n+1) {
order: 1;
}
.flexmasonry-cols-3 .flexmasonry-item:nth-child(3n+2) {
order: 2;
}
.flexmasonry-cols-3 .flexmasonry-item:nth-child(3n) {
order: 3;
}
.flexmasonry-cols-4 .flexmasonry-item:nth-child(4n+1) {
order: 1;
}
.flexmasonry-cols-4 .flexmasonry-item:nth-child(4n+2) {
order: 2;
}
.flexmasonry-cols-4 .flexmasonry-item:nth-child(4n+3) {
order: 3;
}
.flexmasonry-cols-4 .flexmasonry-item:nth-child(4n) {
order: 4;
}
.flexmasonry-cols-5 .flexmasonry-item:nth-child(5n+1) {
order: 1;
}
.flexmasonry-cols-5 .flexmasonry-item:nth-child(5n+2) {
order: 2;
}
.flexmasonry-cols-5 .flexmasonry-item:nth-child(5n+3) {
order: 3;
}
.flexmasonry-cols-5 .flexmasonry-item:nth-child(5n+4) {
order: 4;
}
.flexmasonry-cols-5 .flexmasonry-item:nth-child(5n) {
order: 5;
}
.flexmasonry-cols-6 .flexmasonry-item:nth-child(6n+1) {
order: 1;
}
.flexmasonry-cols-6 .flexmasonry-item:nth-child(6n+2) {
order: 2;
}
.flexmasonry-cols-6 .flexmasonry-item:nth-child(6n+3) {
order: 3;
}
.flexmasonry-cols-6 .flexmasonry-item:nth-child(6n+4) {
order: 4;
}
.flexmasonry-cols-6 .flexmasonry-item:nth-child(6n+5) {
order: 5;
}
.flexmasonry-cols-6 .flexmasonry-item:nth-child(6n) {
order: 6;
}
.flexmasonry-cols-7 .flexmasonry-item:nth-child(7n+1) {
order: 1;
}
.flexmasonry-cols-7 .flexmasonry-item:nth-child(7n+2) {
order: 2;
}
.flexmasonry-cols-7 .flexmasonry-item:nth-child(7n+3) {
order: 3;
}
.flexmasonry-cols-7 .flexmasonry-item:nth-child(7n+4) {
order: 4;
}
.flexmasonry-cols-7 .flexmasonry-item:nth-child(7n+5) {
order: 5;
}
.flexmasonry-cols-7 .flexmasonry-item:nth-child(7n+6) {
order: 6;
}
.flexmasonry-cols-7 .flexmasonry-item:nth-child(7n) {
order: 7;
}
.flexmasonry-cols-8 .flexmasonry-item:nth-child(8n+1) {
order: 1;
}
.flexmasonry-cols-8 .flexmasonry-item:nth-child(8n+2) {
order: 2;
}
.flexmasonry-cols-8 .flexmasonry-item:nth-child(8n+3) {
order: 3;
}
.flexmasonry-cols-8 .flexmasonry-item:nth-child(8n+4) {
order: 4;
}
.flexmasonry-cols-8 .flexmasonry-item:nth-child(8n+5) {
order: 5;
}
.flexmasonry-cols-8 .flexmasonry-item:nth-child(8n+6) {
order: 6;
}
.flexmasonry-cols-8 .flexmasonry-item:nth-child(8n+7) {
order: 7;
}
.flexmasonry-cols-8 .flexmasonry-item:nth-child(8n) {
order: 8;
}
.flexmasonry-break {
flex-basis: 100%;
width: 0 !important;
margin: 0;
content: "";
}
.flexmasonry-break-1 {
order: 1;
}
.flexmasonry-break-2 {
order: 2;
}
.flexmasonry-break-3 {
order: 3;
}
.flexmasonry-break-4 {
order: 4;
}
.flexmasonry-break-5 {
order: 5;
}
.flexmasonry-break-6 {
order: 6;
}
.flexmasonry-break-7 {
order: 7;
}

73
assets/css/image/pswp.css Normal file
View File

@@ -0,0 +1,73 @@
/*
I don't know either man
https: //github.com/TryGhost/Themes/blob/main/packages/_shared/assets/css/v1/vendor/pswp.css
*/
.pswp__bg {
background: rgba(255, 255, 255, 0.9);
}
.pswp__caption__center {
color: var(--color-darker-gray);
}
.pswp__button,
.pswp__button--arrow--left::before,
.pswp__button--arrow--right::before {
background: url("/assets/images/default-skin.png") 0 0 no-repeat;
background-size: 264px 88px;
}
@media (-webkit-min-device-pixel-ratio: 1.1),
(-webkit-min-device-pixel-ratio: 1.09375),
(min-resolution: 105dpi),
(min-resolution: 1.1dppx) {
.pswp--svg .pswp__button,
.pswp--svg .pswp__button--arrow--left::before,
.pswp--svg .pswp__button--arrow--right::before {
background-image: url("/assets/images/default-skin.svg");
}
.pswp--svg .pswp__button--arrow--left,
.pswp--svg .pswp__button--arrow--right {
background: none;
}
}
.pswp__button--arrow--left,
.pswp__button--arrow--right {
background: none;
}
.pswp__button--close {
background-position: 0 -44px;
}
.pswp__button--share {
background-position: -44px -44px;
}
.pswp--fs .pswp__button--fs {
background-position: -44px 0;
}
.pswp__button--zoom {
background-position: -88px 0;
}
.pswp--zoomed-in .pswp__button--zoom {
background-position: -132px 0;
}
.pswp__button--arrow--left::before {
background-position: -138px -44px;
}
.pswp__button--arrow--right::before {
background-position: -94px -44px;
}
.pswp__preloader--active .pswp__preloader__icn {
background: url("/assets/images/preloader.gif") 0 0 no-repeat;
}

18
assets/css/image/site.css Normal file
View File

@@ -0,0 +1,18 @@
.gh-site {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.gh-site-content {
flex-grow: 1;
padding: 48px 0 96px;
}
.gh-main {
padding-top: 0;
}
.gh-feed {
width: 100%;
}