Skip to content

Commit

Permalink
Add the start of a homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilkybarkid committed Jun 20, 2024
1 parent 9befb97 commit 5cd9976
Showing 1 changed file with 5 additions and 65 deletions.
70 changes: 5 additions & 65 deletions src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,16 @@ toc: false

<div class="hero">
<h1>PREreview Stats</h1>
<h2>Welcome to your new project! Edit&nbsp;<code style="font-size: 90%;">src/index.md</code> to change this page.</h2>
<a href="https://observablehq.com/framework/getting-started">Get started<span style="display: inline-block; margin-left: 0.25rem;">↗︎</span></a>
</div>

<div class="grid grid-cols-2" style="grid-auto-rows: 504px;">
<div class="card">${
resize((width) => Plot.plot({
title: "Your awesomeness over time 🚀",
subtitle: "Up and to the right!",
width,
y: {grid: true, label: "Awesomeness"},
marks: [
Plot.ruleY([0]),
Plot.lineY(aapl, {x: "Date", y: "Close", tip: true})
]
}))
}</div>
<div class="card">${
resize((width) => Plot.plot({
title: "How big are penguins, anyway? 🐧",
width,
grid: true,
x: {label: "Body mass (g)"},
y: {label: "Flipper length (mm)"},
color: {legend: true},
marks: [
Plot.linearRegressionY(penguins, {x: "body_mass_g", y: "flipper_length_mm", stroke: "species"}),
Plot.dot(penguins, {x: "body_mass_g", y: "flipper_length_mm", stroke: "species", tip: true})
]
}))
}</div>
</div>

---

## Next steps

Here are some ideas of things you could try…
```js
const requests = FileAttachment('./data/requests.json').json()
```

<div class="grid grid-cols-4">
<div class="card">
Chart your own data using <a href="https://observablehq.com/framework/lib/plot"><code>Plot</code></a> and <a href="https://observablehq.com/framework/files"><code>FileAttachment</code></a>. Make it responsive using <a href="https://observablehq.com/framework/display#responsive-display"><code>resize</code></a>.
</div>
<div class="card">
Create a <a href="https://observablehq.com/framework/project-structure">new page</a> by adding a Markdown file (<code>whatever.md</code>) to the <code>src</code> folder.
</div>
<div class="card">
Add a drop-down menu using <a href="https://observablehq.com/framework/inputs/select"><code>Inputs.select</code></a> and use it to filter the data shown in a chart.
</div>
<div class="card">
Write a <a href="https://observablehq.com/framework/loaders">data loader</a> that queries a local database or API, generating a data snapshot on build.
</div>
<div class="card">
Import a <a href="https://observablehq.com/framework/imports">recommended library</a> from npm, such as <a href="https://observablehq.com/framework/lib/leaflet">Leaflet</a>, <a href="https://observablehq.com/framework/lib/dot">GraphViz</a>, <a href="https://observablehq.com/framework/lib/tex">TeX</a>, or <a href="https://observablehq.com/framework/lib/duckdb">DuckDB</a>.
</div>
<div class="card">
Ask for help, or share your work or ideas, on the <a href="https://talk.observablehq.com/">Observable forum</a>.
</div>
<div class="card">
Visit <a href="https://github.com/observablehq/framework">Framework on GitHub</a> and give us a star. Or file an issue if you’ve found a bug!
<h2>Total requests</h2>
<span class="big">${requests.length.toLocaleString("en-US")}</span>
</div>
</div>

Expand Down Expand Up @@ -92,16 +42,6 @@ Here are some ideas of things you could try…
background-clip: text;
}

.hero h2 {
margin: 0;
max-width: 34em;
font-size: 20px;
font-style: initial;
font-weight: 500;
line-height: 1.5;
color: var(--theme-foreground-muted);
}

@media (min-width: 640px) {
.hero h1 {
font-size: 90px;
Expand Down

0 comments on commit 5cd9976

Please sign in to comment.