slate/pages/index.js

250 lines
5.7 KiB
JavaScript
Raw Normal View History

2020-07-09 06:19:08 +03:00
import * as React from "react";
2020-07-16 08:48:51 +03:00
import * as Constants from "~/common/constants";
import * as SVG from "~/common/svg";
2020-07-09 06:19:08 +03:00
import WebsitePrototypeWrapper from "~/components/core/WebsitePrototypeWrapper";
import WebsiteHeader from "~/components/core/WebsiteHeader";
import WebsiteFooter from "~/components/core/WebsiteFooter";
2022-10-03 18:54:00 +03:00
import Link from "next/link";
2020-11-30 08:24:22 +03:00
import { css } from "@emotion/react";
2022-06-21 00:42:34 +03:00
import { useGuideKeyCommands } from "./guide/guide";
2020-07-16 08:48:51 +03:00
const STYLES_ROOT = css`
2020-10-06 22:16:21 +03:00
width: 100%;
height: 100%;
2022-07-08 22:27:36 +03:00
min-height: calc(100vh - 61px);
2022-07-18 22:49:33 +03:00
background-color: ${Constants.semantic.bgGrayLight};
2022-06-16 20:57:25 +03:00
color: ${Constants.semantic.textBlack};
2022-07-08 22:27:36 +03:00
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@media (max-width: ${Constants.sizes.mobile}px) {
min-height: calc(100vh - 112px);
}
`;
2020-10-06 22:16:21 +03:00
const STYLES_CONTAINER = css`
2022-06-16 20:57:25 +03:00
max-width: 700px;
2020-10-06 22:16:21 +03:00
margin: 0 auto;
2022-07-15 06:05:06 +03:00
padding: min(0.2vw, 120px) 0 40px 0;
@media (max-width: ${Constants.sizes.mobile}px) {
max-width: 480px;
2022-07-08 22:27:36 +03:00
padding: 16px 16px 32px 16px;
}
`;
2022-06-21 02:09:29 +03:00
const STYLES_IMG = css`
2022-07-15 06:05:06 +03:00
width: 92%;
2022-10-03 18:54:00 +03:00
height: auto;
2022-07-15 06:05:06 +03:00
margin-bottom: 24px;
2022-07-08 22:27:36 +03:00
@keyframes hero-fade-in {
0% {
opacity: 0%;
transform: translateY(5%);
}
100% {
opacity: 100%;
transform: translateY(0%);
}
}
animation: hero-fade-in 300ms ease-in-out;
2022-06-21 02:09:29 +03:00
`;
const STYLES_HEADING = css`
2022-06-16 20:57:25 +03:00
font-family: ${Constants.font.bold};
flex-shrink: 0;
flex-shrink: 0;
min-width: 50%;
max-width: 100%;
2022-07-15 06:05:06 +03:00
line-height: min(100px, 6vw);
font-size: min(120px, 6vw);
letter-spacing: -0.05em;
2022-07-15 06:05:06 +03:00
margin-bottom: 21px;
2020-10-06 22:16:21 +03:00
@media (max-width: ${Constants.sizes.tablet}px) {
2022-07-15 06:05:06 +03:00
font-size: 60px;
line-height: 60px;
letter-spacing: -0.04em;
}
@media (max-width: ${Constants.sizes.mobile}px) {
font-size: 48px;
2022-07-15 06:05:06 +03:00
line-height: 48px;
letter-spacing: -0.04em;
}
2022-07-08 22:27:36 +03:00
@keyframes heading-fade-in {
0% {
opacity: 0%;
transform: translateY(25%);
}
50% {
opacity: 0%;
transform: translateY(25%);
}
100% {
opacity: 100%;
transform: translateY(0%);
}
}
animation: heading-fade-in 400ms ease-in-out;
`;
2022-06-16 20:57:25 +03:00
const STYLES_BODY = css`
2022-07-08 22:27:36 +03:00
font-family: ${Constants.font.medium};
2022-06-16 20:57:25 +03:00
font-size: 20px;
line-height: 28px;
2022-07-08 22:27:36 +03:00
letter-spacing: -0.015em;
2022-07-15 06:05:06 +03:00
margin-bottom: 24px;
2022-07-08 22:27:36 +03:00
@keyframes body-fade-in {
0% {
opacity: 0%;
transform: translateY(50%);
}
50% {
opacity: 0%;
transform: translateY(50%);
}
100% {
opacity: 100%;
transform: translateY(0%);
}
}
animation: body-fade-in 600ms ease-in-out;
@media (max-width: ${Constants.sizes.mobile}px) {
font-size: 18px;
line-height: 28px;
letter-spacing: -0.01em;
}
`;
const STYLES_CURSOR_BLINK = css`
display: inline-block;
2022-06-16 20:57:25 +03:00
background-color: ${Constants.semantic.textGray};
2022-07-15 06:05:06 +03:00
width: min(50px, 2.6vw);
height: min(88px, 4.5vw);
margin-left: 6px;
2022-06-16 20:57:25 +03:00
overflow: visible;
2022-07-08 22:27:36 +03:00
@keyframes blink-animation {
to {
visibility: hidden;
}
}
2022-07-08 22:27:36 +03:00
@-webkit-keyframes blink-animation {
to {
visibility: hidden;
}
}
2022-07-08 22:27:36 +03:00
animation: blink-animation 1s steps(5, start) infinite;
-webkit-animation: blink-animation 1s steps(5, start) infinite;
@media (max-width: ${Constants.sizes.tablet}px) {
2022-07-15 06:05:06 +03:00
width: 25px;
height: 44px;
margin-left: 4px;
}
@media (max-width: ${Constants.sizes.mobile}px) {
2022-07-15 06:05:06 +03:00
width: 20px;
height: 35px;
margin-left: 2px;
2021-12-06 15:20:29 +03:00
}
`;
2022-06-16 20:57:25 +03:00
const STYLES_BUTTON = css`
cursor: poitner;
display: inline-flex;
flex-grow: 0;
justify-content: center;
align-items: center;
2022-06-16 20:57:25 +03:00
padding: 18px 32px;
border-radius: 20px;
2022-06-16 20:57:25 +03:00
font-family: ${Constants.font.medium};
font-size: 18px;
line-height: 20px;
2022-07-08 22:27:36 +03:00
letter-spacing: -0.015em;
2022-06-16 20:57:25 +03:00
text-decoration: none;
cursor: pointer;
2022-06-16 20:57:25 +03:00
border: 2px solid ${Constants.semantic.borderGray};
color: ${Constants.semantic.textBlack};
:hover {
2022-06-16 20:57:25 +03:00
background-color: ${Constants.semantic.textGray};
color: ${Constants.semantic.textWhite};
}
2022-07-08 22:27:36 +03:00
@keyframes button-fade-in {
0% {
opacity: 0%;
transform: translateY(50%);
}
50% {
opacity: 0%;
transform: translateY(50%);
}
100% {
opacity: 100%;
transform: translateY(0%);
}
}
animation: button-fade-in 700ms ease-in-out;
@media (max-width: ${Constants.sizes.mobile}px) {
font-size: 18px;
line-height: 24px;
letter-spacing: -0.01em;
padding: 14px 20px;
}
`;
2021-12-06 15:20:29 +03:00
export default function IndexPage() {
const title = `Slate`;
const description = "Your personal search engine";
const url = "https://slate.host/";
const image = `${Constants.gateways.ipfs}/bafkreifww37ypduoi5pvj2cuikz7iycp7l5h7czke6lcboukkaqkoab3t4`;
2022-06-21 00:42:34 +03:00
const next = "../guide/browser-control";
2022-10-03 18:54:00 +03:00
2022-06-21 00:42:34 +03:00
useGuideKeyCommands(next);
2021-12-06 15:20:29 +03:00
return (
<WebsitePrototypeWrapper title={title} description={description} url={url} image={image}>
<div css={STYLES_ROOT}>
2022-07-08 22:27:36 +03:00
<WebsiteHeader />
2021-12-06 15:20:29 +03:00
<div css={STYLES_CONTAINER}>
2022-10-03 18:54:00 +03:00
<div style={{ width: "100%" }}>
<img
css={STYLES_IMG}
width="644"
height="290.72"
src="../public/static/browser-tabs.png"
alt="a list of windows"
/>
</div>
<h1 css={STYLES_HEADING}>
2022-07-08 22:27:36 +03:00
Save, organize, <br />
search
2022-06-16 20:57:25 +03:00
<span css={STYLES_CURSOR_BLINK} />
2022-10-03 18:54:00 +03:00
</h1>
<p css={STYLES_BODY}>
2022-07-08 22:27:36 +03:00
Slate is a personal storage space that helps you keep track and come back to things you
care about on the web.
2022-10-03 18:54:00 +03:00
</p>
<Link href={next}>
<a css={STYLES_BUTTON}>
Get started <SVG.RightArrow height={20} width={20} style={{ marginLeft: 8 }} />
</a>
</Link>
2021-12-06 15:20:29 +03:00
</div>
</div>
2022-06-16 20:57:25 +03:00
<WebsiteFooter />
2021-12-06 15:20:29 +03:00
</WebsitePrototypeWrapper>
);
}