1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export default async function(req: Request) {
return new Response(
renderToString(
<html>
<head>
<meta charSet="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Jane Doe</title>
<style>{`
body {
background-color: #f0f4f8;
color: #2d3748;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
}
.container {
max-width: 600px;
margin: 0 auto;
padding: 40px 20px;
text-align: center;
}
h1 {
color: #4a5568;
font-size: 2.5rem;
margin-bottom: 10px;
}
p {
font-size: 1.1rem;
margin-bottom: 30px;
}
.links {
display: flex;
flex-direction: column;
gap: 15px;
}
.source-link {
margin-top: 30px;
font-size: 0.9rem;
color: #718096;
}
.source-link a {
color: #4299e1;
text-decoration: none;
}
.source-link a:hover {
text-decoration: underline;
}
`}</style>
</head>
<body>
<div className="container">
<h1>Jane Doe</h1>
<p>Web developer and coffee enthusiast</p>
<div className="links">
<a href="https://www.instagram.com/janedoe" style={itemStyle}>Instagram</a>
<a href="https://github.com/janedoe" style={itemStyle}>Github</a>
<a href="https://www.linkedin.com/in/janedoe" style={itemStyle}>LinkedIn</a>
<a href="https://twitter.com/janedoe" style={itemStyle}>Twitter</a>
<a href="https://www.youtube.com/janedoe" style={itemStyle}>YouTube</a>
</div>
<div className="source-link">
<a href={import.meta.url.replace("esm.town", "val.town")}>View Source</a>
</div>
</div>
</body>
</html>
),
{
headers: {
"Content-Type": "text/html",
},
},
);
}
const itemStyle = {
padding: "12px 20px",
color: "white",
backgroundColor: "#4299e1",
borderRadius: "30px",
textDecoration: "none",
fontWeight: "bold",
transition: "all 0.3s ease",
boxShadow: "0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08)",
};