Skip to content

Commit

Permalink
New Landing Page
Browse files Browse the repository at this point in the history
  • Loading branch information
ka7eh committed Dec 14, 2022
1 parent fdd359b commit 5e6d9d4
Show file tree
Hide file tree
Showing 25 changed files with 768 additions and 105 deletions.
Binary file added src/components/Home/button_analysis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Home/button_api.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Home/button_explore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Home/home_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
823 changes: 732 additions & 91 deletions src/components/Home/index.tsx

Large diffs are not rendered by default.

Binary file added src/components/Home/logo_bw_carnegie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Home/logo_bw_nhm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Home/logo_bw_plymouth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Home/logo_bw_sams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Home/logo_bw_uiuc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Home/logo_color_carnegie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Home/logo_color_nhm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Home/logo_color_plymouth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Home/logo_color_sams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Home/logo_color_uiuc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions src/components/Layouts/SinglePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import Stack from '@mui/material/Stack';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';

import { getRandomBackground } from './backgrounds';
import UnitPreferencesDialog from '../UnitPreferencesDialog';
import { getRandomBackground } from './backgrounds';
import './singlePage.scss';

export const headerHeight = 60;

Expand Down Expand Up @@ -92,7 +93,7 @@ const Layout: React.FC<Props> = ({ children }: Props) => {
variant="outlined"
startIcon={<Icon baseClassName="icons">data_exploration</Icon>}
size="small"
href={`${API_PATH}/docs`}
href={`${window.API_PATH}/docs`}
target="_blank"
>
API
Expand Down Expand Up @@ -138,7 +139,7 @@ const Layout: React.FC<Props> = ({ children }: Props) => {
</IconButton>
<p>Analysis</p>
</MenuItem>
<MenuItem dense component="a" href={`${API_PATH}/docs`} target="_blank">
<MenuItem dense component="a" href={`${window.API_PATH}/docs`} target="_blank">
<IconButton size="small">
<Icon baseClassName="icons">data_exploration</Icon>
</IconButton>
Expand Down
3 changes: 3 additions & 0 deletions src/components/Layouts/singlePage.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
html, body, #root {
height: 100%;
}
2 changes: 1 addition & 1 deletion src/components/Map/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const layerStyles: { [group: string]: { [state: string]: Partial<maplibre

export const mapStyle: maplibregl.StyleSpecification = {
version: 8,
glyphs: `${API_FONTS}/{fontstack}/{range}.pbf`,
glyphs: `${window.API_FONTS}/{fontstack}/{range}.pbf`,
sources: {},
layers: []
};
3 changes: 3 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Cinzel Decorative">
<link
rel="stylesheet"
href="https://fonts.googleapis.com/icon?family=Material+Icons"
Expand Down
12 changes: 8 additions & 4 deletions src/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { lazy } from 'react';
import React, { Suspense, lazy } from 'react';

import { withLayout } from './components/Layouts/utils';
import layouts from './components/Layouts';
import Loading from './components/Loading';

const LazyHome = lazy(() => import('./components/Home'));

const routes: { [key: string]: import('react-router-dom').RouteProps } = {
'/': {
element: withLayout(
layouts.Scrollable,
lazy(() => import('./components/Home'))
element: (
<Suspense fallback={<Loading />}>
<LazyHome />
</Suspense>
)
},
'/explore': {
Expand Down
4 changes: 2 additions & 2 deletions src/store/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Dayjs } from 'dayjs';

export const getData = <T>(endpoint: string, success: (data: T) => void, err: (error: Error | AxiosError) => void) => {
axios
.get(`${API_PATH}/${endpoint}`)
.get(`${window.API_PATH}/${endpoint}`)
.then(({ data }) => success(data))
.catch((error) => {
console.error();
Expand Down Expand Up @@ -67,7 +67,7 @@ export const searchStations = (
: expressions[0];

axios
.post(`${API_PATH}/stations/search/`, data)
.post(`${window.API_PATH}/stations/search/`, data)
.then((resp) => success(resp.data))
.catch(console.error);
}
Expand Down
10 changes: 6 additions & 4 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
html, body, #root {
height: 100%;
}

.icons {
font-family: 'Material Icons';
font-weight: normal;
Expand All @@ -16,3 +12,9 @@ html, body, #root {
-moz-font-feature-settings: 'liga';
-moz-osx-font-smoothing: grayscale;
}

.center-horizontal {
margin: 0 auto;
left: 0;
right: 0;
}
9 changes: 9 additions & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import { createTheme } from '@mui/material/styles';

export const themeOptions = {
breakpoints: {
values: {
xs: 0,
sm: 600,
md: 900,
lg: 1200,
xl: 1536
}
},
palette: {
primary: {
dark: '#002e2c',
Expand Down

0 comments on commit 5e6d9d4

Please sign in to comment.