Skip to content

Commit 79ed95d

Browse files
Make testimonial preview responsive (#84)
- adjust testimonial preview surface to respect responsive widths while keeping the social-media aspect ratio - make the inner card width clamp so it scales down on narrow screens ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_693da17824d48325b6baa5660ed1b1ee)
1 parent bca1d00 commit 79ed95d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

testimonial-card-generator.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
--card-width: 720px;
1212
--card-padding: 32px;
1313
--image-width: 1200px;
14-
--image-height: 675px;
14+
--image-height: 630px;
1515
}
1616

1717
.layout {
@@ -93,8 +93,7 @@
9393
}
9494

9595
.image-space {
96-
width: var(--image-width);
97-
max-width: 100%;
96+
width: min(100%, var(--image-width));
9897
aspect-ratio: calc(var(--image-width) / var(--image-height));
9998
background: var(--bg-2);
10099
border: 1px solid var(--ui-2);
@@ -103,21 +102,23 @@
103102
justify-content: center;
104103
align-items: center;
105104
overflow: hidden;
105+
margin-inline: auto;
106106
}
107107

108108
.render-surface {
109-
width: var(--image-width);
110-
height: var(--image-height);
109+
width: min(100%, var(--image-width));
110+
max-width: var(--image-width);
111+
aspect-ratio: calc(var(--image-width) / var(--image-height));
111112
display: flex;
112113
justify-content: center;
113114
align-items: center;
114-
background: var(--bg);
115+
background: transparent;
115116
padding: clamp(1.5rem, 3vw, 2rem);
116117
}
117118

118119
.card {
119-
width: var(--card-width);
120-
max-width: min(90%, 820px);
120+
width: clamp(280px, 75vw, var(--card-width));
121+
max-width: min(100%, 820px);
121122
background: linear-gradient(135deg, var(--bg), var(--bg-2));
122123
padding: var(--card-padding);
123124
border-radius: var(--radius-lg);

0 commit comments

Comments
 (0)