Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
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
// This val responds with "Hello World" to all incoming HTTP requests along with some crazy CSS gradients
export default async function main(req: Request): Promise<Response> {
// CSS with crazy gradients
const css = `
body {
background: linear-gradient(45deg, #ee0979, #ff6a00, #ff6a00, #799f0c);
background-size: 400% 400%;
animation: gradient 15s ease infinite;
}
@keyframes gradient {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
`;
// HTML content with "Hello World" message and style tag for the crazy gradients
const html = `
<html>
<head>
<style>${css}</style>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
`;
// Return the HTML response with the crazy gradients
return new Response(html, {
headers: { "Content-Type": "text/html" }
});
}
janpaul123-valle_tmp_9687248893374514440365302223592.web.val.run
July 17, 2024