Skip to content

Commit 8714816

Browse files
authored
Merge pull request #300 from UW-Macrostrat/style-improvements
Style improvements
2 parents 0f98995 + 2718718 commit 8714816

File tree

19 files changed

+223
-205
lines changed

19 files changed

+223
-205
lines changed

pages/+Layout.ts

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,27 @@
1-
import { DarkModeProvider, DevToolsConsole } from "@macrostrat/ui-components";
1+
import { DarkModeProvider } from "@macrostrat/ui-components";
22
import { ReactNode } from "react";
33

44
import { AuthProvider } from "~/_providers/auth";
55
import { usePageContext } from "vike-react/usePageContext";
6+
import { pageLayouts } from "~/layouts";
67

78
import "@blueprintjs/core/lib/css/blueprint.css";
89
import "~/styles/core.sass";
910
import "~/styles/padding.css";
1011
//
1112
import h from "@macrostrat/hyper";
1213

13-
import { ClientOnly } from "vike-react/ClientOnly";
14-
1514
export default function Layout({ children }: { children: ReactNode }) {
1615
const pageContext = usePageContext();
1716
const { exports = {}, config, user } = pageContext;
1817
const pageStyle = exports?.pageStyle ?? "fullscreen";
1918
// const devTools = exports.devTools ?? [];
2019

20+
const layout = pageLayouts[pageStyle] ?? `div.${pageStyle}-page`;
21+
2122
return h(
2223
AuthProvider,
2324
{ user }, // Prefer detailed user if available
24-
h(
25-
DarkModeProvider,
26-
{ followSystem: true },
27-
h("div.app-shell", { className: pageStyle + "-page" }, [
28-
children,
29-
// h(DevToolsConsole, {
30-
// className: "page-admin-container",
31-
// tools: [...devTools, DevToolsData],
32-
// }),
33-
])
34-
)
25+
h(DarkModeProvider, { followSystem: true }, h(layout, children))
3526
);
3627
}
37-
38-
function DevToolsData() {
39-
return h(
40-
ClientOnly,
41-
{
42-
load() {
43-
return import("~/components/developer").then((mod) => mod.DevToolsData);
44-
},
45-
},
46-
(DevToolsData) => h(DevToolsData)
47-
);
48-
}
49-
50-
DevToolsData.title = "Vike page context";
51-
52-
function NoOpDarkModeProvider(props) {
53-
return props.children;
54-
}

pages/+Page.module.sass

Lines changed: 30 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,52 @@
11
.nohighlight
22
color: white
33

4-
.start
5-
width: 100%
4+
.site-header.hero
5+
margin-top: -3em
6+
padding-top: 5em
7+
padding-bottom: 5em
8+
height: 500px
9+
10+
.hero
11+
height: 300px
12+
border-radius: 1em
13+
position: relative
614
display: flex
715
justify-content: center
816
align-items: center
9-
height: 50vh
1017
color: white
11-
position: relative
12-
margin-bottom: calc(1em + 1px)
13-
border-bottom: 2px solid var(--text-emphasized-color)
1418

19+
--macrostrat-logo-size: 100px
1520

16-
li
17-
float: left
18-
list-style-type: none
19-
width: 33%
21+
text-shadow: var(--dark-background) 0px 2px 8px
2022

21-
ul
22-
display: inline-block
23-
width: 100%
2423

25-
.banner
26-
z-index: 30
24+
.hero-backdrop
25+
position: absolute
26+
top: 0
27+
left: 50%
28+
bottom: 0
29+
margin-left: -50vw
30+
width: 100vw
31+
height: 100%
32+
z-index: -1
33+
object-fit: cover
34+
overflow: hidden
2735

28-
h1, h2
29-
text-shadow: var(--dark-background) 1px 0 10px
36+
.hero-content
37+
text-align: center
3038

31-
.header
32-
text-shadow: black 1px 0 10px
33-
text-align: center
34-
display: flex
35-
justify-content: center
36-
gap: 10px
3739

38-
.main-title
39-
font-size: 60px
40-
padding: 0
40+
.cover-image
41+
object-fit: cover
42+
width: 100vw
43+
overflow: hidden
4144

42-
.version
43-
font-size: 40px
44-
padding: 0
45-
margin: 0
4645

4746
.subtitle
4847
text-align: center
4948
font-weight: 500
5049

51-
.cover-image
52-
position: absolute
53-
left: 0px
54-
top: 0px
55-
height: 50vh
56-
width: 100%
57-
object-fit: cover
58-
border-bottom: 2px solid var(--text-emphasized-color)
59-
6050

6151
.sea-image
6252
position: absolute
@@ -69,11 +59,6 @@
6959
display: inline-flex
7060
width: 100%
7161

72-
.main-title
73-
font-size: 72px
74-
font-weight: 400
75-
font-family: "Maven Pro", sans-serif
76-
text-align: center
7762

7863
.top-stat, .top-stat-label
7964
display: grid
@@ -104,13 +89,8 @@
10489
color: white
10590

10691
.buttons
107-
font-size: 20px
108-
padding: 0px
10992
display: flex
11093
flex-direction: column
111-
width: 100%
112-
padding: 0 20%
113-
border-bottom: 2px solid var(--text-emphasized-color)
11494

11595
.country_container
11696
height: 100vh
@@ -136,12 +116,6 @@
136116
margin: 0
137117
padding: 0
138118

139-
.geologic-maps
140-
height: 100vh
141-
background-color: white
142-
color: black
143-
margin: 0
144-
145119
.map-info
146120
padding: 0 10vh
147121
margin: 0
@@ -417,4 +391,4 @@
417391
.rock-info
418392
display: flex
419393
align-items: center
420-
gap: .5em
394+
gap: .5em

pages/+Page.ts

Lines changed: 54 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,75 @@
1-
import { Image, Navbar, Footer } from "~/components/general";
1+
import { Image, Navbar, Footer, SiteTitle } from "~/components/general";
22
import h from "./+Page.module.sass";
33
import { LinkCard } from "~/components/cards";
44
import { useData } from "vike-react/useData";
55
import { isDev } from "@macrostrat-web/settings";
66

77
export function Page() {
88
return h("div.page-main", [
9-
h("div.start", [
10-
h(Image, { className: "back-img cover-image", src: "cover_large.jpg" }),
11-
h("div.banner", [
12-
h("div.header", h("h1.main-title", "Macrostrat")),
9+
h("div.hero.site-header", [
10+
h("div.hero-backdrop", [
11+
h(Image, { className: "cover-image", src: "cover_large.jpg" }),
12+
]),
13+
h("div.hero-content", [
14+
h(SiteTitle),
1315
h(
1416
"h2.subtitle",
1517
"A platform for geological data exploration, integration, and analysis"
1618
),
1719
h(MacrostratStats),
1820
]),
1921
]),
20-
h(Navbar, { className: "main-navbar" }),
22+
h(Navbar, { className: "site-header" }),
2123
h("div.buttons", [
22-
h(LinkCard, { title: "Geologic Map", href: "/map/#3/40.78/-94.13" }, [
23-
h("p", { className: "long" }, [
24-
h("div.temp", {}, [
25-
"With over 225 maps from data providers around the world across every scale, Macrostrat is the world's largest homogenized geologic map database. Our data processing pipeline links geologic map polygons to Macrostrat column polygons, external stratigraphic name lexicons, and geochronological intervals, enabling the enhancement of the original map data and allowing for direct links into ",
26-
h("a", { href: "https://xdd.wisc.edu", target: "_blank" }, "xDD"),
27-
" (formly GeoDeepDive).",
28-
]),
29-
h("div.temp", {}, [
30-
"Are you affiliated with a state or national geologic survey? ",
31-
h(
32-
"a",
33-
{
34-
href: "mailto:[email protected]?Subject=Geologic%20Map%20Collaboration",
35-
},
36-
"Get in touch"
37-
),
38-
" with us - we'd love to collaborate and help publicize your maps!",
39-
]),
40-
h("div.temp", {}, [
41-
"Get started by ",
42-
h("a", { href: "/map" }, "exploring the map"),
43-
" or ",
44-
h("a", { href: "/map/sources" }, "taking a look at"),
45-
" which maps are currently a part of Macrostrat.",
46-
]),
47-
]),
24+
h("h2", "Geologic maps"),
25+
h(LinkCard, { title: "Map interface", href: "/map/#3/40.78/-94.13" }, [
26+
"An integrated geological map of the world",
4827
]),
49-
h(LinkCard, { title: "Maps", href: "/maps" }, [
50-
h("p", "The spatial footprint of rocks on the Earth's surface"),
28+
h(
29+
LinkCard,
30+
{ title: "Map index", href: "/maps" },
31+
"Maps from different data providers that have been integrated into Macrostrat"
32+
),
33+
h("div.details", [
34+
h("p", {}, [
35+
"With over 225 maps from data providers around the world at every scale, Macrostrat is the world's largest homogenized geologic map database. ",
36+
"Our data processing pipeline links geologic map polygons to stratigraphic columns, external stratigraphic name lexicons, and geochronological intervals. ",
37+
"This enhancement of map data allows for direct links to the literature via ",
38+
h("a", { href: "https://xdd.wisc.edu", target: "_blank" }, "xDD"),
39+
" (formly GeoDeepDive).",
40+
]),
41+
h("p", [
42+
"Are you affiliated with a state or national geologic survey? ",
43+
h(
44+
"a",
45+
{
46+
href: "mailto:[email protected]?Subject=Geologic%20Map%20Collaboration",
47+
},
48+
"Get in touch"
49+
),
50+
" with us - we'd love to collaborate and help publicize your maps!",
51+
]),
52+
h("p", {}, [
53+
"Get started by ",
54+
h("a", { href: "/map" }, "exploring the map"),
55+
" or ",
56+
h("a", { href: "/map/sources" }, "taking a look at"),
57+
" which maps are currently a part of Macrostrat.",
58+
]),
5159
]),
60+
h("h2", "Stratigraphic columns"),
5261
h(LinkCard, { title: "Columns", href: "/columns" }, [
53-
h(
54-
"p",
55-
"Stratigraphic and geological columns showing the organization of rocks in time"
56-
),
62+
"Regional and local descriptions of the evolution of the Earth's crust through time",
5763
]),
64+
h(
65+
"p",
66+
"Macrostrat's stratigraphic columns account for the organization of rocks in the crust and their evolution over Earth history."
67+
),
68+
h(
69+
"p",
70+
"Macrostrat stores both regional columns that represent a unified chronostratigraphic framework and measured sections and drill core logs that provide detailed information about specific locations."
71+
),
72+
5873
h(LinkCard, { title: "Geologic Lexicon", href: "/lex" }, [
5974
h("p", "Geologic units and data dictionaries"),
6075
]),
@@ -69,7 +84,7 @@ export function Page() {
6984
width: "22px",
7085
height: "22px",
7186
}),
72-
h("span", " Go Mobile!"),
87+
" Go mobile!",
7388
]),
7489
]),
7590
h(

pages/map/map-interface/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import h from "@macrostrat/hyper";
33
import { Route, Routes } from "react-router-dom";
44
import { useEffect } from "react";
55

6-
import "~/styles/global.styl";
76
import "./searchbar.styl";
87

98
import { createRouterMiddleware } from "@lagunovsky/redux-react-router";

pages/map/sources/+Page.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import App from "./components/app";
55
import h from "@macrostrat/hyper";
66

77
// We should probably make this a little less global
8-
import "~/styles/global.styl";
98
// import "./searchbar.styl";
109
// import "./ui-components.styl";
1110

pages/maps/@id/+Page.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import {
3434
import boundingBox from "@turf/bbox";
3535
import { LngLatBoundsLike } from "mapbox-gl";
3636
import { useEffect, useMemo, useState } from "react";
37-
import "~/styles/global.styl";
3837
import h from "./main.module.sass";
3938
import { PageBreadcrumbs, MapReference, DevLink } from "~/components";
4039
import { MapNavbar } from "~/components/map-navbar";

pages/maps/ingestion/@id/components/map-interface.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import boundingBox from "@turf/bbox";
2020
import { LngLatBoundsLike } from "mapbox-gl";
2121
import { useCallback, useEffect, useMemo, useState } from "react";
2222
import { MapNavbar } from "~/components/map-navbar";
23-
import "~/styles/global.styl";
2423
import styles from "./main.module.sass";
2524
import { asChromaColor, toRGBAString } from "@macrostrat/color-utils";
2625
import { boundingGeometryMapStyle } from "~/map-styles";

public/android-chrome-192x192.png

-31.7 KB
Loading

public/android-chrome-512x512.png

-200 KB
Loading

public/apple-touch-icon.png

-27.9 KB
Loading

0 commit comments

Comments
 (0)