Compare commits

..

1 commit
main ... dev

Author SHA1 Message Date
254998f3ef style: refactor components and improve print layout
* Class Naming: Standardized button classes with -button suffixes and simplified wrapper classes
* Step Numbering: Added explicit span wrappers for step numbers in Frame.tsx
* Spacing Adjustments: Tightened margins and gaps in Frame.css and Step.css
* Print Styles: Updated Guide.css to define @page size as A4 and simplified .frame selectors
* Code Cleanup: Minor whitespace and formatting adjustments in App.css and Step.tsx
2026-07-12 12:26:08 +02:00
8 changed files with 36 additions and 23 deletions

View file

@ -9,7 +9,7 @@ export default function Frame({ frame } : { frame: FrameType }) {
<ol className="steps"> <ol className="steps">
{frame.steps.map((step, stepIndex) => ( {frame.steps.map((step, stepIndex) => (
<li key={stepIndex} className="step"> <li key={stepIndex} className="step">
{step.text} <span>{stepIndex + 1}.</span>{step.text}
</li> </li>
))} ))}
</ol> </ol>

View file

@ -19,14 +19,14 @@
gap: var(--size-md); gap: var(--size-md);
} }
.frame .buttons button { .frame button {
padding: var(--size-sm) var(--size-md); padding: var(--size-sm) var(--size-md);
} }
.frame .buttons .remove { .frame .remove-button {
margin-left: auto; margin-left: auto;
} }
.frame ol { .frame ol {
margin-left: var(--size-md); margin-left: var(--size-sm);
} }

View file

@ -36,21 +36,21 @@ export default function Frame({
<div className="buttons"> <div className="buttons">
<button <button
type="button" type="button"
className="up" className="up-button"
onClick={() => reOrder(frameIndex, frameIndex - 1)} onClick={() => reOrder(frameIndex, frameIndex - 1)}
> >
Up Up
</button> </button>
<button <button
type="button" type="button"
className="down" className="down-button"
onClick={() => reOrder(frameIndex, frameIndex + 1)} onClick={() => reOrder(frameIndex, frameIndex + 1)}
> >
Down Down
</button> </button>
<button <button
type="button" type="button"
className="remove" className="remove-button"
onClick={() => onRemove(frame.id)} onClick={() => onRemove(frame.id)}
> >
Remove Frame Remove Frame
@ -67,7 +67,7 @@ export default function Frame({
<img src={objectUrl} alt={frame.title} /> <img src={objectUrl} alt={frame.title} />
<button <button
type="button" type="button"
className="add-step" className="add-step-button"
onClick={() => addStep(frame.id)} onClick={() => addStep(frame.id)}
> >
Add Step Add Step

View file

@ -1,8 +1,11 @@
.step { .step {
display: flex; display: flex;
gap: var(--size-md); gap: var(--size-xs);
}
.step span {
font-weight: bold;
color:#555;
} }
.step label { .step label {
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;

View file

@ -22,7 +22,7 @@ export default function Step({
onChange={(e) => updateStep(step.id, e.target.value)} onChange={(e) => updateStep(step.id, e.target.value)}
/> />
</label> </label>
<button type="button" onClick={() => removeStep(step.id)}> <button type="button" className="remove-step-button" onClick={() => removeStep(step.id)}>
Remove Step Remove Step
</button> </button>
</li> </li>

View file

@ -4,14 +4,15 @@ main:has(.guide) {
justify-content: center; justify-content: center;
} }
.guide__frames { .frames {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: var(--size-xl); gap: 2rem;
} }
.guide { .guide {
max-width: 600px; max-width: 600px;
.delete-button { .delete-button {
position: absolute; position: absolute;
bottom: var(--size-md); bottom: var(--size-md);
@ -29,28 +30,31 @@ main:has(.guide) {
top: var(--size-md); top: var(--size-md);
right: var(--size-md); right: var(--size-md);
} }
} }
@media print { @media print {
main:has(.guide) { main:has(.guide) {
padding: 0rem; padding: 0rem;
justify-content: flex-start; justify-content: flex-start;
} }
.guide__frames {
display: block;
}
.guide__frame {
.frame {
position: relative; position: relative;
break-inside: avoid; break-inside: avoid;
page-break-inside: avoid; page-break-inside: avoid;
background-color: var(--color-bg-panel); background-color: var(--color-bg-panel);
margin: var(--size-lg) 0;
} }
.guide__frame img { .frame img {
max-width: 100%; max-width: 100%;
max-height: 100px; max-height: 300px;
} }
} }
@page {
size: A4;
margin: 2rem;
}

View file

@ -19,7 +19,7 @@ export default function Guide() {
<hr /> <hr />
<div className="guide__frames"> <div className="frames">
{guide.frames.map((frame, index) => ( {guide.frames.map((frame, index) => (
<Frame key={index} frame={frame} /> <Frame key={index} frame={frame} />
))} ))}

View file

@ -78,6 +78,8 @@ ul {
list-style: none; list-style: none;
} }
a, a,
input, input,
button, button,
@ -119,10 +121,12 @@ textarea,
border-radius: var(--radius); border-radius: var(--radius);
padding: var(--size-sm); padding: var(--size-sm);
} }
textarea { textarea {
resize: none; resize: none;
height: 5rem; height: 5rem;
} }
hr { hr {
margin: var(--size-md) 0; margin: var(--size-md) 0;
border: none; border: none;
@ -130,9 +134,11 @@ hr {
background-color: var(--color-bg-sidebar); background-color: var(--color-bg-sidebar);
border-radius: var(--radius); border-radius: var(--radius);
} }
:focus-visible { :focus-visible {
border: 2px solid var(--color-accent); border: 2px solid var(--color-accent);
} }
@media print { @media print {
header, header,
footer, footer,