Skip to content

Commit 5355aaa

Browse files
authored
Merge pull request #311 from UW-Macrostrat/style-improvements
Style improvements for homepage
2 parents 40432ca + 5fd7740 commit 5355aaa

File tree

10 files changed

+212
-76
lines changed

10 files changed

+212
-76
lines changed

pages/+Page.module.sass

Lines changed: 48 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,41 @@
11
.nohighlight
22
color: white
33

4-
.site-header.hero
5-
margin-top: -3em
6-
padding-top: 5em
7-
padding-bottom: 5em
8-
height: 500px
4+
.site-header
5+
z-index: 1000
6+
position: relative
7+
8+
.main-title
9+
--macrostrat-logo-size: 100px
10+
--macrostrat-wordmark-size: 3.5rem
11+
justify-content: center
12+
13+
.subtitle
14+
font-size: 1.2rem
15+
margin-top: 0.25rem
16+
color: var(--secondary-color)
17+
margin-bottom: 0.5rem
18+
19+
gap: 1rem !important
20+
21+
.site-navbar
22+
:global(.navbar-title)
23+
transition: opacity 0.3s ease-in-out
924

25+
&:global(.transition-enter)
26+
:global(.navbar-title)
27+
opacity: 1
28+
29+
&:global(.transition-leave)
30+
:global(.navbar-title)
31+
opacity: 0
32+
33+
34+
.subtitle
35+
text-align: center
36+
font-weight: 500
37+
38+
//
1039
.hero
1140
height: 300px
1241
border-radius: 1em
@@ -15,8 +44,11 @@
1544
justify-content: center
1645
align-items: center
1746
color: white
47+
padding-top: 5em
48+
padding-bottom: 5em
49+
height: 500px
1850

19-
--macrostrat-logo-size: 100px
51+
font-size: 1.5em
2052

2153
text-shadow: var(--dark-background) 0px 2px 8px
2254

@@ -32,25 +64,22 @@
3264
z-index: -1
3365
object-fit: cover
3466
overflow: hidden
67+
background-position: 50% 50%
68+
background-size: cover
69+
background-image: url("https://storage.macrostrat.org/assets/web/main-page/cover_large.jpg")
3570

3671
.hero-content
3772
text-align: center
3873
display: flex
3974
flex-direction: column
4075
gap: 1em
4176

42-
4377
.cover-image
4478
object-fit: cover
4579
width: 100vw
4680
overflow: hidden
4781

4882

49-
.subtitle
50-
text-align: center
51-
font-weight: 500
52-
53-
5483
.sea-image
5584
position: absolute
5685
z-index: 6
@@ -71,9 +100,13 @@
71100
a
72101
color: white !important
73102

103+
104+
.stats
105+
font-size: 1.5em
106+
74107
.top-stat
75-
font-size: 35px
76-
font-family: Helvetica, sans-serif
108+
font-weight: 600
109+
77110

78111
.stats
79112
display: flex
@@ -123,13 +156,6 @@
123156
padding: 0 10vh
124157
margin: 0
125158

126-
.title
127-
margin: 0
128-
font-size: 72px
129-
font-family: "Maven Pro", sans-serif
130-
padding: 20vh 0
131-
text-align: center
132-
133159
#about
134160
height: 100vh
135161
background-color: white
@@ -394,4 +420,4 @@
394420
.rock-info
395421
display: flex
396422
align-items: center
397-
gap: .5em
423+
gap: .5em

pages/+Page.ts

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
1-
import { Image, Navbar, Footer, SiteTitle, SearchBar } from "~/components/general";
1+
import {
2+
Image,
3+
Navbar,
4+
Footer,
5+
SiteTitle,
6+
SearchBar,
7+
} from "~/components/general";
28
import h from "./+Page.module.sass";
39
import { LinkCard } from "~/components/cards";
410
import { useData } from "vike-react/useData";
511
import { isDev } from "@macrostrat-web/settings";
612

713
export function Page() {
814
return h("div.page-main", [
9-
h("div.hero.site-header", [
10-
h("div.hero-backdrop", [
11-
h(Image, { className: "cover-image", src: "cover_large.jpg" }),
15+
h("header.site-header", [
16+
h(SiteTitle, { className: "main-title" }, [
17+
h("h2.subtitle", "The data system for the crust"),
1218
]),
19+
]),
20+
h(Navbar, { className: "site-navbar" }),
21+
h("div.hero", [
22+
h("div.hero-backdrop"),
1323
h("div.hero-content", [
14-
h(SiteTitle),
15-
h(
16-
"h2.subtitle",
17-
"A platform for geological data exploration, integration, and analysis"
18-
),
24+
h("p.hero-text", [
25+
"Macrostrat integrates geologic maps and stratigraphic columns " +
26+
"into a model of the Earth's crustal framework through time.",
27+
]),
1928
h(MacrostratStats),
2029
]),
2130
]),
22-
h(Navbar, { className: "site-header" }),
2331
h("div.buttons", [
2432
h("h2", "Geologic maps"),
2533
h(LinkCard, { title: "Map interface", href: "/map/#3/40.78/-94.13" }, [
@@ -137,19 +145,19 @@ function MacrostratStats() {
137145
return h("div.stats", {}, [
138146
h("div.stat", {}, [
139147
h("span.top-stat#n_columns", {}, formatNumber(columns)),
140-
h("span.top-stat-label", {}, "Regional Rock Columns"),
148+
h("span.top-stat-label", {}, "columns"),
141149
]),
142150
h("div.stat", {}, [
143151
h("span.top-stat#n_units", {}, formatNumber(units)),
144-
h("span.top-stat-label", {}, "Rock Units"),
152+
h("span.top-stat-label", {}, "rock units"),
145153
]),
146154
h("div.stat", {}, [
147155
h("span.top-stat#n_polys", {}, formatNumber(polygons)),
148-
h("span.top-stat-label", {}, "Geologic Map Polygons"),
156+
h("span.top-stat-label", {}, "map polygons"),
149157
]),
150158
h("div.stat", {}, [
151159
h("span.top-stat#n_names", {}, formatNumber(projects)),
152-
h("span.top-stat-label", {}, "Projects"),
160+
h("span.top-stat-label", {}, "projects"),
153161
]),
154162
]);
155-
}
163+
}

pages/dev/lexicon/+Page.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { PageHeader } from "~/components";
2-
import { PageBreadcrumbs } from "~/components";
31
import "./main.styl";
42
import { Image } from "./index";
53
import { MacrostratIcon } from "~/components";

pages/map/map-interface/components/navbar/index.ts

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ import { PanelSubhead } from "@macrostrat/map-interface";
1313
import classNames from "classnames";
1414
import { navigate } from "vike/client/router";
1515
import { MacrostratIcon } from "~/components/macrostrat-icon";
16-
import { useAdmoinshments } from "#/map/map-interface/components/filter-panel/admonishments";
16+
import { useAdmoinshments } from "../filter-panel/admonishments";
17+
import { MacrostatLogoLink } from "~/components/general";
18+
import { useInDarkMode } from "@macrostrat/ui-components";
1719

1820
const h = hyper.styled(styles);
1921

@@ -146,22 +148,26 @@ function Searchbar({ className }) {
146148
filterPanelElement = h(FilterPanel, { filters, admonishments });
147149
}
148150

149-
return h(FloatingNavbar, { statusElement: filterPanelElement }, [
150-
h(MacrostratIcon, {
151-
size: 36,
152-
onClick() {
153-
navigate("/");
154-
},
155-
}),
156-
h(InputGroup, {
157-
large: true,
158-
onChange: handleSearchInput,
159-
onClick: gainInputFocus,
160-
rightElement: h(MenuButton),
161-
placeholder: "Search Macrostrat...",
162-
value: term,
163-
}),
164-
]);
151+
return h(
152+
FloatingNavbar,
153+
{ statusElement: filterPanelElement, className: "map-navbar" },
154+
[
155+
h("div.navbar-link-container", [
156+
h(MacrostatLogoLink, {
157+
logoStyle: "frameless-simple",
158+
className: "navbar-logo",
159+
}),
160+
]),
161+
h(InputGroup, {
162+
large: true,
163+
onChange: handleSearchInput,
164+
onClick: gainInputFocus,
165+
rightElement: h(MenuButton),
166+
placeholder: "Search Macrostrat...",
167+
value: term,
168+
}),
169+
]
170+
);
165171
}
166172

167173
function SearchGuidance() {

pages/map/map-interface/components/navbar/navbar.module.sass

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,15 @@
4545
content: ''
4646
position: absolute
4747
left: -1em
48+
49+
.map-navbar :global(.bp5-navbar)
50+
overflow: hidden
51+
52+
.navbar-logo
53+
//margin: -8px -15px -8px -15px
54+
//margin-right: -10px
55+
border: 1px solid var(--panel-rule-color)
56+
--macrostrat-logo-size: 50px
57+
58+
.navbar-link-container
59+
margin-left: -10px

src/components/general/index.ts

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import h from "./layout.module.sass";
22
import { MacrostratIcon, StickyHeader } from "~/components";
33
import { Spinner, Icon, Card } from "@blueprintjs/core";
44
import { useDarkMode } from "@macrostrat/ui-components";
5+
import classNames from "classnames";
56

67
export function Image({ src, className, width, height }) {
78
const srcWithAddedPrefix =
@@ -16,24 +17,44 @@ export function NavListItem({ href, children }) {
1617
);
1718
}
1819

19-
export function SiteTitle() {
20-
return h("a.site-title", { href: "/" }, [
20+
export function MacrostatLogoLink({
21+
href = "/",
22+
className,
23+
logoStyle,
24+
children,
25+
}) {
26+
const logoFile =
27+
logoStyle != null
28+
? `macrostrat-icon-${logoStyle}.svg`
29+
: "macrostrat-icon.svg";
30+
return h("a.macrostrat-logo-link", { href, className }, [
2131
h("img.macrostrat-logo", {
22-
src: "https://storage.macrostrat.org/assets/web/macrostrat-icons/macrostrat-icon.svg",
32+
src: `https://storage.macrostrat.org/assets/web/macrostrat-icons/${logoFile}`,
2333
}),
24-
h("h1", "Macrostrat"),
34+
children,
2535
]);
2636
}
2737

38+
export function SiteTitle({ logoStyle, className, children }) {
39+
return h(
40+
MacrostatLogoLink,
41+
{ logoStyle, className: classNames("site-title", className) },
42+
h("div.site-title-content", [h("h1", "Macrostrat"), children])
43+
);
44+
}
45+
2846
export function Navbar({ className, children, showSiteTitle = true }) {
29-
return h(StickyHeader, [
30-
h("nav.navbar", { className }, [
31-
h.if(showSiteTitle)(SiteTitle),
47+
return h(StickyHeader, { className }, [
48+
h("nav.navbar", [
49+
h.if(showSiteTitle)(SiteTitle, {
50+
logoStyle: "simple",
51+
className: "navbar-title",
52+
}),
3253
children,
3354
h("ul.nav-list", [
3455
h(NavListItem, { href: "/about" }, "About"),
35-
h(NavListItem, { href: "/publications" }, "Publications"),
3656
h(NavListItem, { href: "/people" }, "People"),
57+
h(NavListItem, { href: "/publications" }, "Publications"),
3758
h(NavListItem, { href: "/donate" }, "Donate"),
3859
h(NavListItem, { href: "https://rockd.org/" }, "Rockd"),
3960
]),

src/components/general/layout.module.sass

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,15 @@
166166
:root
167167
--macrostrat-logo-size: 30px
168168

169-
a.site-title
169+
a.macrostrat-logo-link
170170
--macrostrat-wordmark-size-internal: var(--macrostrat-wordmark-size, calc(var(--macrostrat-logo-size) * 0.8))
171171
font-size: var(--macrostrat-wordmark-size-internal)
172172
display: flex
173173
flex-direction: row
174174
gap: 0.3em
175175
align-items: center
176-
justify-content: center
177176

178-
color: inherit !important
177+
color: inherit
179178

180179
&:hover
181180
text-decoration: none
@@ -184,9 +183,12 @@ a.site-title
184183
height: var(--macrostrat-logo-size)
185184
aspect-ratio: 1
186185

187-
h1, h2
186+
h1
188187
font-size: 1em
189188
font-weight: 400
190189
font-family: "Maven Pro", sans-serif
191190
margin: 0
192191

192+
*
193+
font-family: "Publico Text", serif
194+
Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
11
.sticky-header
22
position: sticky
3-
top: 0
3+
top: -1em
4+
// Provide some overlap for intersection observer
45
z-index: 100
5-
margin: -1em -100rem 0
6-
padding: 1em 100rem 1em
7-
background: linear-gradient(var(--background-color) 90%, rgba(255, 255, 255, 0))
6+
margin: 0 0 0
7+
padding: 1em 0 0em
8+
9+
10+
&:global(.is-stuck)
11+
.backdrop
12+
border-bottom: 1px solid var(--panel-rule-color)
13+
14+
&.fade-bottom
15+
.backdrop
16+
background: linear-gradient(var(--background-color) 90%, rgba(255, 255, 255, 0))
17+
border-bottom: none
18+
19+
.backdrop
20+
position: absolute
21+
top: 0
22+
left: 50%
23+
width: 100vw
24+
height: 100%
25+
background: var(--background-color)
26+
margin: 0 -50vw 0
27+
z-index: -1
28+

0 commit comments

Comments
 (0)