Skip to content

Commit 8fae462

Browse files
Fix testimonial preview sizing (#91)
- set the testimonial preview surface to a fixed 1200x630 size for social media exports - add a scrollable preview container so the form stays responsive even when the preview is wider - widen the page shell on large screens to better accommodate the fixed-size preview ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_694039a947548325a874f54932e5e79c)
1 parent 05866d9 commit 8fae462

1 file changed

Lines changed: 34 additions & 15 deletions

File tree

testimonial-card-generator.html

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,21 @@
1414
--image-height: 630px;
1515
}
1616

17+
.page-shell {
18+
max-width: min(100%, calc(var(--image-width) + 320px));
19+
}
20+
1721
.layout {
1822
display: grid;
1923
grid-template-columns: 1fr;
2024
gap: clamp(1rem, 3vw, 1.5rem);
21-
align-items: stretch;
25+
align-items: start;
26+
}
27+
28+
@media (min-width: 1100px) {
29+
.layout {
30+
grid-template-columns: minmax(320px, 1fr) auto;
31+
}
2232
}
2333

2434
.field {
@@ -90,11 +100,19 @@
90100
.preview-wrapper {
91101
display: grid;
92102
gap: 0.75rem;
103+
align-items: start;
104+
min-inline-size: 0;
105+
}
106+
107+
.preview-shell {
108+
width: 100%;
109+
overflow-x: auto;
110+
padding: 0.25rem;
93111
}
94112

95113
.image-space {
96-
width: min(100%, var(--image-width));
97-
aspect-ratio: calc(var(--image-width) / var(--image-height));
114+
width: var(--image-width);
115+
height: var(--image-height);
98116
background: var(--bg-2);
99117
border: 1px solid var(--ui-2);
100118
border-radius: var(--radius-lg);
@@ -106,9 +124,8 @@
106124
}
107125

108126
.render-surface {
109-
width: min(100%, var(--image-width));
110-
max-width: var(--image-width);
111-
aspect-ratio: calc(var(--image-width) / var(--image-height));
127+
width: var(--image-width);
128+
height: var(--image-height);
112129
display: flex;
113130
justify-content: center;
114131
align-items: center;
@@ -213,15 +230,17 @@ <h1>Testimonial Card Image Generator</h1>
213230

214231
<div class="surface preview-wrapper" aria-live="polite">
215232
<div class="status" id="status"></div>
216-
<div class="image-space">
217-
<div class="render-surface" id="renderSurface">
218-
<div class="card" id="card">
219-
<blockquote id="quote">Add your testimonial to see a preview.</blockquote>
220-
<div class="person">
221-
<img class="avatar" id="avatar" src="" alt="Avatar preview">
222-
<div>
223-
<div class="name" id="previewName">Name</div>
224-
<div class="affiliation" id="previewAffiliation">Affiliation</div>
233+
<div class="preview-shell">
234+
<div class="image-space">
235+
<div class="render-surface" id="renderSurface">
236+
<div class="card" id="card">
237+
<blockquote id="quote">Add your testimonial to see a preview.</blockquote>
238+
<div class="person">
239+
<img class="avatar" id="avatar" src="" alt="Avatar preview">
240+
<div>
241+
<div class="name" id="previewName">Name</div>
242+
<div class="affiliation" id="previewAffiliation">Affiliation</div>
243+
</div>
225244
</div>
226245
</div>
227246
</div>

0 commit comments

Comments
 (0)