Skip to content

Commit a57aeb0

Browse files
committed
somewhat working
1 parent d4254c7 commit a57aeb0

26 files changed

Lines changed: 3506 additions & 1304 deletions

package-lock.json

Lines changed: 14 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/BlogPage.svelte

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<script>
2+
// SVELTE
3+
import { getContext, onMount } from "svelte";
4+
5+
// STORES
6+
import { currAgentSlide, uniqueAgents } from "$stores/misc.js";
7+
8+
// COMPONENTS
9+
import PaperHeader from "$components/PaperHeader.svelte";
10+
import Intro from "$components/Intro.svelte";
11+
import ChartScroll from "$components/ChartScroll.svelte";
12+
import AgentAdvantageTable from "$components/AgentAdvantageTable.svelte";
13+
import AgentCard from "$components/AgentCard.svelte";
14+
import AgentCardNav from "$components/AgentCard.Nav.svelte";
15+
import Slider from "$components/helpers/Slider.svelte";
16+
import Slide from "$components/helpers/Slider.Slide.svelte";
17+
import Tap from "$components/helpers/Tap.svelte";
18+
import Leaderboard from "$components/Leaderboard.svelte";
19+
// import Outro from "$components/Outro.svelte";
20+
import Footer from "$components/Footer.svelte";
21+
import Tooltip from "$components/Tooltip.svelte";
22+
23+
// Enable scrolling (was previously done in Intro component)
24+
onMount(() => {
25+
document.body.style.overflowY = "scroll";
26+
});
27+
28+
// VARIABLES
29+
const copy = getContext("copy");
30+
31+
// Slider ref for agent cards
32+
let sliderEl;
33+
34+
// Agent data from store
35+
$: agents = $uniqueAgents;
36+
37+
// Handle slider navigation
38+
$: if (sliderEl && $currAgentSlide !== undefined) {
39+
sliderEl.jump($currAgentSlide);
40+
}
41+
42+
// Handle tap navigation (keyboard arrows and visual buttons)
43+
function handleTap(event) {
44+
const direction = event.detail;
45+
if (direction === "left" && $currAgentSlide > 0) {
46+
currAgentSlide.update((n) => n - 1);
47+
} else if (direction === "right" && $currAgentSlide < agents.length - 1) {
48+
currAgentSlide.update((n) => n + 1);
49+
}
50+
}
51+
</script>
52+
53+
<div class="blog-page">
54+
<!-- Paper Header -->
55+
<PaperHeader />
56+
57+
<!-- Intro section (interactive) -->
58+
<Intro />
59+
60+
<!-- MAIN FEATURE: Scrollytelling with scatterplot -->
61+
<ChartScroll />
62+
63+
<!-- Agent Cards with Slider Navigation -->
64+
{#if agents && agents.length > 0}
65+
<div class="agent-slider-shell">
66+
<AgentCardNav />
67+
<Slider bind:this={sliderEl} bind:current={$currAgentSlide}>
68+
{#each agents as agent, i}
69+
<Slide index={i}>
70+
<AgentCard {agent} />
71+
</Slide>
72+
{/each}
73+
</Slider>
74+
75+
<!-- Keyboard and visual navigation -->
76+
<Tap
77+
enableKeyboard={true}
78+
showArrows={true}
79+
arrowPosition="center"
80+
positionMode="container"
81+
on:tap={handleTap}
82+
/>
83+
</div>
84+
{/if}
85+
86+
<!-- DISABLED: Outro section -->
87+
<!-- <Outro /> -->
88+
89+
<!-- Leaderboard section -->
90+
<Leaderboard />
91+
92+
<!-- ENABLED: Tooltip for scatterplot interactions -->
93+
<Tooltip />
94+
95+
<!-- <Explore /> -->
96+
</div>
97+
98+
<style>
99+
/* Agent cards slider styles are handled by the Slider component */
100+
101+
.agent-slider-shell {
102+
position: relative;
103+
width: 100%;
104+
}
105+
106+
.blog-page {
107+
padding-top: 0;
108+
}
109+
</style>

0 commit comments

Comments
 (0)