Skip to content

Commit ae1c8c6

Browse files
mbostocktrebor
andauthored
examples gallery (#772)
* WIP * edits * update assets * adopt --theme-red * data apps * lossless webp --------- Co-authored-by: Robert Harris <[email protected]>
1 parent 50c7ad8 commit ae1c8c6

File tree

9 files changed

+95
-25
lines changed

9 files changed

+95
-25
lines changed

docs/assets/api-dark.webp

233 KB
Binary file not shown.

docs/assets/api.webp

235 KB
Binary file not shown.

docs/assets/chess-dark.webp

93.9 KB
Binary file not shown.

docs/assets/chess.webp

93.8 KB
Binary file not shown.

docs/assets/eia-dark.webp

73.7 KB
Binary file not shown.

docs/assets/eia.webp

74.4 KB
Binary file not shown.

docs/assets/plot-dark.webp

17.8 KB
Binary file not shown.

docs/assets/plot.webp

47.2 KB
Binary file not shown.

docs/index.md

Lines changed: 95 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,120 @@ toc: false
55
<style>
66

77
.hero {
8-
display: flex;
9-
flex-direction: column;
10-
align-items: center;
118
font-family: var(--sans-serif);
12-
margin: 4rem 0 8rem;
9+
margin: 4rem 0;
1310
text-wrap: balance;
14-
text-align: center;
1511
}
1612

1713
.hero h1 {
18-
margin: 2rem 0;
19-
max-width: none;
20-
font-size: 14vw;
21-
font-weight: 900;
14+
font-size: 64px;
15+
font-family: var(--serif);
2216
line-height: 1;
23-
background: linear-gradient(30deg, var(--theme-foreground-focus), currentColor);
24-
-webkit-background-clip: text;
25-
-webkit-text-fill-color: transparent;
26-
background-clip: text;
17+
margin: 2rem 0;
2718
}
2819

2920
.hero h2 {
30-
margin: 0 0 3rem;
31-
max-width: 34em;
32-
font-size: 20px;
33-
font-style: initial;
34-
font-weight: 500;
35-
line-height: 1.5;
21+
font-style: normal;
22+
font-size: 18px;
23+
line-height: normal;
3624
color: var(--theme-foreground-muted);
3725
}
3826

39-
@media (min-width: 640px) {
40-
.hero h1 {
41-
font-size: 90px;
27+
.hero .observablehq-pre-container,
28+
.hero pre:not(.observablehq-pre-container pre) {
29+
margin: 1rem 0;
30+
}
31+
32+
.gallery {
33+
margin: 4rem -1rem;
34+
gap: 2rem;
35+
max-width: calc(640px + 2rem);
36+
}
37+
38+
.gallery a {
39+
display: flex;
40+
flex-direction: column;
41+
align-items: center;
42+
gap: 0.5rem;
43+
}
44+
45+
.gallery img {
46+
max-width: 100%;
47+
border-radius: 8px;
48+
box-shadow: 0 0 0 0.75px rgba(128, 128, 128, 0.2), 0 6px 12px 0 rgba(0, 0, 0, 0.2);
49+
aspect-ratio: 2500 / 1900;
50+
}
51+
52+
@media (prefers-color-scheme: dark) {
53+
.gallery img {
54+
box-shadow: 0 0 0 0.75px rgba(128, 128, 128, 0.2), 0 6px 12px 0 rgba(0, 0, 0, 0.4);
4255
}
4356
}
4457

58+
.gallery a:not(:hover, :focus) {
59+
color: var(--theme-foreground-muted);
60+
}
61+
62+
.gallery a:hover img,
63+
.gallery a:focus img {
64+
box-shadow: 0 0 0 0.75px var(--theme-foreground-focus), 0 6px 12px 0 rgba(0, 0, 0, 0.2);
65+
}
66+
67+
.gallery figcaption {
68+
font-size: 12px;
69+
color: inherit;
70+
}
71+
72+
.arrow {
73+
font-weight: 500;
74+
}
75+
76+
.arrow::after {
77+
content: "";
78+
display: inline-block;
79+
margin-left: 0.25rem;
80+
}
81+
4582
</style>
4683

4784
<div class="hero">
48-
<h1>The best dashboards are built with code</h1>
85+
<h1>The best data apps are built with <em class="red">code.</em></h1>
4986
<h2>Create fast, beautiful data apps, dashboards, and reports from the command line. Write Markdown, JavaScript, SQL, Python, R… and any language you like. Free and open-source.</h2>
50-
<pre data-copy>npm init @observablehq</pre>
51-
<a href="./getting-started">Get started<span style="display: inline-block; margin-left: 0.25rem;">→</span></a>
87+
<div style="display: flex; align-items: center; gap: 2rem;">
88+
<pre data-copy>npm init @observablehq</pre>
89+
<a href="./getting-started" class="small arrow" style="color: var(--theme-red);">Get started</a>
90+
</div>
91+
</div>
92+
93+
<div class="gallery grid grid-cols-2">
94+
<a href="./examples/api/" target="_blank">
95+
<picture>
96+
<source srcset="./assets/api-dark.webp" media="(prefers-color-scheme: dark)">
97+
<img src="./assets/api.webp">
98+
</picture>
99+
<div class="small arrow">Analyzing web logs</div>
100+
</a>
101+
<a href="./examples/eia/" target="_blank">
102+
<picture>
103+
<source srcset="./assets/eia-dark.webp" media="(prefers-color-scheme: dark)">
104+
<img src="./assets/eia.webp">
105+
</picture>
106+
<div class="small arrow">U.S. electricity grid</div>
107+
</a>
108+
<a href="./examples/chess/" target="_blank">
109+
<picture>
110+
<source srcset="./assets/chess-dark.webp" media="(prefers-color-scheme: dark)">
111+
<img src="./assets/chess.webp">
112+
</picture>
113+
<div class="small arrow">A year of chess rankings</div>
114+
</a>
115+
<a href="./examples/plot/" target="_blank">
116+
<picture>
117+
<source srcset="./assets/plot-dark.webp" media="(prefers-color-scheme: dark)">
118+
<img src="./assets/plot.webp">
119+
</picture>
120+
<div class="small arrow">Observable Plot downloads</div>
121+
</a>
52122
</div>
53123

54124
**Observable Framework** is an [open-source](https://github.com/observablehq/framework) static site generator for data apps, dashboards, reports, and more. Framework includes a preview server for local development, and a command-line interface for automating builds & deploys.

0 commit comments

Comments
 (0)