maxm-bloomingbuttondemo.web.val.run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export default async function(req: Request): Promise<Response> {
return new Response(
renderToString(
<>
<link rel="stylesheet" href="https://jenil.github.io/bulmaswatch/simplex/bulmaswatch.min.css" />
<div style={{ textAlign: "center", marginTop: "100px" }}>
<button className="is-success button bloom-button" id="treeButton">Click Me</button>
</div>
<script type="module" src="https://esm.town/v/maxm/bloomingButton" />
</>,
),
{ headers: { "content-type": "text/html" } },
);
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
v48
May 29, 2024