Skip to content

Commit e221dbb

Browse files
committed
styling fix
1 parent 7c8fa16 commit e221dbb

File tree

5 files changed

+140
-130
lines changed

5 files changed

+140
-130
lines changed

pages/lex/+Page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function Page() {
3131
measurements += stat.measurements || 0;
3232
});
3333

34-
return h('div', [
34+
return h("div", [
3535
h(ContentPage, [
3636
h(PageHeader, { title: "Lexicon" }),
3737

@@ -91,7 +91,7 @@ export function Page() {
9191
", Macrostrat's legacy lexicon app, is still available for use as it is gradually brought into this new framework.",
9292
]),
9393
]),
94-
h(Footer)
94+
h(Footer),
9595
]);
9696
}
9797

pages/lex/timescales/@id/+Page.client.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ export function Page() {
2121
const id = parseInt(pageContext.urlParsed.pathname.split("/")[3]);
2222
const res = useAPIResult(SETTINGS.apiV2Prefix + "/defs/timescales?all")
2323
?.success.data;
24-
const intervals = useAPIResult(SETTINGS.apiV2Prefix + "/defs/intervals?timescale_id=" + id)
25-
?.success.data;
24+
const intervals = useAPIResult(
25+
SETTINGS.apiV2Prefix + "/defs/intervals?timescale_id=" + id
26+
)?.success.data;
2627
const [clickedInterval, setClickedInterval] = useState(null);
2728

2829
useEffect(() => {
@@ -103,7 +104,7 @@ export function Page() {
103104
),
104105
]),
105106
]),
106-
h(Footer)
107+
h(Footer),
107108
]);
108109
}
109110

@@ -157,4 +158,4 @@ function EconItem({ data }) {
157158
),
158159
])
159160
);
160-
}
161+
}

pages/lex/timescales/@id/main.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ tspan {
4343
border-radius: 0.2em;
4444
}
4545
}
46-
}
46+
}

pages/projects/+Page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ export function Page() {
1515

1616
const { projects } = useData();
1717

18-
return h('div', [
18+
return h("div", [
1919
h(ContentPage, [
2020
h(PageHeader, { title: "Projects" }),
2121
projects.map((d) =>
2222
h(ProjectItem, { data: d, key: d.project_id, pictures })
2323
),
2424
]),
25-
h(Footer)
25+
h(Footer),
2626
]);
2727
}
2828

src/components/lex/index.ts

Lines changed: 130 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -99,144 +99,153 @@ export function IndividualPage(id, type, header) {
9999

100100
if (!intRes || !fossilRes) return h(Loading);
101101

102-
const { name, abbrev, b_age, t_age, timescales, strat_name, concept_id, int_id } =
103-
intRes;
102+
const {
103+
name,
104+
abbrev,
105+
b_age,
106+
t_age,
107+
timescales,
108+
strat_name,
109+
concept_id,
110+
int_id,
111+
} = intRes;
104112

105113
const area = parseInt(col_area.toString().split(".")[0]);
106114

107-
return h('div', [
108-
h(ContentPage, { className: "int-page" }, [
109-
h("div.page-header", [
110-
h(PageBreadcrumbs, { title: "#" + id }),
111-
h(DarkModeButton, { className: "dark-mode-button", showText: true }),
112-
]),
113-
h("div.int-header", [
114-
h("div.int-names", [
115-
h(
116-
"div.int-name",
117-
{
118-
style: {
119-
backgroundColor: chromaColor?.luminance(1 - luminance).hex(),
120-
color: chromaColor?.luminance(luminance).hex(),
121-
},
122-
},
123-
UpperCase(strat_name ? strat_name : name)
124-
),
125-
abbrev
126-
? h("div.int-abbrev", [
127-
h("p", " aka "),
128-
h(
129-
"div.int-abbrev-item",
130-
{
131-
style: {
132-
backgroundColor: chromaColor
133-
?.luminance(1 - luminance)
134-
.hex(),
135-
color: chromaColor?.luminance(luminance).hex(),
136-
},
137-
},
138-
abbrev
139-
),
140-
])
141-
: null,
142-
]),
143-
h("div.sift-link", [
144-
h("p", "This page is is in development."),
145-
h(
146-
"a",
147-
{ href: "/sift/" + siftLink + "/" + id, target: "_blank" },
148-
"View in Sift"
149-
),
115+
return h("div", [
116+
h(ContentPage, { className: "int-page" }, [
117+
h("div.page-header", [
118+
h(PageBreadcrumbs, { title: "#" + id }),
119+
h(DarkModeButton, { className: "dark-mode-button", showText: true }),
150120
]),
151-
]),
152-
h.if(concept_id)(conceptInfo, { concept_id, header }),
153-
h.if(header === "intervals")("div.timescale",
154-
h(Timescale, {
155-
length: 970,
156-
levels: [1, 5],
157-
ageRange: [b_age, t_age],
158-
absoluteAgeScale: true,
159-
})
160-
),
161-
h.if(colData?.features.length)("div.table", [
162-
h("div.table-content", [
163-
h("div.packages", t_sections.toLocaleString() + " packages"),
164-
h(Divider, { className: "divider" }),
165-
h("div.units", t_units.toLocaleString() + " units"),
166-
h(Divider, { className: "divider" }),
167-
h("div.interval", [
121+
h("div.int-header", [
122+
h("div.int-names", [
168123
h(
169-
Link,
170-
{ href: "/lex/intervals/" + b_id },
171-
b_int_name.toLocaleString()
124+
"div.int-name",
125+
{
126+
style: {
127+
backgroundColor: chromaColor?.luminance(1 - luminance).hex(),
128+
color: chromaColor?.luminance(luminance).hex(),
129+
},
130+
},
131+
UpperCase(strat_name ? strat_name : name)
172132
),
173-
" - ",
133+
abbrev
134+
? h("div.int-abbrev", [
135+
h("p", " aka "),
136+
h(
137+
"div.int-abbrev-item",
138+
{
139+
style: {
140+
backgroundColor: chromaColor
141+
?.luminance(1 - luminance)
142+
.hex(),
143+
color: chromaColor?.luminance(luminance).hex(),
144+
},
145+
},
146+
abbrev
147+
),
148+
])
149+
: null,
150+
]),
151+
h("div.sift-link", [
152+
h("p", "This page is is in development."),
174153
h(
175-
Link,
176-
{ href: "/lex/intervals/" + t_id },
177-
t_int_name.toLocaleString()
154+
"a",
155+
{ href: "/sift/" + siftLink + "/" + id, target: "_blank" },
156+
"View in Sift"
178157
),
179158
]),
180-
h.if(b_age && t_age)(Divider, { className: "divider" }),
181-
h.if(b_age && t_age)("div.age-range", [
182-
h("div.int-age", b_age + " - " + t_age + " Ma"),
183-
// h(Parenthetical, { className: "range"}, h(Duration, { value: b_age - t_age })),
159+
]),
160+
h.if(concept_id)(conceptInfo, { concept_id, header }),
161+
h.if(header === "intervals")(
162+
"div.timescale",
163+
h(Timescale, {
164+
length: 970,
165+
levels: [1, 5],
166+
ageRange: [b_age, t_age],
167+
absoluteAgeScale: true,
168+
})
169+
),
170+
h.if(colData?.features.length)("div.table", [
171+
h("div.table-content", [
172+
h("div.packages", t_sections.toLocaleString() + " packages"),
173+
h(Divider, { className: "divider" }),
174+
h("div.units", t_units.toLocaleString() + " units"),
175+
h(Divider, { className: "divider" }),
176+
h("div.interval", [
177+
h(
178+
Link,
179+
{ href: "/lex/intervals/" + b_id },
180+
b_int_name.toLocaleString()
181+
),
182+
" - ",
183+
h(
184+
Link,
185+
{ href: "/lex/intervals/" + t_id },
186+
t_int_name.toLocaleString()
187+
),
188+
]),
189+
h.if(b_age && t_age)(Divider, { className: "divider" }),
190+
h.if(b_age && t_age)("div.age-range", [
191+
h("div.int-age", b_age + " - " + t_age + " Ma"),
192+
// h(Parenthetical, { className: "range"}, h(Duration, { value: b_age - t_age })),
193+
]),
194+
h(Divider, { className: "divider" }),
195+
h("div.area", [h("p", area.toLocaleString() + " km"), h("sup", "2")]),
196+
h(Divider, { className: "divider" }),
197+
h("div.thickness", "≤ " + max_thick.toLocaleString() + "m thick"),
198+
h(Divider, { className: "divider" }),
199+
h(
200+
"div.collections",
201+
pbdb_collections.toLocaleString() + " collections"
202+
),
184203
]),
185-
h(Divider, { className: "divider" }),
186-
h("div.area", [h("p", area.toLocaleString() + " km"), h("sup", "2")]),
187-
h(Divider, { className: "divider" }),
188-
h("div.thickness", "≤ " + max_thick.toLocaleString() + "m thick"),
189-
h(Divider, { className: "divider" }),
190-
h(
191-
"div.collections",
192-
pbdb_collections.toLocaleString() + " collections"
204+
colData ? h(ColumnsMap, { columns: colData }) : h(Loading),
205+
]),
206+
h("div.charts", [
207+
h.if(liths?.length)(
208+
"div.chart",
209+
Chart(liths, "Lithologies", "lithology", activeIndex, setActiveIndex)
210+
),
211+
h.if(environs?.length)(
212+
"div.chart",
213+
Chart(
214+
environs,
215+
"Environments",
216+
"environments",
217+
activeIndex,
218+
setActiveIndex
219+
)
220+
),
221+
h.if(econs?.length)(
222+
"div.chart",
223+
Chart(econs, "Economics", "economics", activeIndex, setActiveIndex)
193224
),
194225
]),
195-
colData ? h(ColumnsMap, { columns: colData }) : h(Loading),
196-
]),
197-
h("div.charts", [
198-
h.if(liths?.length)(
199-
"div.chart",
200-
Chart(liths, "Lithologies", "lithology", activeIndex, setActiveIndex)
201-
),
202-
h.if(environs?.length)(
203-
"div.chart",
204-
Chart(
205-
environs,
206-
"Environments",
207-
"environments",
208-
activeIndex,
209-
setActiveIndex
210-
)
211-
),
212-
h.if(econs?.length)(
213-
"div.chart",
214-
Chart(econs, "Economics", "economics", activeIndex, setActiveIndex)
215-
),
216-
]),
217226

218-
h.if(taxaData)(PrevalentTaxa, { data: taxaData }),
219-
h.if(header === "strat_names")(StratNameHierarchy, { id }),
220-
// h.if(header === "strat_name_concepts")(ConceptHierarchy, { id}),
221-
h.if(timescales?.[0]?.name)("div.int-timescales", [
222-
h("h3", "Timescales"),
223-
h(
224-
"ul",
225-
timescales?.map((t) =>
226-
h(
227-
"li",
227+
h.if(taxaData)(PrevalentTaxa, { data: taxaData }),
228+
h.if(header === "strat_names")(StratNameHierarchy, { id }),
229+
// h.if(header === "strat_name_concepts")(ConceptHierarchy, { id}),
230+
h.if(timescales?.[0]?.name)("div.int-timescales", [
231+
h("h3", "Timescales"),
232+
h(
233+
"ul",
234+
timescales?.map((t) =>
228235
h(
229-
Link,
230-
{ href: "/lex/timescales/" + t.timescale_id },
231-
titleCase(t.name)
236+
"li",
237+
h(
238+
Link,
239+
{ href: "/lex/timescales/" + t.timescale_id },
240+
titleCase(t.name)
241+
)
232242
)
233243
)
234-
)
235-
),
244+
),
245+
]),
246+
h(References, { res1: fossilResult, res2: colDataResult }),
236247
]),
237-
h(References, { res1: fossilResult, res2: colDataResult }),
238-
]),
239-
h(Footer),
248+
h(Footer),
240249
]);
241250
}
242251

0 commit comments

Comments
 (0)