Skip to content

Commit a8cf09a

Browse files
committed
adding to examples
1 parent f22e101 commit a8cf09a

1 file changed

Lines changed: 84 additions & 8 deletions

File tree

src/components/objectOverlay/examples/ObjectOverlay.vue

Lines changed: 84 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import CdrImg from '../../image/CdrImg.vue';
66
import CdrText from '../../text/CdrText.vue';
77
import CdrBody from '../../text/presets/CdrBody.vue';
88
import CdrTitle from '../../title/CdrTitle.vue';
9+
import CdrButton from '../../button/CdrButton.vue';
10+
import CdrIcon from '../../icon/CdrIcon.vue';
911
import cedarImage from '../../../dev/static/cedar-1920x1080.jpg';
12+
import cedarSquareImage from '../../../dev/static/cedar-1080x1080.jpg';
13+
import cedarTallImage from '../../../dev/static/cedar-1080x1920.jpg';
1014
1115
defineOptions({ name: 'ObjectOverlay' });
1216
@@ -76,11 +80,20 @@ const overlayExamples = [
7680
</CdrBody>
7781
</template>
7882
<template #media>
79-
<CdrImg
80-
alt="Test image"
81-
:src="cedarImage"
82-
radius="soft"
83-
/>
83+
<CdrObjectOverlay position="center-center" gradient="to-bottom">
84+
<template #container>
85+
<CdrImg
86+
alt="Test image"
87+
:src="cedarImage"
88+
radius="soft"
89+
/>
90+
</template>
91+
<template #content>
92+
<CdrButton icon-only aria-label="Close">
93+
<CdrIcon name="close" />
94+
</CdrButton>
95+
</template>
96+
</CdrObjectOverlay>
8497
</template>
8598
</CdrMediaObject>
8699
</div>
@@ -103,6 +116,9 @@ const overlayExamples = [
103116
</template>
104117
</CdrObjectOverlay>
105118
<CdrObjectOverlay position="bottom-right" margin="zero" gradient="to-top">
119+
<template #container>
120+
<CdrImg src="https://placehold.co/600x400" width="100%" height="100%" alt="Media image" radius="soft" />
121+
</template>
106122
<template #content>
107123
<div class="overlay-content">
108124
Bottom Right Overlay
@@ -152,19 +168,73 @@ const overlayExamples = [
152168
<CdrImg src="https://placehold.co/600x400" width="100%" height="100%" alt="Media image" radius="soft" />
153169
</template>
154170
<template #content>
155-
<div class="overlay-content">
156-
Top Left Overlay
157-
</div>
171+
<CdrButton icon-only aria-label="Close">
172+
<CdrIcon name="close" />
173+
</CdrButton>
158174
</template>
159175
</CdrObjectOverlay>
160176
<CdrObjectOverlay position="bottom-right" margin="zero" gradient="to-top">
177+
<template #container>
178+
<CdrImg src="https://placehold.co/600x400" width="100%" height="100%" alt="Media image" radius="soft" />
179+
</template>
161180
<template #content>
162181
<div class="overlay-content">
163182
Bottom Right Overlay
164183
</div>
165184
</template>
166185
</CdrObjectOverlay>
167186
<CdrObjectOverlay position="center-center" margin="zero" gradient="to-left">
187+
<template #container>
188+
<CdrImg src="https://placehold.co/600x400" width="100%" height="100%" alt="Media image" radius="soft" />
189+
</template>
190+
<template #content>
191+
<div class="overlay-content">
192+
Center Overlay
193+
</div>
194+
</template>
195+
</CdrObjectOverlay>
196+
</template>
197+
<template #content>
198+
<div>
199+
<h3>Media Object Title</h3>
200+
<p>This is the content of the media object.</p>
201+
</div>
202+
</template>
203+
</CdrMediaObject>
204+
205+
<hr />
206+
207+
<h2>Media Object with Square Image</h2>
208+
<CdrMediaObject>
209+
<template #media>
210+
<CdrObjectOverlay position="center-center" margin="zero" gradient="to-bottom">
211+
<template #container>
212+
<CdrImg src="https://placehold.co/600x600" width="100%" height="100%" alt="Square media image" radius="soft" />
213+
</template>
214+
<template #content>
215+
<div class="overlay-content">
216+
Center Overlay
217+
</div>
218+
</template>
219+
</CdrObjectOverlay>
220+
</template>
221+
<template #content>
222+
<div>
223+
<h3>Media Object Title</h3>
224+
<p>This is the content of the media object.</p>
225+
</div>
226+
</template>
227+
</CdrMediaObject>
228+
229+
<hr />
230+
231+
<h2>Media Object with Tall Image</h2>
232+
<CdrMediaObject>
233+
<template #media>
234+
<CdrObjectOverlay position="center-center" margin="zero" gradient="to-bottom">
235+
<template #container>
236+
<CdrImg src="https://placehold.co/400x800" width="100%" height="100%" alt="Tall media image" radius="soft" />
237+
</template>
168238
<template #content>
169239
<div class="overlay-content">
170240
Center Overlay
@@ -192,6 +262,12 @@ const overlayExamples = [
192262
background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background for contrast */
193263
}
194264
265+
.image-container {
266+
position: relative;
267+
overflow: hidden;
268+
border-radius: 8px; /* Match the radius of the image */
269+
}
270+
195271
.example {
196272
&__hr {
197273
margin: $cdr-space-two-x 0;

0 commit comments

Comments
 (0)