@@ -0,0 +1,129 @@
1+import { useState, useEffect } from 'react';
2+import Head from "next/head";
3+import Link from 'next/link';
4+import Meta from "../components/Meta";
10+} from "@urbit/foundation-design-system";
11+import Header from "../components/Header";
12+import Footer from "../components/Footer";
13+import cn from 'classnames';
15+const postReq = (path, params, method = 'post') => {
16+ const form = document.createElement('form');
17+ form.method = method;
20+ for (const key in params) {
21+ if (params.hasOwnProperty(key)) {
22+ const hiddenField = document.createElement('input');
23+ hiddenField.type = 'hidden';
24+ hiddenField.name = key;
25+ hiddenField.value = params[key];
27+ form.appendChild(hiddenField);
31+ document.body.appendChild(form);
37+export default function Trial(props) {
39+ title: "Explore the Network",
40+ description: "Get one day of a complimentary hosted moon: a temporary Urbit ID."
43+ const [count, setCount] = useState(0)
46+ fetch('https://api.shore.arvo.network/count', {
48+ headers: { 'Content-Type': 'application/json' }
50+ .then(res => res.json())
52+ setCount(data.count);
56+ const available = count > 0;
61+ <title>{post.title} • urbit.org</title>
64+ <IntraNav ourSite="https://urbit.org" search={props.search} />
67+ <Section className="space-y-12">
68+ <h1>{post.title}</h1>
69+ {/* Flex between image and blurb, collapse to col on mobile */}
70+ <div className="flex flex-col items-center space-y-4 xl:space-y-0 xl:flex-row xl:space-x-4">
71+ <video className="max-w-md w-full min-w-0" autoPlay muted loop playsInline>
73+ src="https://storage.googleapis.com/media.urbit.org/site/explorethenetwork.webm"
77+ src="https://storage.googleapis.com/media.urbit.org/site/explorethenetwork.mp4"
81+ {/* Blurb is flexed to space button and copy */}
82+ <div className="flex-col flex space-y-4">
83+ <p>No downloads, no signup.</p>
84+ <p>Get <span className="font-bold">one day</span> of a complimentary hosted moon: a temporary Urbit ID.</p>
85+ {/* Button is flexed to space potential "try again later" copy */}
86+ <div className="xl:space-x-4 space-y-4 xl:space-y-0 self-center xl:self-start w-full flex-col xl:flex-row flex items-center">
87+ <a className={cn("p-8 button-lg text-white max-w-fit shrink-0", {
88+ "bg-green-400": available,
89+ "bg-wall-300 cursor-not-allowed": !available,
98+ fetch('https://api.shore.arvo.network/enter', {
100+ headers: { 'Content-Type': 'application/json' }
104+ throw 'Error response from shore api.';
109+ postReq(data.url + '/~/login', { password: data.code, redirect: '/' });
111+ .catch(e => setCount(0));
114+ {available ? 'Launch Moon' : 'No Moons Available'}
116+ {!available && <p>Check back later!</p>}
120+ <div className="max-w-prose flex flex-col space-y-4">
121+ <p>Moons are great for checking things out, but some groups may require a planet – a permanent Urbit ID.</p>
122+ <p>Learn more about <Link href="/getting-started/get-planet"><a>getting a planet</a></Link>.</p>