Skip to content

Commit 7e3cdb3

Browse files
committed
merge
2 parents a8cf09a + afde73e commit 7e3cdb3

4 files changed

Lines changed: 28 additions & 28 deletions

File tree

src/components/objectOverlay/CdrObjectOverlay.vue

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
11
<script setup lang="ts">
22
import { useCssModule, computed } from 'vue';
3-
import {
4-
ObjectPosition,
5-
ResponsivePosition,
6-
ResponsiveSpace,
7-
Spacing,
8-
Gradient,
9-
ResponsiveGradient
10-
} from '../../types/interfaces';
3+
import type { ObjectOverlayProps } from '../../types/interfaces';
114
125
/** Component for positioning content in 9 different positions relative to a container */
136
147
defineOptions({ name: 'CdrObjectOverlay' });
158
16-
interface ObjectOverlayProps {
17-
/** Gradient to be applied to the container */
18-
gradient?: ResponsiveGradient | Gradient;
19-
/** Position of the content relative to the container */
20-
position?: ResponsivePosition | ObjectPosition;
21-
/** Margin space around the positioned content */
22-
margin?: ResponsiveSpace | Spacing;
23-
/** Padding space around the positioned content */
24-
padding?: ResponsiveSpace | Spacing;
25-
/** Sets the HTML tag for the container element */
26-
tag?: string;
27-
}
28-
299
const props = withDefaults(defineProps<ObjectOverlayProps>(), {
3010
position: 'center-center',
3111
margin: 'zero',

src/components/objectOverlay/examples/ObjectOverlay.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import CdrTitle from '../../title/CdrTitle.vue';
99
import CdrButton from '../../button/CdrButton.vue';
1010
import CdrIcon from '../../icon/CdrIcon.vue';
1111
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';
1412
1513
defineOptions({ name: 'ObjectOverlay' });
1614
@@ -100,7 +98,16 @@ const overlayExamples = [
10098
</template>
10199
</CdrLayout>
102100

103-
<hr />
101+
<CdrObjectOverlay :position="{ xs: 'center-center', lg: 'bottom-center', md: 'bottom-left' }" :margin="['zero', 'eighth-x']">
102+
<template #container>
103+
<img src="https://placehold.co/600x400" width="100%" height="100%" alt="Background image" :style="{ display: 'block' }"/>
104+
</template>
105+
<template #content>
106+
<div class="overlay-content" :style="{ backgroundColor: '#fff', padding: '20px' }">
107+
Positioned Content
108+
</div>
109+
</template>
110+
</CdrObjectOverlay>
104111

105112
<h2>Media Object with Multiple Overlays</h2>
106113
<CdrMediaObject>

src/components/objectOverlay/styles/CdrObjectOverlay.module.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ $positions: (
2121
);
2222

2323
$gradients: (
24-
'to-top': linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent),
25-
'to-bottom': linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent),
26-
'to-left': linear-gradient(to left, rgba(0, 0, 0, 0.5), transparent),
27-
'to-right': linear-gradient(to right, rgba(0, 0, 0, 0.5), transparent)
24+
'to-top': linear-gradient(to top, black 0%, rgba(0, 0, 0, 0.55) 40%, transparent),
25+
'to-bottom': linear-gradient(to bottom, black 0%, rgba(0, 0, 0, 0.55) 40%, transparent),
26+
'to-left': linear-gradient(to left, black 0%, rgba(0, 0, 0, 0.55) 40%, transparent),
27+
'to-right': linear-gradient(to right, black 0%, rgba(0, 0, 0, 0.55) 40%, transparent)
2828
);
2929

3030
.cdr-object-overlay {

src/types/interfaces.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,3 +435,16 @@ export type ResponsiveSpace = {
435435
md?: Spacing;
436436
lg?: Spacing;
437437
};
438+
439+
export interface ObjectOverlayProps {
440+
/** Gradient to be applied to the container */
441+
gradient?: ResponsiveGradient | Gradient;
442+
/** Position of the content relative to the container */
443+
position?: ResponsivePosition | ObjectPosition;
444+
/** Margin space around the positioned content */
445+
margin?: ResponsiveSpace | Spacing;
446+
/** Padding space around the positioned content */
447+
padding?: ResponsiveSpace | Spacing;
448+
/** Sets the HTML tag for the container element */
449+
tag?: string;
450+
}

0 commit comments

Comments
 (0)