Skip to content

Commit 5e5907d

Browse files
committed
add now playing stuff
1 parent f4a23a0 commit 5e5907d

File tree

5 files changed

+61
-4
lines changed

5 files changed

+61
-4
lines changed

content/index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ My name is Ellie Huxtable. I'm a software/infrastructure engineer, and am at my
1111
Here you will find a mix of notes, longer/more thoughtful posts, and links to various things I've done
1212

1313
</div>
14-
1514
<div class="me">
1615
<img src="https://yeet.ellie.wtf/i/f449b641480701bb19587f55672ac7e5bc94847a2d6df66cb5565bc2843e68a2.jpg"/>
1716
</div>
1817

18+
1919
</div>
2020

21+
2122
This site is constantly shifting, but here are some things you may be interested in
2223
- [Posts](/posts), a selection of my longer-form writing and thoughts
2324
- [Projects](/projects) - over the years I've built a lot of things, but the main two I'm known for are
@@ -26,15 +27,15 @@ This site is constantly shifting, but here are some things you may be interested
2627
- [Life](/life), where I'm writing about my travels, adventures, and life in general
2728
- [Notes](/notes), where I write about things I'm working on and exploring. They're not supposed to be as high-quality as a post, but I'll be publishing them much more often.
2829

29-
## Speaking
30+
## Speaking
3031

3132
- FOSDEM 2023, [magical shell history with Rust](https://www.youtube.com/watch?v=uyRmV19qJ2o)
3233
- EMFCamp 2024, [keeping shell history in sync with turtles and magic](https://www.youtube.com/watch?v=FIswx57l6hw)
3334

3435
## Podcasts
3536

3637
- [Rustship #3](https://www.marcoieni.com/2023/09/%EF%B8%8F-atuin-shell-history-sync-search-and-backup-ellie-huxtable-rustship-3/)
37-
- Changelog Interviews 579, [Making shell history magical with Atuin](https://changelog.com/podcast/579)
38+
- Changelog Interviews 579, [Making shell history magical with Atuin](https://changelog.com/podcast/579)
3839

3940
## Publicity
4041
Some of my [projects](/projects) have been featured in print, and on various blogs/podcasts. This list is not exhaustive, please get in touch if I've missed something!
@@ -64,4 +65,4 @@ Please do get in touch!
6465
6566
GitHub: [@ellie](https://github.com/ellie)<br>
6667
Mastodon: [@ellie@hachyderm.io](https://hachyderm.io/@ellie)<br>
67-
Twitter: [@ellie_huxtable](https://twitter.com/ellie_huxtable)<br>
68+
Twitter: [@ellie_huxtable](https://twitter.com/ellie_huxtable)<br>

quartz.layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const defaultContentPageLayout: PageLayout = {
2626
left: [
2727
Component.PageTitle(),
2828
Component.MobileOnly(Component.Spacer()),
29+
Component.NowPlaying(),
2930
Component.Search(),
3031
Component.Darkmode(),
3132
Component.DesktopOnly(Component.Links()),

quartz/components/NowPlaying.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
2+
// @ts-ignore
3+
import script from "./scripts/nowplaying.inline"
4+
import style from "./styles/graph.scss"
5+
import { i18n } from "../i18n"
6+
import { classNames } from "../util/lang"
7+
8+
export default (() => {
9+
const NowPlaying: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
10+
return <div id="nowplaying" />
11+
}
12+
13+
NowPlaying.afterDOMLoaded = script
14+
15+
return NowPlaying
16+
}) satisfies QuartzComponentConstructor

quartz/components/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import RecentNotes from "./RecentNotes"
2121
import Breadcrumbs from "./Breadcrumbs"
2222
import Links from "./Links"
2323

24+
// Custom
25+
import NowPlaying from "./NowPlaying"
26+
2427
export {
2528
ArticleTitle,
2629
Content,
@@ -44,4 +47,5 @@ export {
4447
NotFound,
4548
Breadcrumbs,
4649
Links,
50+
NowPlaying,
4751
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
function updateNowPlaying() {
2+
fetch("https://ellie-nowplaying.web.val.run/")
3+
.then((response) => response.json())
4+
.then((data) => {
5+
const nowplaying = document.getElementById("nowplaying")
6+
if (!nowplaying) return
7+
8+
nowplaying.innerHTML = `
9+
<div style="font-family: system-ui, sans-serif;">
10+
<span>Recent listening:</span>
11+
<div style="display: flex; align-items: center; gap: 0.75rem;">
12+
<img
13+
src="${data.artwork}"
14+
alt="Album artwork"
15+
style="width: 3rem; height: 3rem; object-fit: cover; border-radius: 0.125rem;"
16+
/>
17+
<div>
18+
<div style="color: #333; font-weight: 500;">${data.trackName}</div>
19+
<div style="color: #666; font-size: 0.875rem;">${data.artist}</div>
20+
</div>
21+
</div>
22+
</div>
23+
`
24+
})
25+
.catch(() => {
26+
const nowplaying = document.getElementById("nowplaying")
27+
if (!nowplaying) return
28+
29+
nowplaying.innerHTML = ""
30+
})
31+
}
32+
33+
// Update immediately and then every 30 seconds
34+
updateNowPlaying()
35+
setInterval(updateNowPlaying, 30000)

0 commit comments

Comments
 (0)