2018-02-12 09:28:31 -08:00
|
|
|
/**
|
2022-10-04 13:59:32 -07:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2018-02-12 09:28:31 -08:00
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2018-02-12 09:28:31 -08:00
|
|
|
*
|
|
|
|
* @flow
|
|
|
|
* @format
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {Button} from 'antd';
|
|
|
|
import React from 'react';
|
|
|
|
import Page from '../components/Page';
|
|
|
|
import Padded from '../components/Padded';
|
2019-08-01 04:10:21 -07:00
|
|
|
import Playground from '../components/Playground/src';
|
2018-02-12 09:28:31 -08:00
|
|
|
import {Row, Col} from 'antd';
|
|
|
|
import './index.css';
|
2018-02-12 10:27:16 -08:00
|
|
|
import ReactNativeLogo from './logos/reactnative.png';
|
|
|
|
import LithoLogo from './logos/litho.png';
|
|
|
|
import ComponentKitLogo from './logos/componentkit.png';
|
2019-02-01 02:52:21 -08:00
|
|
|
import ReactPDFLogo from './logos/reactpdf.png';
|
2018-02-13 03:50:35 -08:00
|
|
|
import Link from 'gatsby-link';
|
2018-02-15 06:12:23 -08:00
|
|
|
import Footer from '../components/Footer';
|
2018-02-12 10:27:16 -08:00
|
|
|
|
2018-02-16 07:09:41 -08:00
|
|
|
const playgroundInitialState = {
|
2018-02-19 02:08:18 -08:00
|
|
|
width: 500,
|
|
|
|
height: 500,
|
|
|
|
alignItems: 1,
|
|
|
|
padding: {
|
|
|
|
top: '20',
|
|
|
|
right: '20',
|
|
|
|
bottom: '20',
|
|
|
|
left: '20',
|
2018-02-16 07:09:41 -08:00
|
|
|
},
|
2018-02-19 02:08:18 -08:00
|
|
|
children: [
|
2018-02-16 07:09:41 -08:00
|
|
|
{
|
2018-02-19 02:08:18 -08:00
|
|
|
width: 100,
|
|
|
|
height: 100,
|
|
|
|
minWidth: null,
|
|
|
|
maxWidth: null,
|
|
|
|
minHeight: null,
|
|
|
|
maxHeight: null,
|
2018-02-16 07:09:41 -08:00
|
|
|
},
|
|
|
|
{
|
2018-02-19 02:08:18 -08:00
|
|
|
width: 100,
|
|
|
|
height: 100,
|
|
|
|
margin: {
|
|
|
|
right: '20',
|
|
|
|
left: '20',
|
2018-02-16 07:09:41 -08:00
|
|
|
},
|
2018-02-19 02:08:18 -08:00
|
|
|
flexGrow: '1',
|
|
|
|
minWidth: null,
|
|
|
|
maxWidth: null,
|
|
|
|
minHeight: null,
|
|
|
|
maxHeight: null,
|
2018-02-16 07:09:41 -08:00
|
|
|
},
|
|
|
|
{
|
2018-02-19 02:08:18 -08:00
|
|
|
width: 100,
|
|
|
|
height: 100,
|
|
|
|
minWidth: null,
|
|
|
|
maxWidth: null,
|
|
|
|
minHeight: null,
|
|
|
|
maxHeight: null,
|
|
|
|
},
|
2018-02-16 07:09:41 -08:00
|
|
|
],
|
2018-02-19 02:08:18 -08:00
|
|
|
minWidth: null,
|
|
|
|
maxWidth: null,
|
|
|
|
minHeight: null,
|
|
|
|
maxHeight: null,
|
2018-02-16 07:09:41 -08:00
|
|
|
};
|
|
|
|
|
2018-02-12 10:27:16 -08:00
|
|
|
const HeroSection = () => (
|
|
|
|
<Padded>
|
|
|
|
<Row className="hero">
|
|
|
|
<Col md={12} sm={24} xs={24}>
|
|
|
|
<h3>INTRODUCING</h3>
|
2018-02-15 06:12:23 -08:00
|
|
|
<h1>
|
|
|
|
Flexible Layouts <br /> with Yoga
|
|
|
|
</h1>
|
2018-02-12 10:27:16 -08:00
|
|
|
<p>
|
2018-02-19 02:08:18 -08:00
|
|
|
Build flexible layouts on any platform with a highly optimized open
|
|
|
|
source layout engine designed with speed, size, and ease of use in
|
|
|
|
mind.
|
2018-02-12 10:27:16 -08:00
|
|
|
</p>
|
|
|
|
|
2018-02-14 08:42:49 -08:00
|
|
|
<Link to="/docs">
|
|
|
|
<Button type="primary" className="button">
|
2018-02-15 06:12:23 -08:00
|
|
|
LEARN MORE
|
2018-02-14 08:42:49 -08:00
|
|
|
</Button>
|
|
|
|
</Link>
|
2018-02-12 10:27:16 -08:00
|
|
|
</Col>
|
|
|
|
<Col md={12} sm={0} xs={0}>
|
|
|
|
<div className="blueprint blueprint-container">
|
2018-02-15 06:12:23 -08:00
|
|
|
<div className="blueprint blueprint-avatar" />
|
|
|
|
<div className="blueprint blueprint-title" />
|
|
|
|
<div className="blueprint blueprint-subtitle" />
|
|
|
|
<div className="blueprint blueprint-content" />
|
2018-02-12 10:27:16 -08:00
|
|
|
</div>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Padded>
|
|
|
|
);
|
|
|
|
|
|
|
|
const PlaygroundSection = () => (
|
2018-02-13 07:34:40 -08:00
|
|
|
<Row>
|
2018-02-16 06:41:58 -08:00
|
|
|
<Col lg={24} md={0} sm={0} xs={0}>
|
2018-02-19 02:08:18 -08:00
|
|
|
<Playground
|
|
|
|
selectedNodePath={[]}
|
|
|
|
showGuides={true}
|
|
|
|
height={601}
|
|
|
|
layoutDefinition={playgroundInitialState}
|
|
|
|
/>
|
2018-02-12 10:27:16 -08:00
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
);
|
|
|
|
|
|
|
|
const AboutSectionOne = () => (
|
|
|
|
<Padded className="about-section">
|
|
|
|
<Row>
|
|
|
|
<Col xl={16} lg={16} md={24} sm={24} xs={24}>
|
2018-02-16 06:42:04 -08:00
|
|
|
<h1>Open Source Adoption</h1>
|
2018-02-12 10:27:16 -08:00
|
|
|
<p>
|
2018-02-19 02:08:18 -08:00
|
|
|
Yoga already powers widely used open source frameworks. It enables
|
|
|
|
these frameworks to offer a simple and intuitive layout API that
|
|
|
|
allows for engineers to collaborate more easily across platforms. Yoga
|
|
|
|
has unlocked exciting features such as calculating layouts off of the
|
|
|
|
main thread to help ensure smooth UI performance.
|
2018-02-12 10:27:16 -08:00
|
|
|
</p>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
2018-02-14 08:42:49 -08:00
|
|
|
<div className="logo-group">
|
|
|
|
<a href="https://fblitho.com" target="_blank" className="logo">
|
2018-02-15 06:12:23 -08:00
|
|
|
<img src={LithoLogo} />
|
2018-02-12 10:27:16 -08:00
|
|
|
<h3>Litho</h3>
|
2018-02-14 08:42:49 -08:00
|
|
|
</a>
|
|
|
|
<a href="https://componentkit.org" target="_blank" className="logo">
|
2018-02-15 06:12:23 -08:00
|
|
|
<img src={ComponentKitLogo} />
|
2018-02-12 10:27:16 -08:00
|
|
|
<h3>ComponentKit</h3>
|
2018-02-14 08:42:49 -08:00
|
|
|
</a>
|
2018-02-15 06:12:23 -08:00
|
|
|
<a
|
2022-10-04 08:29:28 -07:00
|
|
|
href="https://reactnative.dev"
|
2018-02-15 06:12:23 -08:00
|
|
|
target="_blank"
|
|
|
|
className="logo">
|
|
|
|
<img src={ReactNativeLogo} />
|
2018-02-12 10:27:16 -08:00
|
|
|
<h3>React Native</h3>
|
2018-02-14 08:42:49 -08:00
|
|
|
</a>
|
2019-08-01 04:10:21 -07:00
|
|
|
<a href="https://react-pdf.org/" target="_blank" className="logo">
|
2019-02-01 02:52:21 -08:00
|
|
|
<img src={ReactPDFLogo} />
|
|
|
|
<h3>React-PDF</h3>
|
|
|
|
</a>
|
2018-02-14 08:42:49 -08:00
|
|
|
</div>
|
2018-02-12 10:27:16 -08:00
|
|
|
</Padded>
|
|
|
|
);
|
|
|
|
|
|
|
|
const AboutSectionTwo = () => (
|
|
|
|
<Padded className="about-section">
|
|
|
|
<Row>
|
|
|
|
<Col xl={16} lg={16} md={24} sm={24} xs={24}>
|
|
|
|
<h1>Why You May Consider Yoga</h1>
|
2018-02-15 06:12:23 -08:00
|
|
|
|
2018-02-12 10:27:16 -08:00
|
|
|
<h3>PERFORMANCE</h3>
|
|
|
|
<p>
|
2018-02-15 06:12:23 -08:00
|
|
|
Yoga was built to be fast and performance will always be one of Yoga's
|
2018-02-19 02:08:18 -08:00
|
|
|
primary goals. For a layout engine to be able to power any range of
|
|
|
|
applications, it needs to be fast and never stand in the way of a
|
|
|
|
fluid user experience.
|
2018-02-12 10:27:16 -08:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3>CROSS PLATFORM</h3>
|
|
|
|
<p>
|
2018-02-15 06:12:23 -08:00
|
|
|
Yoga is built with cross platform in mind. To ensure Yoga can be used
|
2018-02-16 06:42:04 -08:00
|
|
|
anywhere, it was written in portable C/C++ and has a low number of
|
2018-02-19 02:08:18 -08:00
|
|
|
dependencies and small binary size. This means Yoga can be used on iOS
|
|
|
|
and Android, sharing knowledge, and potentially code, between
|
|
|
|
platforms.
|
2018-02-12 10:27:16 -08:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3>EASY TO LEARN</h3>
|
|
|
|
<p>
|
2018-02-16 06:42:04 -08:00
|
|
|
Yoga is easy to pick up and learn. The interactive documentation pages
|
|
|
|
and a fully fledged layout editor makes it easy to play and learn all
|
|
|
|
the features. If used with any of the major UI frameworks the layout
|
|
|
|
editor even provides code generation.
|
2018-02-12 10:27:16 -08:00
|
|
|
</p>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Padded>
|
|
|
|
);
|
2018-02-12 09:28:31 -08:00
|
|
|
|
|
|
|
export default () => (
|
2018-07-03 10:05:28 -07:00
|
|
|
<div>
|
|
|
|
<Page className="landing-page" title="A cross-platform layout engine">
|
|
|
|
<HeroSection />
|
|
|
|
<PlaygroundSection />
|
|
|
|
<AboutSectionOne />
|
|
|
|
<hr />
|
|
|
|
<AboutSectionTwo />
|
|
|
|
<Footer />
|
|
|
|
</Page>
|
|
|
|
</div>
|
2018-02-12 09:28:31 -08:00
|
|
|
);
|