Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

Kepler.gl Marketing Page Implementation (#40)

Wesam Manassraea96c430201a
diff --git a/package.json b/package.json
index e8030f015..21644a52d 100644
--- a/package.json
+++ b/package.json
@@ -7,9 +7,9 @@
"private": true,
"main": "dist/index.js",
"engines": {
- "node": "^8.7.0",
- "npm": "^5.4.2",
- "yarn": "^0.27.5"
+ "node": ">=8.1.0",
+ "npm": ">=5.4.2",
+ "yarn": ">=0.27.5"
},
"keywords": [
"babel",
diff --git a/src/components/common/icons/files.js b/src/components/common/icons/files.js
index a71e5addf..fee32e18d 100644
--- a/src/components/common/icons/files.js
+++ b/src/components/common/icons/files.js
@@ -1,3 +1,23 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
import PropTypes from 'prop-types';
import React from 'react';
import Base from './base';
diff --git a/website/package.json b/website/package.json
index 40efcb6cc..9df5ce12d 100644
--- a/website/package.json
+++ b/website/package.json
@@ -6,9 +6,9 @@
"main": "dist/index.js",
"version": "0.0.1",
"engines": {
- "node": "^8.7.0",
- "npm": "^5.4.2",
- "yarn": "^0.27.5"
+ "node": ">=8.0.0",
+ "npm": ">=5.4.2",
+ "yarn": ">=0.27.5"
},
"scripts": {
"start": "webpack-dev-server --env.local --content-base ./src/static --progress --open",
@@ -21,12 +21,15 @@
"dependencies": {
"classnames": "^2.2.5",
"global": "^4.3.2",
+ "prop-types": "^15.6.1",
"react": "^15.4.1",
"react-dom": "^15.4.1",
+ "react-palm": "^0.8.1",
"react-redux": "^4.4.5",
"react-router": "^3.0.5",
"react-router-redux": "^4.0.8",
- "react-palm": "^0.8.1",
+ "react-swipeable-views": "^0.12.13",
+ "react-waypoint": "^8.0.1",
"redux": "^3.0.4",
"redux-actions": "^1.2.0",
"redux-thunk": "^1.0.0",
diff --git a/website/src/components/app.js b/website/src/components/app.js
index 0f8bbd301..dee7ddfc0 100644
--- a/website/src/components/app.js
+++ b/website/src/components/app.js
@@ -53,7 +53,9 @@ const GlobalStyleDiv = styled.div`
class App extends Component {
render() {
return (
- <GlobalStyleDiv className="kg-web-content">{this.props.children}</GlobalStyleDiv>
+ <GlobalStyleDiv className="kg-web-content">
+ {this.props.children}
+ </GlobalStyleDiv>
);
}
}
diff --git a/website/src/components/common/card.js b/website/src/components/common/card.js
new file mode 100644
index 000000000..8f9dd080f
--- /dev/null
+++ b/website/src/components/common/card.js
@@ -0,0 +1,129 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React from 'react';
+import styled, {css} from 'styled-components';
+import {media} from '../../styles';
+
+const containerStyles = css`
+ background: white;
+ box-shadow: 0px 3px 15px rgba(0, 0, 0, 0.1);
+ border-radius: 4px;
+ overflow: hidden;
+`;
+
+const VerticalContainer = styled.div`
+ ${containerStyles} width: 350px;
+ height: 400px;
+
+ ${media.palm`
+ width: 100%;
+ height: auto;
+ `};
+`;
+
+const HorizontalContainer = styled.div`
+ ${containerStyles} height: 150px;
+ display: flex;
+ ${media.palm`
+ height: auto;
+ display: block;
+ `};
+`;
+
+const Content = styled.div`
+ padding: ${props => props.theme.margins.medium};
+
+ ${media.palm`
+ padding: ${props => props.theme.margins.small};
+ `};
+`;
+
+const VerticalCardImage = styled.img`
+ display: block;
+ width: 100%;
+ height: 200px;
+ object-fit: cover;
+`;
+
+const HorizontalCardImage = styled.img`
+ height: 150px;
+ width: 150px;
+ object-fit: cover;
+ ${media.palm`
+ width: 100%;
+ height: 100px;
+ `};
+`;
+
+const Title = styled.div`
+ font-size: 18px;
+ font-weight: 500;
+ margin-bottom: 8px;
+`;
+
+const Description = styled.div`
+ font-size: 14px;
+ color: #777;
+ margin-bottom: 8px;
+ height: ${props => (props.size === 'small' ? '40px' : '80px')};
+ line-height: 1.5;
+`;
+
+const Link = styled.div`
+ text-transform: uppercase;
+ font-weight: 700;
+ font-size: 12px;
+ color: black;
+`;
+
+export const VerticalCard = ({
+ title,
+ description,
+ image,
+ linkText,
+ linkUrl
+}) => (
+ <VerticalContainer>
+ <VerticalCardImage src={image} />
+ <Content>
+ <Title>{title}</Title>
+ <Description>{description}</Description>
+ <Link>{linkText}</Link>
+ </Content>
+ </VerticalContainer>
+);
+
+export const HorizontalCard = ({
+ title,
+ description,
+ image,
+ linkText,
+ linkUrl
+}) => (
+ <HorizontalContainer>
+ <HorizontalCardImage src={image} />
+ <Content>
+ <Title>{title}</Title>
+ <Description size="small">{description}</Description>
+ <Link>{linkText}</Link>
+ </Content>
+ </HorizontalContainer>
+);
diff --git a/website/src/components/common/carousel.js b/website/src/components/common/carousel.js
new file mode 100644
index 000000000..0ce132e65
--- /dev/null
+++ b/website/src/components/common/carousel.js
@@ -0,0 +1,101 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+import PropTypes from 'prop-types';
+import styled from 'styled-components';
+import Waypoint from 'react-waypoint';
+
+const Container = styled.div`
+ position: relative;
+ display: flex;
+ justify-content: center;
+ min-height: 200px;
+`;
+
+const Content = styled.div`
+ display: flex;
+ justify-content: center;
+ transform-style: preserve-3d;
+ perspective-origin: center;
+`;
+
+const Item = styled.div`
+ position: absolute;
+ transition: transform 1s;
+ cursor: pointer;
+ transform: perspective(600px)
+ translate3d(${props => props.tX}%, 0, ${props => props.tZ}px);
+`;
+
+export default class Carousel extends PureComponent {
+ static propTypes = {
+ children: PropTypes.node,
+ selectedIndex: PropTypes.number.isRequired,
+ xOffset: PropTypes.number,
+ zOffset: PropTypes.number
+ };
+
+ static defaultProps = {
+ xOffset: 15,
+ zOffset: 60
+ };
+
+ state = {
+ isVisible: false
+ };
+
+ _onWaypointEnter = () => {
+ this.setState({isVisible: true});
+ };
+
+ _onWaypointLeave = () => {
+ this.setState({isVisible: false});
+ };
+
+ render() {
+ const {selectedIndex, children, xOffset, zOffset} = this.props;
+ const {isVisible} = this.state;
+ return (
+ <Waypoint onEnter={this._onWaypointEnter} onLeave={this._onWaypointLeave}>
+ <Container>
+ <Content>
+ {children.map((item, i) => {
+ const translateX = isVisible ? (i - selectedIndex) * xOffset : 0;
+ const translateZ = -Math.abs(i - selectedIndex) * zOffset;
+ return (
+ <Item
+ key={`carousel-item-${i}`}
+ tX={translateX}
+ tZ={translateZ}
+ onClick={() => {
+ this.props.onChange(i);
+ }}
+ >
+ {item}
+ </Item>
+ );
+ })}
+ </Content>
+ </Container>
+ </Waypoint>
+ );
+ }
+}
diff --git a/website/src/components/common/section.js b/website/src/components/common/section.js
new file mode 100644
index 000000000..a5e04f497
--- /dev/null
+++ b/website/src/components/common/section.js
@@ -0,0 +1,107 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+import PropTypes from 'prop-types';
+import styled from 'styled-components';
+import StaggeredScrollAnimation from './staggered-scroll-animation';
+
+import {media} from '../../styles';
+
+export const SectionIcon = styled.img`
+ width: 64px;
+ ${media.palm`
+ width: 48px;
+ `};
+`;
+
+export const SectionContainer = styled.div`
+ color: ${props => (props.isDark ? 'white' : 'black')};
+ background: ${props =>
+ props.isDark
+ ? props.theme.darkBackgroundColor
+ : props.background
+ ? `url(${props.background})`
+ : 'white'};
+ padding: ${props => props.theme.margins.huge};
+ margin-bottom: ${props => props.theme.margins.large};
+ background-size: cover;
+
+ ${media.portable`
+ padding: ${props => props.theme.margins.large}
+ `} ${media.palm`
+ padding: ${props => props.theme.margins.medium}
+ `};
+`;
+
+export const SectionHeader = styled.div`
+ text-align: center;
+ margin-bottom: ${props => props.theme.margins.large};
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+`;
+
+export const SectionTitle = styled.div`
+ font-size: 30px;
+ font-weight: 500;
+ ${media.palm`
+ font-size: 24px;
+ `};
+`;
+
+export const SectionDescription = styled.div`
+ font-size: 20px;
+ max-width: 500px;
+ ${media.palm`
+ font-size: 16px;
+ `};
+`;
+
+class Section extends PureComponent {
+ static propTypes = {
+ title: PropTypes.string.isRequired,
+ description: PropTypes.string.isRequired,
+ icon: PropTypes.string.isRequired,
+ isDark: PropTypes.bool,
+ background: PropTypes.string,
+ children: PropTypes.node.isRequired
+ };
+
+ static defaultProps = {
+ isDark: false
+ };
+
+ render() {
+ const {icon, title, description, isDark, background, children} = this.props;
+ return (
+ <SectionContainer isDark={isDark} background={background}>
+ <StaggeredScrollAnimation Container={SectionHeader}>
+ <SectionIcon src={icon} />
+ <SectionTitle>{title}</SectionTitle>
+ <SectionDescription>{description}</SectionDescription>
+ </StaggeredScrollAnimation>
+ {children}
+ </SectionContainer>
+ );
+ }
+}
+
+export default Section;
diff --git a/website/src/components/common/slideshow.js b/website/src/components/common/slideshow.js
new file mode 100644
index 000000000..156f73244
--- /dev/null
+++ b/website/src/components/common/slideshow.js
@@ -0,0 +1,112 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+import PropTypes from 'prop-types';
+import styled from 'styled-components';
+import {setInterval, clearInterval} from 'global/window';
+import {media} from '../../styles';
+
+const imageRatio = 696 / 1080;
+
+const StyledImgContainer = styled.div`
+ box-shadow: 0 12px 24px 0 rgba(0, 0, 0, 0.5);
+ flex-shrink: 0;
+ opacity: 1;
+ position: relative;
+
+ width: calc(100vw - 60px);
+ height: ${imageRatio * 100}vw;
+
+ max-width: 800px;
+ max-height: ${800 * imageRatio}px;
+
+ ${media.palm`
+ width: calc(100vw - 60px);
+ height: ${imageRatio * 100}vw;
+ `};
+`;
+
+const StyledImg = styled.img`
+ width: 100%;
+ height: 100%;
+ display: block;
+ position: absolute;
+ top: 0;
+ transition: opacity ${props => props.fadeDuration}ms;
+ opacity: ${props => (props.isVisible ? '1.0' : '0.0')};
+`;
+
+export default class SlideShow extends PureComponent {
+ static propTypes = {
+ images: PropTypes.arrayOf(PropTypes.string).isRequired,
+ slideDuration: PropTypes.number,
+ fadeDuration: PropTypes.number
+ };
+
+ static defaultProps = {
+ slideDuration: 5000,
+ fadeDuration: 2000
+ };
+
+ constructor(props) {
+ super(props);
+ this._intervalId = null;
+ }
+
+ state = {
+ currentIndex: 0
+ };
+
+ componentDidMount() {
+ this._intervalId = setInterval(
+ this._transitionImage,
+ this.props.slideDuration
+ );
+ }
+
+ componentWillUnmount() {
+ clearInterval(this._intervalId);
+ }
+
+ _transitionImage = () => {
+ const {images} = this.props;
+ const {currentIndex} = this.state;
+ this.setState({
+ currentIndex: currentIndex === images.length - 1 ? 0 : currentIndex + 1
+ });
+ };
+
+ render() {
+ const {images, fadeDuration} = this.props;
+ return (
+ <StyledImgContainer>
+ {images.map((src, i) => (
+ <StyledImg
+ key={src}
+ src={src}
+ fadeDuration={fadeDuration}
+ isVisible={i <= this.state.currentIndex}
+ />
+ ))}
+ </StyledImgContainer>
+ );
+ }
+}
diff --git a/website/src/components/common/staggered-scroll-animation.js b/website/src/components/common/staggered-scroll-animation.js
new file mode 100644
index 000000000..d2f6d59c1
--- /dev/null
+++ b/website/src/components/common/staggered-scroll-animation.js
@@ -0,0 +1,84 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+import PropTypes from 'prop-types';
+import Waypoint from 'react-waypoint';
+import styled from 'styled-components';
+
+const FadeIn = styled.div`
+ opacity: ${props => (props.isVisible ? '1.0' : '0.0')};
+ transform: ${props => (props.isVisible ? undefined : 'translateY(10px)')};
+ transition: ${props =>
+ `opacity 350ms ${props.delay}ms, transform 350ms ${props.delay}ms`};
+`;
+
+export default class StaggeredScrollAnimation extends PureComponent {
+ static propTypes = {
+ duration: PropTypes.number,
+ delay: PropTypes.number,
+ animateOnce: PropTypes.bool,
+ Container: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
+ scrollOffsetTop: PropTypes.number
+ };
+
+ static defaultProps = {
+ duration: 500,
+ delay: 150,
+ animateOnce: true,
+ Container: 'div',
+ scrollOffsetTop: -100
+ };
+
+ state = {
+ isVisible: false
+ };
+
+ _onWaypointEnter = () => {
+ this.setState({isVisible: true});
+ };
+
+ _onWaypointLeave = () => {
+ const {animateOnce} = this.props;
+ if (!animateOnce) {
+ this.setState({isVisible: false});
+ }
+ };
+
+ render() {
+ const {isVisible} = this.state;
+ const {delay, children, Container, scrollOffsetTop} = this.props;
+ return (
+ <Waypoint
+ onEnter={this._onWaypointEnter}
+ onLeave={this._onWaypointLeave}
+ topOffset={scrollOffsetTop}
+ >
+ <Container>
+ {children.map((item, i) => (
+ <FadeIn isVisible={isVisible} delay={delay * i}>
+ {item}
+ </FadeIn>
+ ))}
+ </Container>
+ </Waypoint>
+ );
+ }
+}
diff --git a/website/src/components/common/styled-components.js b/website/src/components/common/styled-components.js
index 69f01a343..1c6e6e6e3 100644
--- a/website/src/components/common/styled-components.js
+++ b/website/src/components/common/styled-components.js
@@ -18,25 +18,36 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-import styled from 'styled-components';
+import styled, {css} from 'styled-components';
+import {media} from '../../styles';
-export const Button = styled.div.attrs({
- className: 'kg-button'
-})`
+const buttonStyles = css`
align-items: center;
background-color: ${props =>
- props.negative
- ? props.theme.negativeBtnBgd
- : props.secondary
- ? props.theme.secondaryBtnBgd
- : props.link ? props.theme.linkBtnBgd : props.theme.primaryBtnBgd};
+ props.negative
+ ? props.theme.negativeBtnBgd
+ : props.secondary
+ ? props.theme.secondaryBtnBgd
+ : props.outline
+ ? props.theme.outlineBtnBgd
+ : props.outlineDark
+ ? props.outlineDarkBtnBgd
+ : props.link
+ ? props.theme.linkBtnBgd
+ : props.theme.primaryBtnBgd};
border-radius: ${props => props.theme.primaryBtnRadius};
color: ${props =>
- props.negative
- ? props.theme.negativeBtnColor
- : props.secondary
- ? props.theme.secondaryBtnColor
- : props.link ? props.theme.linkBtnColor : props.theme.primaryBtnColor};
+ props.negative
+ ? props.theme.negativeBtnColor
+ : props.secondary
+ ? props.theme.secondaryBtnColor
+ : props.outline
+ ? props.outlineBtnColor
+ : props.outlineDark
+ ? props.theme.outlineDarkBtnColor
+ : props.link
+ ? props.theme.linkBtnColor
+ : props.theme.primaryBtnColor};
cursor: pointer;
display: inline-flex;
font-size: ${props => (props.large ? '14px' : '11px')};
@@ -45,35 +56,75 @@ export const Button = styled.div.attrs({
letter-spacing: 0.3px;
line-height: 14px;
outline: 0;
+ border: ${props =>
+ props.outline
+ ? `1px solid ${props.theme.outlineBtnColor}`
+ : props.outlineDark
+ ? `1px solid ${props.theme.outlineDarkBtnColor}`
+ : 'none'};
padding: ${props => (props.large ? '14px 32px' : '9px 12px')};
text-align: center;
- transition: ${props => props.theme.transition};
+ transition: ${props => props.theme.btnTransition};
vertical-align: middle;
width: ${props => props.width || 'auto'};
+ text-transform: uppercase;
:hover,
:focus,
:active,
+ /*:visited,*/
&.active {
background-color: ${props =>
- props.negative
- ? props.theme.negativeBtnBgdHover
- : props.secondary
- ? props.theme.secondaryBtnBgdHover
- : props.link
- ? props.theme.linkBtnActBgdHover
- : props.theme.primaryBtnBgdHover};
+ props.negative
+ ? props.theme.negativeBtnBgdHover
+ : props.secondary
+ ? props.theme.secondaryBtnBgdHover
+ : props.outline
+ ? props.theme.outlineBtnBgdHover
+ : props.outlineDark
+ ? props.theme.outlineDarkBtnBgdHover
+ : props.link
+ ? props.theme.linkBtnActBgdHover
+ : props.theme.primaryBtnBgdHover};
color: ${props =>
- props.negative
- ? props.theme.negativeBtnActColor
- : props.secondary
- ? props.theme.secondaryBtnActColor
- : props.link
- ? props.theme.linkBtnActColor
- : props.theme.primaryBtnActColor};
+ props.negative
+ ? props.theme.negativeBtnActColor
+ : props.secondary
+ ? props.theme.secondaryBtnActColor
+ : props.outline
+ ? props.theme.outlineBtnActColor
+ : props.outlineDark
+ ? props.outlineDarkBtnActColor
+ : props.link
+ ? props.theme.linkBtnActColor
+ : props.theme.primaryBtnActColor};
}
- svg {
+ svg,
+ img {
+ width: 14px;
margin-right: 8px;
}
+
+ ${media.palm`
+ font-size: 11px;
+ padding: 9px 12px;
+ `};
+`;
+
+export const Button = styled.div.attrs({
+ className: 'kg-button'
+})`
+ ${buttonStyles};
+`;
+
+export const LinkButton = styled.a`
+ color: black;
+ ${buttonStyles};
+`;
+
+export const CenteredContent = styled.div`
+ display: flex;
+ align-items: center;
+ justify-content: center;
`;
diff --git a/website/src/components/common/swipeable.js b/website/src/components/common/swipeable.js
new file mode 100644
index 000000000..384341d98
--- /dev/null
+++ b/website/src/components/common/swipeable.js
@@ -0,0 +1,85 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+import styled from 'styled-components';
+import SwipeableViews from 'react-swipeable-views';
+
+const PaginationContainer = styled.div`
+ display: flex;
+ justify-content: center;
+`;
+
+// To increase click area for better usuablity
+const PaginationBarWrapper = styled.div`
+ padding: 16px 0px;
+ cursor: pointer;
+ margin-left: 2px;
+ :first-child {
+ margin-left: 0px;
+ }
+`;
+const PaginationBar = styled.div`
+ width: 50px;
+ height: 4px;
+ background: white;
+ opacity: ${props => (props.isActive ? '1.0' : '0.5')};
+ transition: opacity 200ms;
+`;
+
+const Pagination = ({items, selectedIndex, onChange}) => (
+ <PaginationContainer>
+ {items.map((item, index) => (
+ <PaginationBarWrapper onClick={() => onChange(index)}>
+ <PaginationBar isActive={index === selectedIndex} />
+ </PaginationBarWrapper>
+ ))}
+ </PaginationContainer>
+);
+
+export default class Swipeable extends PureComponent {
+ state = {
+ selectedIndex: 0
+ };
+
+ _onChange = index => {
+ this.setState({selectedIndex: index});
+ };
+
+ render() {
+ const {children} = this.props;
+ const {selectedIndex} = this.state;
+ return (
+ <div>
+ <SwipeableViews
+ enableMouseEvents
+ index={selectedIndex}
+ onChange={this._onChange}>
+ {children}
+ </SwipeableViews>
+ <Pagination
+ items={children}
+ selectedIndex={selectedIndex}
+ onChange={this._onChange}
+ />
+ </div>
+ );
+ }
+}
diff --git a/website/src/components/common/youtube-video.js b/website/src/components/common/youtube-video.js
new file mode 100644
index 000000000..90d194fc2
--- /dev/null
+++ b/website/src/components/common/youtube-video.js
@@ -0,0 +1,37 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+
+export default class YoutubeVideo extends PureComponent {
+ render() {
+ const {src} = this.props;
+ return (
+ <iframe
+ src={src}
+ style={{
+ border: 'none',
+ width: '100%',
+ height: '100%'
+ }}
+ />
+ );
+ }
+}
diff --git a/website/src/components/examples.js b/website/src/components/examples.js
new file mode 100644
index 000000000..d7455d615
--- /dev/null
+++ b/website/src/components/examples.js
@@ -0,0 +1,87 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+import styled from 'styled-components';
+
+import {EXAMPLES} from '../content';
+import {media} from '../styles';
+import StaggeredScrollAnimation from './common/staggered-scroll-animation';
+import {VerticalCard} from './common/card';
+import {LinkButton, CenteredContent} from './common/styled-components';
+
+const CardsContainer = styled.div`
+ display: flex;
+ justify-content: center;
+ flex-wrap: wrap;
+ margin-bottom: ${props => props.theme.margins.large};
+ ${media.palm`
+ display: block;
+ `};
+`;
+
+const StyledCardContainer = styled.a`
+ display: block;
+ margin: ${props => props.theme.margins.small};
+ color: black;
+ cursor: pointer;
+ transition: transform 350ms;
+ :hover {
+ transform: scale3d(1.05, 1.05, 1.05);
+ }
+ ${media.palm`
+ margin: 0px;
+ margin-bottom: ${props => props.theme.margins.small}
+ `};
+`;
+
+const CardContainer = ({linkUrl, children}) => (
+ <StyledCardContainer href={linkUrl} target="_blank">
+ {children}
+ </StyledCardContainer>
+);
+
+class Examples extends PureComponent {
+ render() {
+ return (
+ <div>
+ <StaggeredScrollAnimation Container={CardsContainer}>
+ {EXAMPLES.map(({title, description, image, url}, i) => (
+ <CardContainer linkUrl={url} key={`example-${i}`}>
+ <VerticalCard
+ title={title}
+ description={description}
+ image={image}
+ linkText="Explore Map"
+ />
+ </CardContainer>
+ ))}
+ </StaggeredScrollAnimation>
+ <CenteredContent>
+ <LinkButton outline large href="#/demo">
+ See More
+ </LinkButton>
+ </CenteredContent>
+ </div>
+ );
+ }
+}
+
+export default Examples;
diff --git a/website/src/components/features.js b/website/src/components/features.js
new file mode 100644
index 000000000..edff405ba
--- /dev/null
+++ b/website/src/components/features.js
@@ -0,0 +1,102 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+import styled from 'styled-components';
+
+import {cdnUrl} from '../utils';
+import {FEATURES} from '../content';
+import {media} from '../styles';
+import StaggeredScrollAnimation from './common/staggered-scroll-animation';
+import {LinkButton, CenteredContent} from './common/styled-components';
+
+const FeaturesContainer = styled.div`
+ display: flex;
+ justify-content: center;
+ flex-wrap: wrap;
+ margin-bottom: ${props => props.theme.margins.large};
+`;
+
+const FeatureContainer = styled.div`
+ text-align: center;
+ width: 350px;
+ padding: 24px;
+ margin: ${props => props.theme.margins.small};
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ ${media.palm`
+ margin: 0px;
+ margin-bottom: ${props => props.theme.margins.small}
+ `};
+`;
+
+const FeatureImage = styled.img`
+ display: inline;
+ border-radius: 50px;
+ width: 75px;
+ height: 75px;
+ margin-bottom: ${props => props.theme.margins.small};
+`;
+
+const FeatureTitle = styled.div`
+ font-size: 20px;
+ font-weight: 500;
+ margin-bottom: ${props => props.theme.margins.small};
+`;
+
+const FeatureDescription = styled.div`
+ font-size: 16px;
+ color: #535353;
+`;
+
+const Feature = ({title, description, image}) => (
+ <FeatureContainer>
+ <FeatureImage src={image} />
+ <FeatureTitle>{title}</FeatureTitle>
+ <FeatureDescription>{description}</FeatureDescription>
+ </FeatureContainer>
+);
+
+class Features extends PureComponent {
+ render() {
+ return (
+ <div>
+ <StaggeredScrollAnimation Container={FeaturesContainer}>
+ {FEATURES.map(({title, description, image}, i) => (
+ <Feature
+ key={`feature-${i}`}
+ title={title}
+ description={description}
+ image={image}
+ />
+ ))}
+ </StaggeredScrollAnimation>
+ <CenteredContent>
+ <LinkButton large outline href="https://github.com/uber/kepler.gl">
+ <img src={cdnUrl('icons/github-black.svg')} /> Open Source
+ </LinkButton>
+ </CenteredContent>
+ </div>
+ );
+ }
+}
+
+export default Features;
diff --git a/website/src/components/footer.js b/website/src/components/footer.js
new file mode 100644
index 000000000..621f36edb
--- /dev/null
+++ b/website/src/components/footer.js
@@ -0,0 +1,146 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+import styled from 'styled-components';
+
+import {cdnUrl} from '../utils';
+import {LinkButton} from './common/styled-components';
+import {media} from '../styles';
+
+const Container = styled.div`
+ background: #242730;
+ padding: ${props => props.theme.margins.huge};
+`;
+
+const LogosContainer = styled.div`
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ ${media.palm`
+ flex-direction: column;
+ `};
+`;
+
+const BrandingContainer = styled.div`
+ display: inline-flex;
+ align-items: flex-end;
+ ${media.palm`
+ margin-top: ${props => props.theme.margins.small};
+ `};
+`;
+
+const CreatedBy = styled.div`
+ display: inline-flex;
+ margin-left: 20px;
+ align-items: center;
+ color: ${props => props.theme.footerColor};
+ font-size: 11px;
+ justify-content: center;
+ letter-spacing: 0.5px;
+ line-height: 14px;
+ width: 100%;
+ z-index: 101;
+`;
+
+const StyledLogo = styled.span`
+ font-size: 11px;
+ font-weight: 700;
+ letter-spacing: 4px;
+ position: relative;
+ margin-left: 1rem;
+ margin-top: 0;
+ margin-bottom: 0;
+
+ a {
+ color: #e5e5e4;
+ letter-spacing: 2px;
+ }
+
+ :before {
+ content: '';
+ background: url(${cdnUrl('icons/viz_logo_bw.png')}) no-repeat;
+ background-size: cover;
+ height: 20px;
+ width: 24px;
+ position: absolute;
+ top: -5px;
+ left: -25px;
+ }
+`;
+
+const ButtonContainer = styled.div`
+ display: flex;
+ margin-top: 32px;
+
+ a {
+ width: 160px;
+ }
+
+ ${media.palm`
+ display: flex;
+ justify-content: center;
+ width: 100%;
+
+ a {
+ width: 50%;
+ }
+ `};
+`;
+
+export default class Footer extends PureComponent {
+ render() {
+ return (
+ <Container>
+ <LogosContainer>
+ <img src={cdnUrl('icons/kepler-s.svg')} />
+ <BrandingContainer>
+ <img src={cdnUrl('icons/uber.svg')} />
+ <CreatedBy>
+ <StyledLogo className="fg">
+ <a
+ target="_blank"
+ rel="noopener noreferrer"
+ href="http://vis.gl"
+ >
+ ISUALIZATION
+ </a>
+ </StyledLogo>
+ </CreatedBy>
+ </BrandingContainer>
+ </LogosContainer>
+ <ButtonContainer>
+ <LinkButton large href="#/demo">
+ Get Started
+ </LinkButton>
+ <LinkButton
+ large
+ outlineDark
+ href="https://github.com/uber/kepler.gl"
+ style={{marginLeft: '5px'}}
+ >
+ <img src={cdnUrl('icons/github.svg')} /> Github
+ </LinkButton>
+ </ButtonContainer>
+ </Container>
+ );
+ }
+}
diff --git a/website/src/components/hero.js b/website/src/components/hero.js
new file mode 100644
index 000000000..859156b8e
--- /dev/null
+++ b/website/src/components/hero.js
@@ -0,0 +1,222 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+import styled, {keyframes} from 'styled-components';
+import {window} from 'global';
+
+import {cdnUrl} from '../utils';
+import {media, breakPoints} from '../styles';
+import {HERO_IMAGES, HERO_IMAGES_SCALED} from '../content';
+import SlideShow from './common/slideshow';
+import {LinkButton} from './common/styled-components';
+
+const SlideShowAnimation = keyframes`
+ 0% {
+ opacity: 0;
+ transform: translate(0, 20px);
+ }
+
+ 100% {
+ opacity: 1.0
+ }
+`;
+
+const FadeIn = styled.div`
+ animation-name: ${SlideShowAnimation};
+ animation-timing-function: ease-in-out;
+ animation-duration: 1s;
+ animation-delay: 500ms;
+ animation-fill-mode: both;
+`;
+
+const Container = styled.div`
+ padding: ${props => props.theme.margins.huge};
+ color: white;
+ position: relative;
+
+ ${media.palm`
+ padding-top: ${props => props.theme.margins.large};
+ `}
+`;
+
+const Content = styled.div`
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+
+ ${media.palm`
+ margin-top: 3rem;
+ `};
+`;
+
+const BackgroundImage = styled.img`
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ width: 100%;
+ height: 70%;
+ object-fit: cover;
+ background: #0f1d29;
+`;
+
+const StyledCaption = styled.div`
+ max-width: 450px;
+ text-align: center;
+ margin-bottom: 32px;
+ margin-top: 6rem;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+
+ ${media.palm`
+ width: auto;
+ padding-top: 0;
+ margin-right: 0;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ margin-top: 0px;
+ `} .kg-home__caption__subtitle {
+ font-size: 36px;
+ font-weight: 600;
+ margin-bottom: 20px;
+ line-height: 1.3;
+
+ ${media.palm`
+ font-size: 20px;
+ `};
+ }
+
+ .kg-home__caption__description {
+ font-size: 14px;
+ color: ${props => props.theme.labelColor};
+ line-height: 24px;
+ margin-bottom: 32px;
+ max-width: 400px;
+
+ span.t-bold {
+ color: ${props => props.theme.textColor};
+ font-weight: 500;
+ }
+
+ ${media.palm`
+ margin-bottom: 32px;
+ text-align: center;
+ font-size: 12px;
+ `};
+ }
+`;
+
+const Logo = styled.img`
+ position: absolute;
+ left: 0;
+ top: 0;
+
+ ${media.palm`
+ position: inherit;
+ margin-top: ${props => props.theme.margins.normal};
+ margin-bottom: ${props => props.theme.margins.small};
+ `};
+`;
+
+const ButtonContainer = styled.div`
+ display: flex;
+ justify-content: center;
+
+ a {
+ width: 160px;
+ }
+
+ ${media.palm`
+ display: flex;
+ justify-content: center;
+ width: 100%;
+
+ a {
+ width: 50%;
+ }
+ `};
+`;
+
+export default class Hero extends PureComponent {
+ state = {
+ window: window.innerWidth,
+ height: window.innerHeight
+ };
+
+ componentDidMount() {
+ window.addEventListener('resize', this.resize);
+ this.resize();
+ }
+
+ componentWillUnmount() {
+ window.removeEventListener('resize', this.resize);
+ }
+
+ resize = () => {
+ this.setState({
+ width: window.innerWidth,
+ height: window.innerHeight
+ });
+ };
+
+ render() {
+ const isPalm = this.state.width <= breakPoints.palm;
+ return (
+ <Container>
+ <BackgroundImage src={cdnUrl('hero/kepler.gl-background.png')} />
+ <Content>
+ <Logo src={cdnUrl('icons/kepler-s.svg')} />
+ <StyledCaption>
+ <div className="kg-home__caption__subtitle">
+ Make an impact with your location data
+ </div>
+ <div className="kg-home__caption__description">
+ <span>Kepler.gl is a powerful </span>
+ <span className="t-bold"> open source </span>
+ <span>geospatial analysis tool&nbsp;for </span>
+ <span className="t-bold">large-scale&nbsp;</span>
+ <span>data sets.</span>
+ </div>
+ <ButtonContainer>
+ <LinkButton large href="#/demo">
+ Get Started
+ </LinkButton>
+ <LinkButton
+ large
+ outlineDark
+ href="https://github.com/uber/kepler.gl"
+ style={{marginLeft: '5px'}}
+ >
+ <img src={cdnUrl('icons/github.svg')} /> Github
+ </LinkButton>
+ </ButtonContainer>
+ </StyledCaption>
+ <FadeIn>
+ <SlideShow images={isPalm ? HERO_IMAGES_SCALED : HERO_IMAGES} />
+ </FadeIn>
+ </Content>
+ </Container>
+ );
+ }
+}
diff --git a/website/src/components/home.js b/website/src/components/home.js
index 76dff9d9f..a43fd4f05 100644
--- a/website/src/components/home.js
+++ b/website/src/components/home.js
@@ -18,402 +18,54 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-import React, {Component} from 'react';
-import window from 'global/window';
-import styled, {keyframes, ThemeProvider} from 'styled-components';
-import {media, breakPoints, theme} from '../styles';
-
-export const CLOUDFRONT = 'https://d1a3f4spazzrp4.cloudfront.net/';
-export const KEPLER_GL_BUCKET = 'kepler.gl/';
-
-import {Button} from './common/styled-components';
-
-// ee755ad8-3d68-4559-ab6b-cdcedb3a4d04
-const imgRatio = 696 / 1080;
-
-const imageSize = {w: 1080, h: 696, top: 137, right: 132, palm: 272};
-const screenSize = {w: 1680, h: 954};
-const imgToScrRatio = imageSize.w / screenSize.w;
-
-const imgMinW = 880;
-const screenMinW = imgMinW / imgToScrRatio;
-const minRight = imageSize.right / imageSize.w * imgMinW;
-const minTop = imageSize.top / imageSize.w * imgMinW;
-
-const IMAGES = [
- 'kepler.gl-hexagon.png',
- 'kepler.gl-points.png',
- 'kepler.gl-contours.png'
-];
-
-const IMAGES_S = IMAGES.map(img => img.replace('.png', '_s.png'));
-const LOGO = 'viz_logo_bw.png';
-
-const StyledHome = styled.div`
- min-height: 100vh;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- color: ${props => props.theme.textColor};
-
-
- a {
- color: ${props => props.theme.labelColor};
- }
-
-`;
-
-const StyledMapContainer = styled.div`
- position: fixed;
- top: 0;
- left: 0;
- z-index: 0;
-
- .kg-home__map__blocker {
- width: 100%;
- height: 100%;
- position: fixed;
- top: 0;
- left: 0;
- background-color: ${props => props.theme.mapBlocker};
- opacity: 0.6;
- z-index: 1;
- pointer-events: none;
- }
-`;
-
-const StyledHomeContent = styled.div`
- padding-top: 136px;
- position: relative;
- z-index: 1;
- display: flex;
- justify-content: space-between;
-
- ${media.palm`
- padding-left: 24px;
- padding-right: 24px;
- padding-top: 76px;
- align-items: center;
- flex-direction: column;
- display: flex;
- `};
-`;
-
-// based on keyframe aniamtion to fade img
-// http://css3.bradshawenterprises.com/cfimg/
-
-// styled-components keyframe
-// https://github.com/styled-components/styled-components/blob/master/docs/tips-and-tricks.md
-
-const a = 3;
-const b = 2;
-const d = a + b;
-const n = 3;
-const t = d * 3;
-
-const animationName = keyframes`
- 0% {
- opacity:1;
- }
- ${a / t * 100}% {
- opacity:1;
- }
- ${1 / n * 100}% {
- opacity:0;
- }
- ${(1 - b / t) * 100}% {
- opacity:0;
- }
- 100% {
- opacity:1;
- }
-`;
-
-const StyledImgContainer = styled.div`
- box-shadow: 0 12px 24px 0 rgba(0, 0, 0, 0.5);
- flex-shrink: 0;
- opacity: 1;
- position: relative;
-
- ${media.palm`
- width: 100%;
- `} img {
- animation-name: ${animationName};
- animation-timing-function: ease-in-out;
- animation-iteration-count: infinite;
- animation-duration: ${d * n}s;
- }
-
- img:nth-of-type(1) {
- animation-delay: ${d * 2}s;
- }
- img:nth-of-type(2) {
- animation-delay: ${d}s;
- }
- img:nth-of-type(3) {
- animation-delay: 0s;
- }
-`;
-
-const StyledCaption = styled.div`
- min-width: 250px;
- max-width: 280px;
- margin-right: 60px;
- padding-top: 70px;
-
- ${media.palm`
- width: auto;
- padding-top: 0;
- margin-right: 0;
- display: flex;
- flex-direction: column;
- align-items: center;
- `} .kg-home__caption__title {
- font-size: 44px;
- letter-spacing: 1.83px;
- margin-bottom: 20px;
- font-weight: 600;
- }
-
- .kg-home__caption__description {
- font-size: 14px;
- color: ${props => props.theme.labelColor};
- line-height: 24px;
- margin-bottom: 64px;
-
- span.t-bold {
- color: ${props => props.theme.textColor};
- font-weight: 500;
- }
-
- ${media.palm`
- margin-bottom: 32px;
- text-align: center;
- `};
- }
-
- .kg-home__caption__bottom {
- ${media.palm`
- margin-top: 30px;
- text-align: center;
- `} .kg-home__caption__bottom__title {
- font-size: 16px;
- letter-spacing: 0.67px;
- margin-bottom: 16px;
- font-weight: 600;
- }
-
- .kg-button {
- background: #005cd2;
- box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.24);
- letter-spacing: 0.25px;
- font-weight: 600;
-
- :hover {
- background: #196cd6;
- }
- }
- }
-`;
-
-const StyledHeader = styled.div`
- top: 0;
- position: absolute;
- display: flex;
-
- align-items: center;
- color: ${props => props.theme.footerColor};
- font-size: 11px;
- justify-content: center;
- letter-spacing: 0.5px;
- line-height: 14px;
- margin: 32px 0;
- width: 100%;
- z-index: 101;
-
- ${media.palm`
- margin-top: 16px;
- bottom: auto;
- margin-bottom: 64px;
- `};
-`;
-
-const StyledLogo = styled.span`
- font-size: 11px;
- font-weight: 700;
- letter-spacing: 4px;
- position: relative;
- margin-left: 2.2rem;
- margin-top: 0;
- margin-bottom: 0;
-
- a {
- padding: 0 1rem 0 0;
- color: #e5e5e4;
- letter-spacing: 2px;
- }
-
- :before {
- content: '';
- background: url(${`${CLOUDFRONT}${KEPLER_GL_BUCKET}${LOGO}`}) no-repeat;
- background-size: cover;
- height: 20px;
- width: 24px;
- position: absolute;
- top: -2px;
- left: -30px;
- }
-`;
-
-const Container = styled.div`
- height: 100vh;
- overflow-y: auto;
- overflow-x: hidden;
- background-color: #0d1823;
-`;
-
-class Home extends Component {
- state = {
- window: window.innerWidth,
- height: window.innerHeight
- };
- componentDidMount() {
- window.addEventListener('resize', this.resize);
- this.resize();
- }
- componentWillUnmount() {
- window.removeEventListener('resize', this.resize);
- }
- resize = () => {
- this.setState({
- width: window.innerWidth,
- height: window.innerHeight
- });
- };
+import React, {PureComponent} from 'react';
+import {ThemeProvider} from 'styled-components';
+
+import {theme} from '../styles';
+import {SECTIONS} from '../content';
+import Hero from './hero';
+import Showcase from './showcase';
+import Examples from './examples';
+import Tutorials from './tutorials';
+import Walkthrough from './walkthrough';
+import Features from './features';
+import Footer from './footer';
+import Section from './common/section';
+
+const SECTION_CONTENT = {
+ showcase: Showcase,
+ walkthrough: Walkthrough,
+ features: Features,
+ examples: Examples,
+ tutorials: Tutorials
+};
+
+export default class Home extends PureComponent {
render() {
- const isPalm = this.state.width <= breakPoints.palm;
- const imgW = isPalm
- ? this.state.width - 48
- : this.state.width * imgToScrRatio;
- const shrink = this.state.width / screenSize.w;
-
return (
<ThemeProvider theme={theme}>
- <Container>
- <StyledHome className="kg-home">
- <StyledHeader>
- <div>Created By</div>
- <StyledLogo className="fg">
- <a target="_blank" rel="noopener noreferrer" href="http://vis.gl">
- VIS.GL
- </a>
- </StyledLogo>
- </StyledHeader>
-
- <StyledMapContainer className="kg-home__map">
- <div className="kg-home__map__blocker" />
- <img
- style={{
- width: `${this.state.width}px`,
- height: 'auto',
- minWidth: `${screenMinW}px`
- }}
- src={`${CLOUDFRONT}${KEPLER_GL_BUCKET}kepler.gl-background.png`}
- />
- </StyledMapContainer>
-
- <StyledHomeContent
- style={
- isPalm
- ? {}
- : {
- paddingLeft: '72px',
- paddingRight: `${Math.max(
- imageSize.right * shrink,
- minRight
- )}px`,
- paddingTop: `${Math.max(imageSize.top * shrink, minTop)}px`
- }
- }
- >
- <StyledCaption>
- <div className="kg-home__caption__title">Kepler.gl</div>
- <div className="kg-home__caption__description">
- <span>Kepler.gl is a powerful </span>
- <span className="t-bold">web-based </span>
- <span>geospatial data analysis tool. Built on a </span>
- <span className="t-bold">high performance </span>
- <span>rendering engine and designed for </span>
- <span className="t-bold">large-scale </span>
- <span>data sets.</span>
- </div>
- {isPalm && (
- <StyledImgContainer
- style={{
- width: `${imgW}px`,
- height: `${imgW * imgRatio}px`
- }}
+ <div>
+ <Hero />
+ {SECTIONS.map(
+ ({id, title, description, icon, isDark, background}, i) => {
+ const SectionContent = SECTION_CONTENT[id];
+ return (
+ <Section
+ key={`section-${i}`}
+ title={title}
+ description={description}
+ icon={icon}
+ isDark={isDark}
+ background={background}
>
- {IMAGES_S.map(src => (
- <img
- key={src}
- style={{
- width: '100%',
- height: '100%',
- display: 'block',
- position: 'absolute',
- top: 0
- }}
- src={`${CLOUDFRONT}${KEPLER_GL_BUCKET}${src}`}
- />
- ))}
- </StyledImgContainer>
- )}
- <div className="kg-home__caption__bottom">
- <div className="kg-home__caption__bottom__title">
- Coming soon in April 2018
- </div>
- <Button large>
- <a
- target="_blank"
- rel="noopener noreferrer"
- href="http://t.uber.com/join-kepler.gl"
- >
- Keep Me Updated
- </a>
- </Button>
- </div>
- </StyledCaption>
- {!isPalm && (
- <StyledImgContainer
- style={{
- width: `${imgW}px`,
- height: `${imgW * imgRatio}px`,
- minWidth: `${imgMinW}px`,
- minHeight: `${imgMinW * imgRatio}px`
- }}
- >
- {IMAGES.map(src => (
- <img
- key={src}
- style={{
- width: '100%',
- height: '100%',
- position: 'absolute',
- top: 0
- }}
- src={`${CLOUDFRONT}${KEPLER_GL_BUCKET}${src}`}
- />
- ))}
- </StyledImgContainer>
- )}
- </StyledHomeContent>
- </StyledHome>
- </Container>
+ <SectionContent />
+ </Section>
+ );
+ }
+ )}
+ <Footer />
+ </div>
</ThemeProvider>
-
);
}
}
-
-export default Home;
diff --git a/website/src/components/showcase.js b/website/src/components/showcase.js
new file mode 100644
index 000000000..39e78ec53
--- /dev/null
+++ b/website/src/components/showcase.js
@@ -0,0 +1,130 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+import styled from 'styled-components';
+
+import {SHOWCASE_ITEMS} from '../content';
+import {media} from '../styles';
+import Carousel from './common/carousel';
+
+const CarouselContainer = styled.div`
+ height: 360px;
+ ${media.palm`
+ height: 240px;
+ `} ${media.desk`
+ height: 480px;
+ `};
+`;
+
+const Image = styled.img`
+ width: 100%;
+ height: 100%;
+ box-shadow: 0px 12px 24px rgba(0, 0, 0, 0.25);
+ object-fit: cover;
+
+ width: 420px;
+ height: 320px;
+
+ ${media.palm`
+ width: 300px;
+ height: 200px;
+ `} ${media.desk`
+ width: 560px;
+ height: 420px;
+ `};
+`;
+
+const NavContainer = styled.div`
+ display: flex;
+ justify-content: center;
+ margin-top: 24px;
+`;
+
+const NavItem = styled.div`
+ margin: ${props => props.theme.margins.tiny};
+ font-size: 10px;
+ text-align: center;
+ filter: ${props => props.isActive && 'brightness(300%)'};
+ transform: ${props => props.isActive && 'scale(1.1)'};
+ transition: transform 500ms, filter 500ms;
+ cursor: pointer;
+ :hover {
+ transform: scale(1.1);
+ }
+
+ ${media.palm`
+ margin: 2px 4px;
+ font-size: 8px;
+ `};
+`;
+
+const NavIcon = styled.img`
+ display: block;
+
+ width: 48px;
+ height: 48px;
+
+ ${media.palm`
+ width: 32px;
+ height: 32px;
+ `};
+`;
+
+const Nav = ({items, selectedIndex, onClick}) => (
+ <NavContainer>
+ {items.map(({text, icon}, i) => (
+ <NavItem isActive={selectedIndex === i} onClick={() => onClick(i)}>
+ <NavIcon src={icon} />
+ {text}
+ </NavItem>
+ ))}
+ </NavContainer>
+);
+
+class Showcase extends PureComponent {
+ state = {
+ selectedIndex: 3
+ };
+
+ render() {
+ return (
+ <div>
+ <CarouselContainer>
+ <Carousel
+ selectedIndex={this.state.selectedIndex}
+ onChange={i => this.setState({selectedIndex: i})}
+ >
+ {SHOWCASE_ITEMS.map(({image}, i) => (
+ <Image key={`showcase-image-${i}`} src={image} />
+ ))}
+ </Carousel>
+ </CarouselContainer>
+ <Nav
+ items={SHOWCASE_ITEMS}
+ selectedIndex={this.state.selectedIndex}
+ onClick={i => this.setState({selectedIndex: i})}
+ />
+ </div>
+ );
+ }
+}
+
+export default Showcase;
diff --git a/website/src/components/tutorials.js b/website/src/components/tutorials.js
new file mode 100644
index 000000000..1b9f6a837
--- /dev/null
+++ b/website/src/components/tutorials.js
@@ -0,0 +1,96 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+import styled from 'styled-components';
+
+import {media} from '../styles';
+import {TUTORIALS} from '../content';
+import {HorizontalCard} from './common/card';
+import StaggeredScrollAnimation from './common/staggered-scroll-animation';
+import {LinkButton, CenteredContent} from './common/styled-components';
+
+const Container = styled.div`
+ margin: 0 auto;
+ max-width: 1500px;
+`;
+
+const CardsContainer = styled.div`
+ display: grid;
+ grid-gap: ${props => props.theme.margins.medium};
+ grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
+ grid-auto-flow: dense;
+ margin-bottom: ${props => props.theme.margins.large};
+ ${media.palm`
+ display: block;
+ `};
+`;
+
+const StyledCardContainer = styled.a`
+ display: block;
+ color: black;
+ cursor: pointer;
+ transition: transform 350ms;
+ :hover {
+ transform: scale3d(1.05, 1.05, 1.05);
+ }
+ ${media.palm`
+ margin-bottom: ${props => props.theme.margins.small};
+ `};
+`;
+
+const CardContainer = ({linkUrl, children}) => (
+ <StyledCardContainer href={linkUrl} target="_blank">
+ {children}
+ </StyledCardContainer>
+);
+
+class Tutorials extends PureComponent {
+ render() {
+ return (
+ <Container>
+ <StaggeredScrollAnimation Container={CardsContainer}>
+ {TUTORIALS.map(({title, description, image, url}, i) => (
+ <CardContainer linkUrl={url} key={`tutorial-${i}`}>
+ <HorizontalCard
+ title={title}
+ description={description}
+ image={image}
+ linkText="Read Now"
+ />
+ </CardContainer>
+ ))}
+ </StaggeredScrollAnimation>
+ <CenteredContent>
+ <LinkButton
+ outline
+ large
+ target="_blank"
+ href="https://medium.com/@vis.gl"
+ >
+ Read More
+ </LinkButton>
+ </CenteredContent>
+ </Container>
+ );
+ }
+}
+
+export default Tutorials;
diff --git a/website/src/components/walkthrough.js b/website/src/components/walkthrough.js
new file mode 100644
index 000000000..54b1598e3
--- /dev/null
+++ b/website/src/components/walkthrough.js
@@ -0,0 +1,76 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import React, {PureComponent} from 'react';
+import styled from 'styled-components';
+
+import {WALKTHROUGH_ITEMS} from '../content';
+import {media} from '../styles';
+import YoutubeVideo from './common/youtube-video';
+import Swipeable from './common/swipeable';
+
+const ItemWrapper = styled.div`
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+
+ ${media.palm`
+ width: 100%;
+ font-size: 12px;
+ `};
+`;
+
+const VideoContainer = styled.div`
+ width: 640px;
+ height: 420px;
+
+ ${media.portable`
+ width: 500px;
+ height: 330px;
+ `} ${media.palm`
+ width: 100%;
+ height: 250px;
+ `};
+`;
+
+const ItemDescription = styled.div`
+ margin-top: 16px;
+`;
+
+class Walkthrough extends PureComponent {
+ render() {
+ return (
+ <div>
+ <Swipeable>
+ {WALKTHROUGH_ITEMS.map(({videoUrl, description}) => (
+ <ItemWrapper>
+ <VideoContainer>
+ <YoutubeVideo src={videoUrl} width="100%" height />
+ </VideoContainer>
+ <ItemDescription>{description}</ItemDescription>
+ </ItemWrapper>
+ ))}
+ </Swipeable>
+ </div>
+ );
+ }
+}
+
+export default Walkthrough;
diff --git a/website/src/constants.js b/website/src/constants.js
new file mode 100644
index 000000000..25c35f16d
--- /dev/null
+++ b/website/src/constants.js
@@ -0,0 +1,27 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+export const CLOUDFRONT = 'https://d1a3f4spazzrp4.cloudfront.net';
+export const KEPLER_GL_BUCKET = 'kepler.gl';
+export const WEBSITE_ASSET_FOLDER = 'website';
+
+export const VIDEO_TYPES = {
+ YOUTUBE: 'YOUTUBE'
+};
diff --git a/website/src/content.js b/website/src/content.js
new file mode 100644
index 000000000..024e76a9e
--- /dev/null
+++ b/website/src/content.js
@@ -0,0 +1,219 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import {cdnUrl} from './utils';
+import {VIDEO_TYPES} from './constants';
+
+export const SECTIONS = [
+ {
+ id: 'showcase',
+ title: 'Map Enthusiast?',
+ description: 'Make beautiful data-driven maps.',
+ icon: cdnUrl('icons/showcase.png')
+ },
+ {
+ id: 'walkthrough',
+ title: 'Data Scientist?',
+ description:
+ 'Gain insights from location data and deliver business outcomes.',
+ icon: cdnUrl('icons/walkthrough.png'),
+ isDark: true
+ },
+ {
+ id: 'features',
+ title: 'Developer?',
+ description:
+ 'A customizable geospatial toolbox to help make data-driven decisions.',
+ icon: cdnUrl('icons/features.png')
+ },
+ {
+ id: 'examples',
+ title: 'See What People Created',
+ description: 'See what others have been creating with Kepler.gl.',
+ icon: cdnUrl('icons/examples.png'),
+ background: cdnUrl('examples/section-background.png')
+ },
+ {
+ id: 'tutorials',
+ title: 'Getting Started',
+ description: 'Get started with tutorials created by our team.',
+ icon: cdnUrl('icons/tutorials.png')
+ }
+];
+
+export const HERO_IMAGES = [
+ cdnUrl('hero/kepler.gl-hexagon.png'),
+ cdnUrl('hero/kepler.gl-points.png'),
+ cdnUrl('hero/kepler.gl-contours.png')
+];
+
+export const HERO_IMAGES_SCALED = [
+ cdnUrl('hero/kepler.gl-hexagon_s.png'),
+ cdnUrl('hero/kepler.gl-points_s.png'),
+ cdnUrl('hero/kepler.gl-contours_s.png')
+];
+
+export const SHOWCASE_ITEMS = [
+ {
+ text: 'Arc',
+ image: cdnUrl('showcase/arcs-s.png'),
+ icon: cdnUrl('showcase/icons/arc.png')
+ },
+ {
+ text: 'Line',
+ image: cdnUrl('showcase/lines-s.png'),
+ icon: cdnUrl('showcase/icons/line.png')
+ },
+ {
+ text: 'Hexagon',
+ image: cdnUrl('showcase/hexagons-s.png'),
+ icon: cdnUrl('showcase/icons/hexagon.png')
+ },
+ {
+ text: 'Point',
+ image: cdnUrl('showcase/points-s.png'),
+ icon: cdnUrl('showcase/icons/point.png')
+ },
+ // {
+ // text: 'H3',
+ // image: cdnUrl('showcase/h3.png'),
+ // icon: cdnUrl('showcase/icons/h3.png')
+ // },
+ {
+ text: 'Heatmap',
+ image: cdnUrl('showcase/heatmap-s.png'),
+ icon: cdnUrl('showcase/icons/heatmap.png')
+ },
+ {
+ text: 'GeoJSON',
+ image: cdnUrl('showcase/geojson-s.png'),
+ icon: cdnUrl('showcase/icons/geojson.png')
+ },
+ {
+ text: 'Buildings',
+ image: cdnUrl('showcase/buildings-s.png'),
+ icon: cdnUrl('showcase/icons/heatmap.png')
+ }
+];
+
+export const WALKTHROUGH_ITEMS = [
+ {
+ videoUrl: 'https://www.youtube.com/embed/nLy3OQYsXWA',
+ videoType: VIDEO_TYPES.YOUTUBE,
+ description:
+ 'Easily import various formats of data by simplily drag and drop'
+ },
+ {
+ videoUrl: 'https://www.youtube.com/embed/pjzCMQBqjFw',
+ videoType: VIDEO_TYPES.YOUTUBE,
+ description:
+ 'Easily import various formats of data by simplily drag and drop'
+ },
+ {
+ videoUrl: 'https://www.youtube.com/embed/LPQGHJldEvU',
+ videoType: VIDEO_TYPES.YOUTUBE,
+ description:
+ 'Easily import various formats of data by simplily drag and drop'
+ }
+];
+
+export const FEATURES = [
+ {
+ title: 'Performance',
+ description:
+ 'Built with Deck.gl, Kepler.gl utilizes WebGL to render large datasets quickly and efficiently.',
+ image: cdnUrl('showcase/points.png')
+ },
+ {
+ title: 'Interaction',
+ description:
+ 'You can easily drag and drop a dataset, add filters, apply scales, and do aggregation on the fly.',
+ image: cdnUrl('showcase/points.png')
+ },
+ {
+ title: 'Embeddable',
+ description:
+ 'Built on React & Redux, Kepler.gl can be embedded inside your own mapping applications.',
+ image: cdnUrl('showcase/points.png')
+ }
+];
+
+export const EXAMPLES = [
+ {
+ title: 'California Earthquakes',
+ description: 'Some description is needed here. This is just a placeholder',
+ image: cdnUrl('examples/cali-earthquakes.png'),
+ url: '#/demo/earthquakes'
+ },
+ {
+ title: 'New York City Cab Rides',
+ description: 'Some description is needed here. This is just a placeholder',
+ image: cdnUrl('examples/ny-taxis.png'),
+ url: '#/demo/nyctrips'
+ },
+ {
+ title: 'San Francisco Elevation Contour',
+ description: 'Some description is needed here. This is just a placeholder',
+ image: cdnUrl('examples/sf-elevation.png'),
+ url: '#/demo/sfcontour'
+ },
+ {
+ title: 'New york city population',
+ description: 'Some description is needed here. This is just a placeholder',
+ image: cdnUrl('examples/ny-population.png'),
+ url: '#/demo/nyc_census'
+ },
+ {
+ title: 'San Francisco Street Tree Map',
+ description: 'Some description is needed here. This is just a placeholder',
+ image: cdnUrl('examples/sf-street-trees.png'),
+ url: '#/demo/sftrees'
+ },
+ {
+ title: 'Commute Patterns in the UK',
+ description: 'Some description is needed here. This is just a placeholder',
+ image: cdnUrl('examples/uk-commute.png'),
+ url: '#/demo/ukcommute'
+ }
+];
+
+export const TUTORIALS = [
+ {
+ title: 'How to create a map in 3 minutes',
+ description: 'Some description is needed here. This is just a placeholder',
+ image: cdnUrl('examples/earthquake.png'),
+ url: '<placeholder>'
+ },
+ {
+ title: '5 tips for creating an elegant map',
+ description: 'Some description is needed here. This is just a placeholder',
+ image: cdnUrl('examples/earthquake.png')
+ },
+ {
+ title: 'Bay Area forest mapping',
+ description: 'Some description is needed here. This is just a placeholder',
+ image: cdnUrl('examples/earthquake.png')
+ }
+ // {
+ // title: 'How to create a map in 3 minutes',
+ // description: 'Some description is needed here. This is just a placeholder',
+ // image: cdnUrl('examples/earthquake.png')
+ // }
+];
diff --git a/website/src/static/index.html b/website/src/static/index.html
index 0f4a9c9d8..2230dbc7d 100644
--- a/website/src/static/index.html
+++ b/website/src/static/index.html
@@ -40,7 +40,7 @@
</script>
<style>
- body {margin: 0; padding: 0; overflow: hidden;}
+ body {margin: 0; padding: 0; overflow-x: hidden;}
</style>
</head>
<body>
diff --git a/website/src/styles.js b/website/src/styles.js
index 20cf91adc..d9b71e50f 100644
--- a/website/src/styles.js
+++ b/website/src/styles.js
@@ -28,19 +28,19 @@ export const breakPoints = {
export const media = {
palm: (...args) => css`
@media (max-width: ${breakPoints.palm}px) {
- ${css(...args)}
+ ${css(...args)};
}
`,
- portable: (...args) => css`
+ portable: (...args) => css`
@media (max-width: ${breakPoints.desk}px) {
- ${css(...args)}
+ ${css(...args)};
}
`,
desk: (...args) => css`
@media (min-width: ${breakPoints.desk + 1}px) {
- ${css(...args)}
+ ${css(...args)};
}
`
};
@@ -54,17 +54,25 @@ export const theme = {
mapBlocker: '#0B151F',
footerColor: '#C0C0C0',
// button:
- primaryBtnBgd: '#0F9668',
+ primaryBtnBgd: '#005CD2',
primaryBtnActBgd: '#13B17B',
primaryBtnColor: '#FFFFFF',
primaryBtnActColor: '#FFFFFF',
- primaryBtnBgdHover: '#13B17B',
+ primaryBtnBgdHover: '#1f7cf4',
primaryBtnRadius: '2px',
secondaryBtnBgd: '#6A7485',
secondaryBtnActBgd: '#A0A7B4',
secondaryBtnColor: '#FFFFFF',
secondaryBtnActColor: '#FFFFFF',
secondaryBtnBgdHover: '#A0A7B4',
+ outlineBtnBgd: 'transparent',
+ outlineBtnBgdHover: 'rgba(0, 0, 0, 0.05)',
+ outlineBtnActColor: '#000000',
+ outlineBtnColor: '#000000',
+ outlineDarkBtnBgd: 'transparent',
+ outlineDarkBtnBgdHover: 'rgba(255, 255, 255, 0.05)',
+ outlineDarkBtnActColor: '#ffffff',
+ outlineDarkBtnColor: '#ffffff',
linkBtnBgd: 'transparent',
linkBtnActBgd: 'transparent',
linkBtnColor: '#A0A7B4',
@@ -74,5 +82,15 @@ export const theme = {
negativeBtnActBgd: '#FF193E',
negativeBtnBgdHover: '#FF193E',
negativeBtnColor: '#FFFFFF',
- negativeBtnActColor: '#FFFFFF'
+ negativeBtnActColor: '#FFFFFF',
+ btnTransition: '350ms color, 350ms background',
+ linkColor: '#A0A7B4',
+ darkBackgroundColor: '#242730',
+ margins: {
+ tiny: '0.5rem',
+ small: '1.0rem',
+ medium: '1.5rem',
+ large: '2.0rem',
+ huge: '2.5rem'
+ }
};
diff --git a/website/src/utils.js b/website/src/utils.js
new file mode 100644
index 000000000..1498dd0b2
--- /dev/null
+++ b/website/src/utils.js
@@ -0,0 +1,25 @@
+// Copyright (c) 2018 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+import {CLOUDFRONT, KEPLER_GL_BUCKET, WEBSITE_ASSET_FOLDER} from './constants';
+
+export function cdnUrl(path) {
+ return `${CLOUDFRONT}/${KEPLER_GL_BUCKET}/${WEBSITE_ASSET_FOLDER}/${path}`;
+}
diff --git a/website/webpack.config.js b/website/webpack.config.js
index 3f7c65af6..41852ab38 100644
--- a/website/webpack.config.js
+++ b/website/webpack.config.js
@@ -30,24 +30,25 @@ const BABEL_CONFIG = {
// so that we can set modules: false, to avoid tree shaking
// https://github.com/webpack/webpack/issues/3974
babelrc: false,
- presets: [
- ['es2015', {modules: false, loose: true}],
- 'react',
- 'stage-0',
- ].map(name => Array.isArray(name) ?
- [require.resolve(`babel-preset-${name[0]}`), name[1]] :
- require.resolve(`babel-preset-${name}`)),
+ presets: [['es2015', {modules: false, loose: true}], 'react', 'stage-0'].map(
+ name =>
+ Array.isArray(name)
+ ? [require.resolve(`babel-preset-${name[0]}`), name[1]]
+ : require.resolve(`babel-preset-${name}`)
+ ),
plugins: [
'transform-decorators-legacy',
'transform-runtime',
['module-resolver', {root: [libSources]}]
- ].map(name => Array.isArray(name) ?
- [require.resolve(`babel-plugin-${name[0]}`), name[1]] :
- require.resolve(`babel-plugin-${name}`))
+ ].map(
+ name =>
+ Array.isArray(name)
+ ? [require.resolve(`babel-plugin-${name[0]}`), name[1]]
+ : require.resolve(`babel-plugin-${name}`)
+ )
};
const COMMON_CONFIG = {
-
entry: ['./src/main'],
resolve: {
@@ -70,10 +71,12 @@ const COMMON_CONFIG = {
options: BABEL_CONFIG,
include: [resolve('..'), libSources],
exclude: [/node_modules/]
- }, {
+ },
+ {
test: /\.(eot|svg|ico|ttf|woff|woff2|gif|jpe?g|png)$/,
loader: 'url-loader'
- }, {
+ },
+ {
test: /\.(svg|ico|gif|jpe?g|png)$/,
loader: 'file-loader?name=[name].[ext]'
}
@@ -88,37 +91,28 @@ const COMMON_CONFIG = {
plugins: [
new webpack.EnvironmentPlugin(['MapboxAccessToken'])
]
-
};
const addDevConfig = config => {
-
config.module.rules.push({
// Unfortunately, webpack doesn't import library sourcemaps on its own...
test: /\.js$/,
use: ['source-map-loader'],
enforce: 'pre',
- exclude: [
- /node_modules\/react-palm/,
- /node_modules\/react-data-grid/,
- ]
+ exclude: [/node_modules\/react-palm/, /node_modules\/react-data-grid/]
});
return Object.assign(config, {
-
devtool: 'source-maps',
plugins: config.plugins.concat([
// new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin()
])
-
});
-
};
const addProdConfig = config => {
-
return Object.assign(config, {
output: {
path: resolve(__dirname, './dist'),