export default async function(req: Request): Promise<Response> {
const query = new URL(req.url).searchParams;
const name = query.get("name") || (await req.json().catch(() => ({}))).name || "you";
return new Response(
`<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=0">
<title>test-widget | canibuild</title>
<link rel="shortcut icon" href="/favicon.png">
<meta name="theme-color" content="#224946">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;800&display=swap" rel="stylesheet">
<style>
body {
margin: 0;
background-color: #fafafa;
height: 100%;
font-family: 'Outfit', sans-serif;
font-weight: 400;
}
.main-navigation {
display: flex;
justify-content: space-between;
max-width: 1200px;
margin: auto;
background-color: #fafafa;
padding: 2rem 0;
& .logo {
width: 180px;
height: 40px;
background: #22b573;
}
& ul {
list-style: none;
padding: 0;
margin: 0;
& li {
display: inline-block;
margin-right: 1rem;
font-family: 'Outfit', sans-serif;
font-weight: 800;
font-size: large;
& a {
text-decoration: none;
color: #22b573;
}
}
}
}
.content {
padding: 4rem 2rem;
background-color: #224946;
}
.banner {
max-width: 1200px;
margin: auto;
background-image: url('https://a.storyblok.com/f/154592/1366x814/e639882ad4/canibuild-visual-selling.png/m/filters:format(webp)?auto=format&fit=max&w=640');
background-size: contain;
background-position: right;
background-repeat: no-repeat;
}
h1,
h2 {
padding: 2rem 0;
color: white;
font-weight: 800;
font-family: 'Outfit', sans-serif;
font-size: 52px;
line-height: 1.3;
padding: 0;
margin: 0;
}
h2 {
color: #22b573;
font-weight: 400;
}
.canibuild-search-widget {
width: 100%;
max-width: 500px;
height: 55px;
display: block;
background: white;
border-radius: 4px;
}