Skip to content

Commit f22e101

Browse files
committed
gradient over image with radius -- this will need to account for overflow hidden or clip
1 parent 990c668 commit f22e101

1 file changed

Lines changed: 24 additions & 19 deletions

File tree

src/components/objectOverlay/examples/ObjectOverlay.vue

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ import CdrText from '../../text/CdrText.vue';
77
import CdrBody from '../../text/presets/CdrBody.vue';
88
import CdrTitle from '../../title/CdrTitle.vue';
99
import cedarImage from '../../../dev/static/cedar-1920x1080.jpg';
10-
import cedarSmallImage from '../../../dev/static/cedar-50x50.jpg';
1110
1211
defineOptions({ name: 'ObjectOverlay' });
1312
1413
const contentShort = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
15-
const contentLong = `${contentShort} ${contentShort} ${contentShort}`;
1614
1715
const overlayExamples = [
1816
{
@@ -81,7 +79,7 @@ const overlayExamples = [
8179
<CdrImg
8280
alt="Test image"
8381
:src="cedarImage"
84-
class="example__image"
82+
radius="soft"
8583
/>
8684
</template>
8785
</CdrMediaObject>
@@ -94,19 +92,19 @@ const overlayExamples = [
9492
<h2>Media Object with Multiple Overlays</h2>
9593
<CdrMediaObject>
9694
<template #media>
97-
<CdrObjectOverlay position="top-left" margin="zero">
95+
<CdrObjectOverlay position="top-left" margin="zero" gradient="to-bottom">
9896
<template #container>
99-
<CdrImg src="https://placehold.co/600x400" width="100%" height="100%" alt="Media image" />
97+
<CdrImg src="https://placehold.co/600x400" width="100%" height="100%" alt="Media image" radius="soft" />
10098
</template>
10199
<template #content>
102-
<div class="overlay-content" :style="{ backgroundColor: 'rgba(0, 0, 0, 0.5)', color: '#fff', padding: '20px' }">
100+
<div class="overlay-content">
103101
Top Left Overlay
104102
</div>
105103
</template>
106104
</CdrObjectOverlay>
107-
<CdrObjectOverlay position="bottom-right" margin="zero">
105+
<CdrObjectOverlay position="bottom-right" margin="zero" gradient="to-top">
108106
<template #content>
109-
<div class="overlay-content" :style="{ backgroundColor: 'rgba(0, 0, 0, 0.5)', color: '#fff', padding: '20px' }">
107+
<div class="overlay-content">
110108
Bottom Right Overlay
111109
</div>
112110
</template>
@@ -125,12 +123,12 @@ const overlayExamples = [
125123
<h2>Media Object with Responsive Overlay</h2>
126124
<CdrMediaObject>
127125
<template #media>
128-
<CdrObjectOverlay :position="{ xs: 'top-left', md: 'center-center', lg: 'bottom-right' }" margin="zero">
126+
<CdrObjectOverlay :position="{ xs: 'top-left', md: 'center-center', lg: 'bottom-right' }" margin="zero" gradient="to-right">
129127
<template #container>
130-
<CdrImg src="https://placehold.co/600x400" width="100%" height="100%" alt="Media image" />
128+
<CdrImg src="https://placehold.co/600x400" width="100%" height="100%" alt="Media image" radius="soft" />
131129
</template>
132130
<template #content>
133-
<div class="overlay-content" :style="{ backgroundColor: 'rgba(0, 0, 0, 0.5)', color: '#fff', padding: '20px' }">
131+
<div class="overlay-content">
134132
Responsive Overlay
135133
</div>
136134
</template>
@@ -149,26 +147,26 @@ const overlayExamples = [
149147
<h2>Media Object with Multiple Overlays and Content</h2>
150148
<CdrMediaObject>
151149
<template #media>
152-
<CdrObjectOverlay position="top-left" margin="zero">
150+
<CdrObjectOverlay position="top-left" margin="zero" gradient="to-bottom">
153151
<template #container>
154-
<CdrImg src="https://placehold.co/600x400" width="100%" height="100%" alt="Media image" />
152+
<CdrImg src="https://placehold.co/600x400" width="100%" height="100%" alt="Media image" radius="soft" />
155153
</template>
156154
<template #content>
157-
<div class="overlay-content" :style="{ backgroundColor: 'rgba(0, 0, 0, 0.5)', color: '#fff', padding: '20px' }">
155+
<div class="overlay-content">
158156
Top Left Overlay
159157
</div>
160158
</template>
161159
</CdrObjectOverlay>
162-
<CdrObjectOverlay position="bottom-right" margin="zero">
160+
<CdrObjectOverlay position="bottom-right" margin="zero" gradient="to-top">
163161
<template #content>
164-
<div class="overlay-content" :style="{ backgroundColor: 'rgba(0, 0, 0, 0.5)', color: '#fff', padding: '20px' }">
162+
<div class="overlay-content">
165163
Bottom Right Overlay
166164
</div>
167165
</template>
168166
</CdrObjectOverlay>
169-
<CdrObjectOverlay position="center-center" margin="zero">
167+
<CdrObjectOverlay position="center-center" margin="zero" gradient="to-left">
170168
<template #content>
171-
<div class="overlay-content" :style="{ backgroundColor: 'rgba(0, 0, 0, 0.5)', color: '#fff', padding: '20px' }">
169+
<div class="overlay-content">
172170
Center Overlay
173171
</div>
174172
</template>
@@ -184,11 +182,14 @@ const overlayExamples = [
184182
</div>
185183
</template>
186184

187-
<style scoped>
185+
<style lang="scss" scoped>
186+
@import '@rei/cdr-tokens/dist/rei-dot-com/scss/cdr-tokens.scss';
187+
188188
.overlay-content {
189189
color: white;
190190
font-size: 1.5rem;
191191
padding: 20px;
192+
background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background for contrast */
192193
}
193194
194195
.example {
@@ -228,6 +229,10 @@ const overlayExamples = [
228229
left: 0;
229230
border: 1px solid red;
230231
}
232+
233+
&--soft-radius {
234+
border-radius: 8px; /* Apply soft radius to images */
235+
}
231236
}
232237
233238
&__badge-example {

0 commit comments

Comments
 (0)