-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4175 from owid/explorer-index-page
🎉 Explorers index page
- Loading branch information
Showing
8 changed files
with
154 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.explorer-index-page { | ||
.explorer-index-page__header { | ||
background-color: #f0f4fa; | ||
margin-bottom: 16px; | ||
padding-bottom: 24px; | ||
.h1-semibold { | ||
margin-top: 24px; | ||
margin-bottom: 8px; | ||
@include sm-up { | ||
font-size: 2rem; | ||
} | ||
} | ||
p { | ||
margin: 0; | ||
color: #46688f; | ||
} | ||
} | ||
.explorer-index-page-list { | ||
background-color: #fff; | ||
list-style: none; | ||
row-gap: var(--grid-gap); | ||
.explorer-index-page__card { | ||
display: block; | ||
height: 100%; | ||
padding: 8px; | ||
display: flex; | ||
flex-direction: column; | ||
&:hover { | ||
h2 { | ||
text-decoration: none; | ||
} | ||
img { | ||
box-shadow: 0px 0px 20px 0px rgba(49, 37, 2, 0.07); | ||
} | ||
} | ||
img { | ||
transition: 150ms; | ||
box-shadow: 0px 0px 12px 0px rgba(49, 37, 2, 0.05); | ||
} | ||
h2 { | ||
@include owid-link-90; | ||
@include h3-bold; | ||
font-weight: bold; | ||
margin-top: 8px; | ||
margin-bottom: 8px; | ||
} | ||
p { | ||
color: $blue-90; | ||
margin-top: 0; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React from "react" | ||
import { Head } from "./Head.js" | ||
import { Html } from "./Html.js" | ||
import { EXPLORERS_ROUTE_FOLDER } from "@ourworldindata/explorer" | ||
import { SiteHeader } from "./SiteHeader.js" | ||
import { SiteFooter } from "./SiteFooter.js" | ||
import { MinimalExplorerInfo } from "@ourworldindata/types" | ||
import { EXPLORER_DYNAMIC_THUMBNAIL_URL } from "../settings/clientSettings.js" | ||
|
||
interface ExplorerIndexPageProps { | ||
baseUrl: string | ||
explorers: MinimalExplorerInfo[] | ||
} | ||
|
||
export const ExplorerIndexPage = ({ | ||
baseUrl, | ||
explorers, | ||
}: ExplorerIndexPageProps) => { | ||
return ( | ||
<Html> | ||
<Head | ||
canonicalUrl={`${baseUrl}/${EXPLORERS_ROUTE_FOLDER}`} | ||
pageTitle={`Data Explorers`} | ||
pageDesc={"An index of all Our World in Data data explorers"} | ||
baseUrl={baseUrl} | ||
></Head> | ||
<body> | ||
<SiteHeader baseUrl={baseUrl} /> | ||
<main className="explorer-index-page grid grid-cols-12-full-width"> | ||
<header className="explorer-index-page__header grid grid-cols-12-full-width span-cols-14"> | ||
<h1 className="h1-semibold span-cols-12 col-start-2 collection-title"> | ||
Data Explorers | ||
</h1> | ||
<p className="span-cols-8 col-start-2 span-md-cols-12 col-md-start-2 body-2-regular collection-explanation"> | ||
Our data explorers gather many indicators together | ||
to provide comprehensive overviews of their topics. | ||
</p> | ||
</header> | ||
<ul className="explorer-index-page-list span-cols-12 col-start-2 grid grid-cols-4 grid-md-cols-2 grid-sm-cols-1"> | ||
{explorers.map((explorer) => ( | ||
<li key={explorer.slug}> | ||
<a | ||
className="explorer-index-page__card" | ||
href={`${baseUrl}/${EXPLORERS_ROUTE_FOLDER}/${explorer.slug}`} | ||
> | ||
<img | ||
width="850" | ||
height="600" | ||
loading="lazy" | ||
src={`${EXPLORER_DYNAMIC_THUMBNAIL_URL}/${explorer.slug}.png`} | ||
/> | ||
<h2>{explorer.title}</h2> | ||
<p>{explorer.subtitle}</p> | ||
</a> | ||
</li> | ||
))} | ||
</ul> | ||
</main> | ||
<SiteFooter baseUrl={baseUrl} /> | ||
</body> | ||
</Html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters