@import "variables.scss"; /////////////////////////////////////////////////////// // Shared ////////////////////////////////////////////////////// .meta:nth-child(2n) { background: $shade; } .meta { & > :last-child { margin-bottom: 40px; } & > :first-child, & > h1 { margin-top: 40px; } @include container; contain: content; h1, h2, h3, h4 { text-align: center; transition: transform 0.2s ease-in; transform-origin: 50% 50%; &:hover { text-shadow: 1px 1px 2px var(--text-color); } } h2:hover { transform: none; } .subtitle { text-align: center; } .content:hover, .content.hover { color: $hover-color; } .main-icon { float: right; margin: 60px 0 40px; z-index: 1; } .item { display: flex; flex-direction: column; padding: 10px 0 0; .item-cover { align-self: center; border-radius: 5px; background-color: var(--theme-color); transition: border-radius 0.5s ease-in-out; border: 2px solid transparent; box-sizing: content-box; // Using this to maintain image aspect ratios set in code. &:hover, &.hover { border-radius: 50%; } } h2 { padding: 8px 0; margin: 0; color: var(--text-color); } h3 { margin: 0; padding: 5px 0; color: var(--text-color); } h4 { margin: 0; padding: 3px 0; color: var(--text-color); } .item-icon { align-self: center; min-height: 65px; margin: 5px 0; } .links { align-self: flex-end; flex: 1; display: flex; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; margin: 5px; align-content: flex-end; a { display: flex; align-items: center; min-height: 45px; margin: 5px 0; svg, .link-text { margin: 0 5px; transition: none; } } a:not(:first-child) { margin-left: 10px; } } } } .main-icon:hover, .item-icon:hover, .item-icon.hover, .main-icon.hover { animation: rubberBand 0.5s ease-in-out; } /////////////////////////////////////// // Default type /////////////////////////////////////// .meta.default { .item-cover { width: 100%; height: auto; } .items { grid-row-gap: 40px; } &> img { display: block; margin: 0 auto; max-width: 100%; height: auto; } } ////////////////////////////////////////////////////// // Intro and about me area with image on the left. ////////////////////////////////////////////////////// .left-image { display: grid; grid-template-columns: 1fr 4fr; grid-column-gap: 20px; grid-row-gap: 10px; grid-template-areas: "pic title" "pic subtitle" "pic desc"; img { margin: 40px 0; grid-area: pic; border: 1px solid $divider; background: $divider; // OR filter: drop-shadow(0 -5px 10px rgba(0, 0, 0, 0.3)); width: 100%; height: auto; border-radius: 50%; &:hover { box-shadow: 0 0 10px $divider; } } p { grid-area: desc; } h1 { margin: 40px 0 0; grid-area: title; } .subtitle { grid-area: subtitle; } @include media("<=xl") { grid-template-columns: 1.5fr 3fr; } @include media(">lg") { h1, .subtitle { padding: 0; margin: 0; } h1 { margin-top: 40px; } } @include media("<=lg") { display: block; * { margin: 20px 0; } img { margin: 0 20px 0 0; width: 33%; max-width: 200px; float:left; } } } ////////////////////////////////////////// // Area with content icon on the left ////////////////////////////////////////// .item-icon-left { .item { display: grid; grid-template-columns: 40px 1fr; grid-column-gap: 20px; grid-template-areas: "icon title" "icon subtitle" "icon heading" "icon desc" "icon links"; .item-icon { grid-area: icon; align-self: flex-start; min-height: 40px; } h2 { grid-area: title; } h3 { grid-area: subtitle; } h4 { grid-area: heading; } .content { grid-area: desc; } .links { grid-area: links; } } } /////////////////////////////////////// // Full page Content Section /////////////////////////////////////// .dark .meta.content.with-background { background-image: url($coverDark); } .meta.content { background-attachment: fixed; background-repeat: no-repeat; background-size: cover; height: auto; &.with-background { background-image: url($cover); } &:not(:first-of-type) { flex: 0; } .tags { float: right; display: inline-block; svg { vertical-align: middle; } } .banner { width: 100%; } h1, h2, h3, h4 { text-align: left; } h1:first-of-type { text-align: center; } &>article { @include container-margin; padding: calc(2*var(--content-padding)); background: rgba(var(--background-color-rgb), 0.9); border-radius: 5px; box-shadow: 0 0 2px #ddd; &:hover { background: var(--background-color); } } @include media(">md") { &>article { * { animation: fade-up-item-3 $load-up-duration ease-in-out; } h1 { animation: fade-up-item-1 $load-up-duration ease-in-out; } .subtitle { animation: fade-up-item-2 $load-up-duration ease-in-out; } } } @media (prefers-reduced-motion) { &>article * { animation: none !important; } } } ////////////////////////////////////////// // Full Width for bigger content ////////////////////////////////////////// .meta.full-width { padding: 0; .items { display: block; .item { padding: 40px 0; @include container; display: block; .item-cover { float: left; margin: 0 40px 40px 0; position: relative; z-index: 2; } video.item-cover { background: black; border-color: var(--theme-color); } &:nth-child(2n) { background: $shade; .item-cover { float: right; margin: 0 0 40px 40px; } .links { align-self: flex-start; align-items: flex-start; justify-content: flex-start; } } &:after { content: " "; clear:both; display: block; } .content { padding: 20px 0; } small { display: inline-block; } } } &:nth-child(2n) { .item:nth-child(2n) { background: var(--background-color); } } @include media(".filter-#{$i} { width: calc(var(--max-width)/3 - 50px); margin: 10px; height: auto; transform: none; transition: transform 0.50s ease-out 0.45s, width 0.50s ease-out; } } @include media(".filter-#{$i} { width: calc(var(--max-width) - 50px); height: auto; margin: 10px; transform: none; transition: transform 0.50s ease-out 0.45s, width 0.50s ease-out; } } } .item { width: 0; margin: 0; height: 0; transform: scale(0); transform-origin: 20% 40%; transition: transform 0.5s ease-in, width 0.50s ease-out 0.45s, margin 0.50s ease-out 0.45s, height 0s ease-out 0.45s; } } /////////////////////////////////////// // Centered like Contact US/Quote /////////////////////////////////////// .meta.centered { min-height: 80vh; background-attachment: fixed; background-repeat: no-repeat; background-size: cover; position: relative; display: flex; align-items: center; justify-content: center; .items { background: inherit; } .item { position: relative; background: inherit; overflow: hidden; padding: 20px; border-radius: 5px; &:before { content: " "; position: absolute; top: -25px; left: -25px; bottom: -25px; right: -25px; background: inherit; box-shadow: inset 0 0 0 200px rgba(var(--background-color-rgb), .4); filter: blur(10px); } * { z-index: 5; text-align: center; } } &>.attribution { position: absolute; bottom: -30px; right: 5px; padding: 5px; background: rgba(var(--background-color-rgb), 0.4); border-radius: 2px; color: var(--text-color); } @media (hover: none) { background-attachment: scroll; .items { background: rgba(var(--background-color-rgb), 0.4); } .item { &:before { content: none; } background: transparent; } } } /////////////////////////////////////// // Blog section /////////////////////////////////////// .meta.blog { &>ul { padding: 0; } h3:hover { transform: none } .item { padding: 15px; } } ///////////////////////////////////////// // Alternate image styles ///////////////////////////////////////// .meta.gray-image { .item-cover { filter: contrast(1); transition: filter 0.2s ease-in; &:hover, &.hover { border-radius: 5px; filter: contrast(1.3) brightness(1.1); } } } .meta.keep-width { .item-cover { max-width: 100%; height: auto; } } ///////////////////////////////////////// // Animations ///////////////////////////////////////// @include media(">md") { $duration: 0.8s; .left-image { &>* { transform: translate3d(0, 0, 0); will-change: transform; } &> img { transform: translate3d(0, 0, 0); will-change: transform; } &.visible, &:nth-of-type(1), &:nth-of-type(2) { &>* { transform-origin: center left; animation: bounceInRightNoDelay 1.1s ease-in-out; } &>img { transform-origin: center right; animation: bounceInLeftNoDelay 1.1s ease-in-out; } } } .meta.default, .full-width, .max-2, .blog, .filter, .item-icon-left { &.visible, &:nth-of-type(1), &:nth-of-type(2) { h1, .main-icon { animation: fade-up-item-1 $load-up-duration ease-in-out; } .subtitle { animation: fade-up-item-2 $load-up-duration ease-in-out; } } h1, .main-icon, .subtitle { transform: translate3d(0, 0, 0); will-change: opacity, transform; } } .full-width { .item >* { transform: translate3d(0, 0, 0); will-change: opacity, transform; backface-visibility: hidden; } &:nth-of-type(1) .item:nth-child(2n), &:nth-of-type(2) .item:nth-child(2n), .item.visible:nth-child(2n) { &>* { transform-origin: center right; animation: bounceInLeft $duration ease-in-out; perspective: 1000; } img { transform-origin: center left; animation: bounceInRight $duration ease-in-out; perspective: 1000; } } &:nth-of-type(1) .item:nth-child(2n - 1), &:nth-of-type(2) .item:nth-child(2n - 1), .item.visible:nth-child(2n - 1) { &>* { transform-origin: center left; animation: bounceInRight $duration ease-in-out; } img { transform-origin: center right; animation: bounceInLeft $duration ease-in-out; } } } .max-2 { .item { transform-origin: top center; will-change: opacity, transform; } &:nth-of-type(1) .item, &:nth-of-type(2) .item, .item.visible { &:nth-child(2n) { animation: fade-up-item-2 $load-up-duration ease-in-out; } &:nth-child(2n - 1) { animation: fade-up-item-1 $load-up-duration ease-in-out; } } } .filter, .blog, .meta.default, .item-icon-left { @for $j from 2 through 4 { .items-#{$j} { @for $i from 1 through $j { .item:nth-child(#{$i}) { transform-origin: top center; will-change: opacity, transform; &.visible { animation: fade-up-item-#{$i} $load-up-duration ease-in-out; } } } } &:nth-of-type(1), &:nth-of-type(2) { .items-#{$j} { @for $i from 1 through $j { animation: fade-up-item-#{$i} $load-up-duration ease-in-out; } } } } @each $k in (6, 9) { .items-#{$k} .item { transform-origin: top center; will-change: opacity, transform; } &:nth-of-type(1) .items-#{$k} .item:nth-child(3n+1), &:nth-of-type(2) .items-#{$k} .item:nth-child(3n+1), .items-#{$k} .item:nth-child(3n+1).visible { animation: fade-up-item-1 $load-up-duration ease-in-out; } &:nth-of-type(1) .items-#{$k} .item:nth-child(3n+2), &:nth-of-type(2) .items-#{$k} .item:nth-child(3n+2), .items-#{$k} .item:nth-child(3n+2).visible { animation: fade-up-item-2 $load-up-duration ease-in-out; } &:nth-of-type(1) .items-#{$k} .item:nth-child(3n+3), &:nth-of-type(2) .items-#{$k} .item:nth-child(3n+3), .items-#{$k} .item:nth-child(3n).visible { animation: fade-up-item-3 $load-up-duration ease-in-out; } } } } @media (prefers-reduced-motion) { .meta, .meta * { animation: none !important; } }