- Update HelloBar to announce Fresh 2.3 with feature callouts
(WebSockets, View Transitions, Temporal API)
- Rework hero section: new headline ("The framework so simple, you
already know it"), descriptive subtitle, moved CTA to left
- Remove old Simple section, add "Take a tour of Fresh" heading before
showcase
- Add new showcase sections: View Transitions, API Routes/Handlers,
WebSockets, `<Head>` element, OpenTelemetry
- Fix broken Deco showcase image (missing `/showcase/` directory)
- Fix syntax highlighting in Simple section (was using raw `<pre>`
instead of Prism)
- Update RenderingSection to use Temporal API instead of Date API
- Fix cursor styles on Forms and Partials interactive demos
- Move WebSocket docs from Examples to Advanced in TOC
- Densify all showcase sections: smaller headings, code blocks, icons,
demo boxes, arrows, and tighter spacing
---------
Co-authored-by: Josh Collinsworth <joshuajcollinsworth@gmail.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import type { JSX } from "preact/jsx-runtime";
|
|
|
|
type ColumnConfiguration = "1/1" | "2/3" | "3/2";
|
|
|
|
interface SideBySideProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
mdColSplit?: ColumnConfiguration;
|
|
lgColSplit?: ColumnConfiguration;
|
|
reverseOnDesktop?: boolean;
|
|
}
|
|
|
|
export function SideBySide(props: SideBySideProps) {
|
|
let mdSplitClass = "md:grid-cols-2";
|
|
let lgSplitClass = "lg:grid-cols-2";
|
|
|
|
if (props.mdColSplit === "2/3") {
|
|
mdSplitClass = "md:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]";
|
|
} else if (props.mdColSplit === "3/2") {
|
|
mdSplitClass = "md:grid-cols-[minmax(0,3fr)_minmax(0,2fr)]";
|
|
}
|
|
|
|
if (props.lgColSplit === "2/3") {
|
|
lgSplitClass = " lg:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]";
|
|
} else if (props.lgColSplit === "3/2") {
|
|
lgSplitClass = "lg:grid-cols-[minmax(0,3fr)_minmax(0,2fr)]";
|
|
}
|
|
|
|
return (
|
|
<div
|
|
class={`grid grid-cols-1 items-center gap-8 md:gap-10 xl:gap-16 ${
|
|
props.reverseOnDesktop ? "[&>*]:md:first:order-1" : ""
|
|
} ${mdSplitClass} ${lgSplitClass} ${props.class ?? ""}`}
|
|
>
|
|
{props.children}
|
|
</div>
|
|
);
|
|
}
|