Skip to content

Commit 109639c

Browse files
kevmodromeConduitry
authored andcommittedDec 18, 2019
adds link to REPL from example page.
1 parent 6a5e1d5 commit 109639c

File tree

1 file changed

+51
-34
lines changed

1 file changed

+51
-34
lines changed
 

‎site/src/routes/examples/_TableOfContents.svelte

+51-34
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,33 @@
2929
font-weight: 700;
3030
}
3131
32+
div {
33+
display: flex;
34+
flex-direction: row;
35+
padding: 0.2rem 3rem;
36+
margin: 0 -3rem;
37+
}
38+
39+
div.active {
40+
background: rgba(0, 0, 0, 0.15) calc(100% - 3rem) 47% no-repeat
41+
url(/icons/arrow-right.svg);
42+
background-size: 1em 1em;
43+
color: white;
44+
}
45+
46+
div.active.loading {
47+
background: rgba(0, 0, 0, 0.1) calc(100% - 3rem) 47% no-repeat
48+
url(/icons/loading.svg);
49+
background-size: 1em 1em;
50+
color: white;
51+
}
52+
3253
a {
3354
display: flex;
55+
flex: 1 1 auto;
3456
position: relative;
3557
color: var(--sidebar-text);
3658
border-bottom: none;
37-
padding: 0.2rem 3rem;
38-
margin: 0 -3rem;
3959
font-size: 1.6rem;
4060
align-items: center;
4161
justify-content: start;
@@ -45,18 +65,11 @@
4565
color: white;
4666
}
4767
48-
a.active {
49-
background: rgba(0, 0, 0, 0.15) calc(100% - 3rem) 50% no-repeat
50-
url(/icons/arrow-right.svg);
51-
background-size: 1em 1em;
52-
color: white;
53-
}
54-
55-
a.active.loading {
56-
background: rgba(0, 0, 0, 0.1) calc(100% - 3rem) 50% no-repeat
57-
url(/icons/loading.svg);
58-
background-size: 1em 1em;
59-
color: white;
68+
.repl-link {
69+
flex: 0 1 auto;
70+
font-size: 1.2rem;
71+
font-weight: 700;
72+
margin-right: 2.5rem;
6073
}
6174
6275
.thumbnail {
@@ -72,27 +85,31 @@
7285

7386
<ul class="examples-toc">
7487
{#each sections as section}
75-
<li>
76-
<span class="section-title">
77-
{section.title}
78-
</span>
88+
<li>
89+
<span class="section-title">{section.title}</span>
7990

80-
{#each section.examples as example}
81-
<a
82-
href="examples#{example.slug}"
83-
class="row"
84-
class:active="{example.slug === active_section}"
85-
class:loading="{isLoading}"
86-
>
87-
<img
88-
class="thumbnail"
89-
alt="{example.title} thumbnail"
90-
src="examples/thumbnails/{example.slug}.jpg"
91-
/>
91+
{#each section.examples as example}
92+
<div
93+
class="row"
94+
class:active={example.slug === active_section}
95+
class:loading={isLoading}>
96+
<a
97+
href="examples#{example.slug}"
98+
class="row"
99+
class:active={example.slug === active_section}
100+
class:loading={isLoading}>
101+
<img
102+
class="thumbnail"
103+
alt="{example.title} thumbnail"
104+
src="examples/thumbnails/{example.slug}.jpg" />
92105

93-
<span>{example.title}</span>
94-
</a>
95-
{/each}
96-
</li>
106+
<span>{example.title}</span>
107+
</a>
108+
{#if example.slug === active_section}
109+
<a href="repl/{example.slug}" class="repl-link">REPL</a>
110+
{/if}
111+
</div>
112+
{/each}
113+
</li>
97114
{/each}
98115
</ul>

0 commit comments

Comments
 (0)
Please sign in to comment.