ldc-le-gaulois-pro/resources/sass/components/_cards.scss
2023-06-20 12:59:49 +00:00

514 lines
13 KiB
SCSS

$svg-engag-width: 110px;
$width-card-adn: 350px;
$width-card-story: 250px;
$width-card-footer: 350px;
$width-card-btob: 248px;
$width-card-simple: 340px;
$width-card-ranges: 290px;
$width-card-swiper: 312px;
$width-card-id: 355px;
$width-card-posts: 280px;
$width-card-product: 334px;
$width-card-product-sm: 302px;
$width-card-prod-recipe: 312px;
$width-card-prod-adn: 351px;
.card-wrapper {
.card-title.marged { height: calc(1.2 * 16px * 2); }
}
.card-id {
$border: 2px;
max-width: $width-card-id;
padding: $border;
background: linear-gradient(0.5turn, #333, #fff, #333);
.card { background-color: $color-bg-dropmenu; }
.card-img-top { width: 80px; }
}
.card-engag {
min-width: 150px;
background-color: transparent;
.card {
border: unset;
background-color: transparent;
}
.card-img-top {
width: $svg-engag-width;
}
}
.card-swiper {
@include size-fract($width-card-swiper, 4 / 3);
background: no-repeat center/cover url("~@/images/fond-inox.jpg");
.card-img-wrapper { z-index: 1; }
svg + div { clip-path: url("#svgClip"); }
.card-img-top { translate: 0 -19%; }
.card-body { height: 40%; }
.card-body::after {
position: absolute;
bottom: calc(100% - 14px);
left: 0;
width: $width-card-swiper;
height: 34px;
background: no-repeat center/cover url("~@/images/separate-blue-312-horizontal.png");
content: "";
}
}
.card-btob {
@include size-fract($width-card-btob, 0.81);
cursor: default;
pointer-events: none;
.card-img-wrapper {
z-index: 1;
padding: 2rem 2rem 2.5rem;
background: no-repeat center/cover url("~@/images/fond-ardoise.jpg");
}
.card-img,
.card-img-top,
.card-img-bottom {
width: unset;
}
.separator { bottom: -2px; }
}
.card-simple {
@include size-fract($width-card-simple, 340 / 349);
background-color: $color-bg-dropmenu;
.separator {
bottom: -2px;
left: 0;
}
}
.card-ranges {
@include size-fract($width-card-ranges, 29 / 32);
.card-img-top {
scale: 1;
transition: scale 0.3s ease-in-out;
}
&:hover .card-img-top { scale: 1.2; }
.card-shadow-wrapper {
background-color: rgb(0 0 0 / 40%);
opacity: 0;
transition: visibility 0s ease-in-out, opacity 0.3s ease-in-out;
visibility: hidden;
}
&:hover .card-shadow-wrapper {
opacity: 1;
visibility: visible;
}
.butn-wrap {
transition: translate 0.3s ease-in-out;
translate: 0 75%;
}
&:hover .butn-wrap { translate: 0; }
.separator {
bottom: -2px;
left: 0;
}
}
%prod {
z-index: 1;
&:hover .card-img-top { scale: 1.2; }
&:hover .card-shadow-wrapper {
opacity: 1;
visibility: visible;
}
&:hover .butn-wrap { translate: 0; }
.card-img-top {
scale: 1;
transition: scale 0.3s ease-in-out;
}
.card-shadow-wrapper {
background-color: rgb(0 0 0 / 40%);
opacity: 0;
transition: visibility 0s ease-in-out, opacity 0.3s ease-in-out;
visibility: hidden;
}
.butn-wrap {
transition: translate 0.3s ease-in-out;
translate: 0 75%;
}
}
.card-product {
@extend %prod;
@include size-fract($width-card-product, 2.35);
&-sm { @include size-fract($width-card-product-sm, 2.35); }
.card-subtitle {
$nblines: 3;
@include txt-overflow-fade($nblines, 18px, 1.2, $color-bg-dropmenu);
}
}
.card-prod-recipe {
@extend %prod;
@include size-fract($width-card-prod-recipe, 2.35);
.card-subtitle {
$nblines: 3;
@include txt-overflow-fade($nblines, 18px, 1.2, $color-bg-dropmenu);
}
}
.card-posts {
width: $width-card-posts;
a:hover { color: $text-color; }
.card-img-wrapper {
z-index: 1;
max-height: 226px;
img {
max-height: 226px;
object-fit: cover;
}
}
.separator {
bottom: -0.8rem;
left: 0;
}
.card-title {
$nblines: 1;
@include txt-overflow-fade($nblines, 18px, var(--bs-body-line-height));
text-overflow: ellipsis;
white-space: nowrap;
}
.card-subtitle {
$nblines: 2;
@include txt-overflow-fade($nblines, 1rem, var(--bs-body-line-height), $color-bg-dropmenu);
}
}
%adn {
&:hover .card-img-top { scale: 1.2; }
.card-img-top {
scale: 1;
transition: scale 0.3s ease-in-out;
}
.card-title { margin: 1rem 0; }
.butn-prim {
padding: 0.5rem 1.5rem;
font-size: 12px;
}
}
.card-adn {
@extend %adn;
@include size-fract($width-card-adn, 350 / 174);
.card-subtitle {
$nblines: 3;
@include txt-overflow-fade($nblines, 12px, 1.2, $color-bg-dropmenu);
}
}
.card-adn-sm {
@include size-fract($width-card-adn, 350 / 81);
.card-subtitle {
$nblines: 2;
@include txt-overflow-fade($nblines, 12px, 1.2, $color-bg-dropmenu);
}
}
.card-adn-recipe {
@extend %adn;
@include size-fract($width-card-adn, 2.64);
.card-subtitle {
$nblines: 3;
@include txt-overflow-fade($nblines, 12px, 1.2, $color-bg-dropmenu);
}
}
.card-story {
@include size-fract($width-card-story, 1 / 2);
.card-separator {
top: 47%;
right: 44%;
rotate: 90deg;
}
.card-subtitle {
$nblines: 6;
@include txt-overflow-fade($nblines, 1rem, var(--bs-body-line-height), $color-bg-dropmenu);
}
}
.card-footer {
$border: 2px;
width: $width-card-footer;
padding: $border;
background: linear-gradient(0.25turn, #333, #fff, #333);
.engag-start { height: calc($width-card-footer * 3 / 4); }
.card-sep-mobile { width: calc(100% + 2rem); }
.card-sep-desktop { display: none; }
}
// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM
// SS:::::::::::::::SM:::::::M M:::::::M
// S:::::SSSSSS::::::SM::::::::M M::::::::M
// S:::::S SSSSSSSM:::::::::M M:::::::::M
// S:::::S M::::::::::M M::::::::::M
// S:::::S M:::::::::::M M:::::::::::M
// S::::SSSS M:::::::M::::M M::::M:::::::M
// SS::::::SSSSS M::::::M M::::M M::::M M::::::M
// SSS::::::::SS M::::::M M::::M::::M M::::::M
// SSSSSS::::S M::::::M M:::::::M M::::::M
// S:::::SM::::::M M:::::M M::::::M
// S:::::SM::::::M MMMMM M::::::M
// SSSSSSS S:::::SM::::::M M::::::M
// S::::::SSSSSS:::::SM::::::M M::::::M
// S:::::::::::::::SS M::::::M M::::::M
// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM
@include media-breakpoint-up(sm) { // >= 576px
}
// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD
// M:::::::M M:::::::MD::::::::::::DDD
// M::::::::M M::::::::MD:::::::::::::::DD
// M:::::::::M M:::::::::MDDD:::::DDDDD:::::D
// M::::::::::M M::::::::::M D:::::D D:::::D
// M:::::::::::M M:::::::::::M D:::::D D:::::D
// M:::::::M::::M M::::M:::::::M D:::::D D:::::D
// M::::::M M::::M M::::M M::::::M D:::::D D:::::D
// M::::::M M::::M::::M M::::::M D:::::D D:::::D
// M::::::M M:::::::M M::::::M D:::::D D:::::D
// M::::::M M:::::M M::::::M D:::::D D:::::D
// M::::::M MMMMM M::::::M D:::::D D:::::D
// M::::::M M::::::MDDD:::::DDDDD:::::D
// M::::::M M::::::MD:::::::::::::::DD
// M::::::M M::::::MD::::::::::::DDD
// MMMMMMMM MMMMMMMMDDDDDDDDDDDDD
@include media-breakpoint-up(md) { // >= 768px
$width-card-adn: 570px;
$width-card-story: 650px;
$min-height-card-footer: 365px;
$width-card-footer: 700px;
$width-card-posts: 355px;
$width-card-product: 300px;
.card-wrapper {
.card-title.marged { height: calc(1.2 * 18px * 2); }
}
.card-posts {
width: $width-card-posts;
.card-img-wrapper {
max-height: 284px;
img {
max-height: 284px;
}
}
.card-subtitle {
$nblines: 4;
@include txt-overflow-fade($nblines, 1rem, var(--bs-body-line-height), $color-bg-dropmenu);
}
}
.card-product {
@include size-fract($width-card-product, 2.35);
}
.card-adn {
@include size-fract($width-card-adn, 570 / 283);
background-color: $color-bg-dropmenu;
.card-title { margin: 1rem 0 1.5rem; }
.card-subtitle {
$nblines: 6;
@include txt-overflow-fade($nblines, 1rem, var(--bs-body-line-height), $color-bg-dropmenu);
}
.butn-prim { font-size: 16px; }
}
.card-adn-sm {
@include size-fract($width-card-adn, 570 / 132);
.card-subtitle {
$nblines: 3;
@include txt-overflow-fade($nblines, 1rem, var(--bs-body-line-height), $color-bg-dropmenu);
}
}
.card-story {
@include size-fract($width-card-story, 3);
max-width: $width-card-story;
.card-separator {
right: -2px;
rotate: 0deg;
}
.card-subtitle {
$nblines: 4;
@include txt-overflow-fade($nblines, 1rem, var(--bs-body-line-height), $color-bg-dropmenu);
}
}
.card-footer {
width: $width-card-footer;
min-height: $min-height-card-footer;
.card-sep-mobile { display: none; }
.card-sep-desktop { display: block; }
}
}
// LLLLLLLLLLL GGGGGGGGGGGGG
// L:::::::::L GGG::::::::::::G
// L:::::::::L GG:::::::::::::::G
// LL:::::::LL G:::::GGGGGGGG::::G
// L:::::L G:::::G GGGGGG
// L:::::L G:::::G
// L:::::L G:::::G
// L:::::L G:::::G GGGGGGGGGG
// L:::::L G:::::G G::::::::G
// L:::::L G:::::G GGGGG::::G
// L:::::L G:::::G G::::G
// L:::::L LLLLLL G:::::G G::::G
// LL:::::::LLLLLLLLL:::::L G:::::GGGGGGGG::::G
// L::::::::::::::::::::::L GG:::::::::::::::G
// L::::::::::::::::::::::L GGG::::::GGG:::G
// LLLLLLLLLLLLLLLLLLLLLLLL GGGGGG GGGG
@include media-breakpoint-up(lg) { // >= 992px
$width-card-story: 860px;
$width-card-footer: 860px;
.card-story {
@include size-fract($width-card-story, 3);
max-width: $width-card-story;
.card-subtitle {
$nblines: 8;
@include txt-overflow-fade($nblines, 1rem, var(--bs-body-line-height), $color-bg-dropmenu);
// height: calc($nblines * 1em * var(--bs-body-line-height));
}
}
.card-footer {
width: $width-card-footer;
// .card-subtitle {
// $nblines: 5;
// @include txt-overflow-fade($nblines, 1rem, var(--bs-body-line-height), $color-bg-dropmenu);
// }
}
}
// XXXXXXX XXXXXXXLLLLLLLLLLL
// X:::::X X:::::XL:::::::::L
// X:::::X X:::::XL:::::::::L
// X::::::X X::::::XLL:::::::LL
// XXX:::::X X:::::XXX L:::::L
// X:::::X X:::::X L:::::L
// X:::::X:::::X L:::::L
// X:::::::::X L:::::L
// X:::::::::X L:::::L
// X:::::X:::::X L:::::L
// X:::::X X:::::X L:::::L
// XXX:::::X X:::::XXX L:::::L LLLLLL
// X::::::X X::::::XLL:::::::LLLLLLLLL:::::L
// X:::::X X:::::XL::::::::::::::::::::::L
// X:::::X X:::::XL::::::::::::::::::::::L
// XXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL
@include media-breakpoint-up(xl) { // >= 1200px
$width-card-footer: 1180px;
$width-card-product: 374px;
.card-product {
@include size-fract($width-card-product, 2.35);
}
.card-footer {
width: $width-card-footer;
// max-width: $width-card-footer;
// .card-subtitle {
// $nblines: 8;
// @include txt-overflow-fade($nblines, 1rem, var(--bs-body-line-height), $color-bg-dropmenu);
// }
}
}
// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLL
// X:::::X X:::::XX:::::X X:::::XL:::::::::L
// X:::::X X:::::XX:::::X X:::::XL:::::::::L
// X::::::X X::::::XX::::::X X::::::XLL:::::::LL
// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L
// X:::::X X:::::X X:::::X X:::::X L:::::L
// X:::::X:::::X X:::::X:::::X L:::::L
// X:::::::::X X:::::::::X L:::::L
// X:::::::::X X:::::::::X L:::::L
// X:::::X:::::X X:::::X:::::X L:::::L
// X:::::X X:::::X X:::::X X:::::X L:::::L
// XXX:::::X X:::::XXXXXX:::::X X:::::XXX L:::::L LLLLLL
// X::::::X X::::::XX::::::X X::::::XLL:::::::LLLLLLLLL:::::L
// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L
// X:::::X X:::::XX:::::X X:::::XL::::::::::::::::::::::L
// XXXXXXX XXXXXXXXXXXXXX XXXXXXXLLLLLLLLLLLLLLLLLLLLLLLL
@include media-breakpoint-up(xxl) { // >= 1400px
}