Skip to content

Commit cfeed4b

Browse files
committed
chore: add DisplayWithImageOverlay
upgrade tailwindcss to 3.4.17
1 parent 879bbe4 commit cfeed4b

File tree

9 files changed

+200
-40
lines changed

9 files changed

+200
-40
lines changed

apps/docs/components/content/_blocks/Banners.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
Banners are components that deliver main image and content in various configurations.
44

5-
## Reponsive Display
5+
## Responsive Display
66

7-
Display blocks that switch between horitonzal/vertical arrengement based on [parent container's size](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries).
7+
Display blocks that switch between horizontal/vertical arrangement based on [parent container's size](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries).
88

99
<Showcase showcase-name="Banners/DisplayResponsive" style="min-height:800px">
1010

@@ -62,6 +62,21 @@ Four vertical displays in row on desktop.
6262

6363
</Showcase>
6464

65+
## Display With Image Overlay
66+
67+
Display block with image filling all of its background area.
68+
69+
<Showcase showcase-name="Banners/DisplayWithImageOverlay" style="min-height:800px">
70+
71+
::vue-only
72+
<<<../../../../preview/nuxt/pages/showcases/Banners/DisplayWithImageOverlay.vue
73+
::
74+
::react-only
75+
<<<../../../../preview/next/pages/showcases/Banners/DisplayWithImageOverlay.tsx
76+
::
77+
78+
</Showcase>
79+
6580
## Hero
6681

6782
The Hero component simplifies the process of creating stunning hero sections for your website. With Hero, you have the flexibility to seamlessly integrate a main image and customize your content to suit your needs. Additionally, Hero allows adding background images tailored for both mobile and desktop devices. To ensure an optimal blend of performance and visual appeal, we recommend adhering to the following image guidelines:

apps/preview/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"prettier": "^3.0.0",
4343
"rimraf": "^6.0.1",
4444
"string-replace-loader": "^3.1.0",
45-
"tailwindcss": "^3.4.7",
45+
"tailwindcss": "3.4.17",
4646
"ts-loader": "^9.4.2"
4747
}
4848
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/* eslint-disable jsx-a11y/anchor-is-valid */
2+
/* eslint-disable jsx-a11y/anchor-has-content */
3+
import { ShowcasePageLayout } from '../../showcases';
4+
// #region source
5+
import { SfButton } from '@storefront-ui/react';
6+
import classNames from 'classnames';
7+
8+
const displayDetails = [
9+
{
10+
title: 'Cap Game Strong',
11+
subtitle: 'Special Offer',
12+
description: 'Score serious style points with our Open Capsule collection',
13+
buttonText: 'Browse offers',
14+
reverse: false,
15+
backgroundImage: 'http://localhost:3100/@assets/display-overlay.png',
16+
},
17+
];
18+
19+
export default function DisplayHorizontalBlock() {
20+
return (
21+
<div className="grid md:flex md:flex-row flex-wrap gap-6 max-w-[1540px]">
22+
{displayDetails.map(({ title, subtitle, description, buttonText, backgroundImage, reverse }) => (
23+
<div key={title} className="relative flex text-white max-w-[1536px] @container group">
24+
<a
25+
className="absolute w-full h-full z-1 focus-visible:outline focus-visible:rounded-lg"
26+
aria-label={title}
27+
href="#"
28+
/>
29+
<div className="h-[680px] @3xl:h-auto @3xl:aspect-[2] flex justify-between overflow-hidden grow">
30+
<div className="grow flex flex-col justify-center items-center text-center p-6 @3xl:p-10 max-w-1/2">
31+
<p className="uppercase typography-text-xs block font-medium tracking-widest @3xl:typography-headline-6">
32+
{subtitle}
33+
</p>
34+
<h2 className="mb-4 mt-2 font-semibold typography-display-3 -tracking-wide @3xl:typography-display-1">
35+
{title}
36+
</h2>
37+
<p className="typography-text-base block mb-4 @3xl:typography-text-lg">{description}</p>
38+
<SfButton
39+
blank
40+
className="w-[200px] bg-white text-primary-700 ring-secondary-400 group-hover:bg-primary-100 group-hover:hover:text-primary-800 group-hover:ring-secondary-500 group-active:bg-primary-200 group-active:text-primary-900 group-active:ring-secondary-600 group-has-[:focus-visible]:outline group-has-[:focus-visible]:outline-offset pointer-events-none"
41+
tabIndex={-1}
42+
variant="secondary"
43+
>
44+
{buttonText}
45+
</SfButton>
46+
</div>
47+
<div className="absolute inset-0 z-[-1] overflow-hidden bg-primary-900">
48+
<img src={backgroundImage} alt={title} className="w-full h-full object-cover opacity-75" />
49+
</div>
50+
</div>
51+
</div>
52+
))}
53+
</div>
54+
);
55+
}
56+
// #endregion source
57+
DisplayHorizontalBlock.getLayout = ShowcasePageLayout;
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<template>
2+
<div class="max-w-[1540px]">
3+
<div
4+
v-for="{ title, subtitle, description, buttonText, backgroundImage } in displayDetails"
5+
:key="title"
6+
class="relative flex text-white max-w-[1536px] @container group"
7+
>
8+
<a
9+
class="absolute w-full h-full z-1 focus-visible:outline focus-visible:rounded-lg"
10+
:aria-label="title"
11+
href="#"
12+
/>
13+
<div class="h-[680px] @3xl:h-auto @3xl:aspect-[2] flex justify-between overflow-hidden grow">
14+
<div class="grow flex flex-col justify-center items-center text-center p-6 @3xl:p-10 max-w-1/2">
15+
<p class="uppercase typography-text-xs block font-medium tracking-widest @3xl:typography-headline-6">
16+
{{ subtitle }}
17+
</p>
18+
<h2 class="mb-4 mt-2 font-semibold typography-display-3 -tracking-wide @3xl:typography-display-1">
19+
{{ title }}
20+
</h2>
21+
<p class="typography-text-base block mb-4 @3xl:typography-text-lg">
22+
{{ description }}
23+
</p>
24+
<SfButton
25+
blank
26+
class="w-[200px] bg-white text-primary-700 ring-secondary-400 group-hover:bg-primary-100 group-hover:hover:text-primary-800 group-hover:ring-secondary-500 group-active:bg-primary-200 group-active:text-primary-900 group-active:ring-secondary-600 group-has-[:focus-visible]:outline group-has-[:focus-visible]:outline-offset pointer-events-none"
27+
tabindex="-1"
28+
variant="secondary"
29+
>
30+
{{ buttonText }}
31+
</SfButton>
32+
</div>
33+
<div class="absolute inset-0 z-[-1] overflow-hidden bg-primary-900">
34+
<img :src="backgroundImage" :alt="title" class="w-full h-full object-cover opacity-75" />
35+
</div>
36+
</div>
37+
</div>
38+
</div>
39+
</template>
40+
41+
<script lang="ts" setup>
42+
import { SfButton } from '@storefront-ui/vue';
43+
44+
const displayDetails = [
45+
{
46+
title: 'Cap Game Strong',
47+
subtitle: 'Special Offer',
48+
description: 'Score serious style points with our Open Capsule collection',
49+
buttonText: 'Browse offers',
50+
backgroundImage: 'http://localhost:3100/@assets/display-overlay.png',
51+
},
52+
];
53+
</script>
3.25 MB
Loading

apps/test/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"postcss": "^8.4.21",
4949
"postcss-import": "^15.1.0",
5050
"rimraf": "^6.0.1",
51-
"tailwindcss": "^3.4.7",
51+
"tailwindcss": "3.4.17",
5252
"typescript": "^5.5.4",
5353
"vite": "^5.3.5",
5454
"vite-plugin-istanbul": "^4.0.1"

apps/test/vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"postcss-import": "^15.1.0",
5151
"rimraf": "^6.0.1",
5252
"sass": "^1.77.8",
53-
"tailwindcss": "^3.4.7",
53+
"tailwindcss": "3.4.17",
5454
"typescript": "^5.5.4",
5555
"vite": "^5.3.5",
5656
"vite-plugin-istanbul": "^4.0.0",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"remark-stringify": "^11.0.0",
7474
"rimraf": "^6.0.1",
7575
"rollup-plugin-preserve-directives": "^0.4.0",
76-
"tailwindcss": "^3.4.7",
76+
"tailwindcss": "3.4.17",
7777
"turbo": "^2.0.9",
7878
"typescript": "^5.5.4",
7979
"unified": "^11.0.5",

0 commit comments

Comments
 (0)