adds link to REPL from example page.

pull/4130/head
Kevin Åberg Kultalahti 5 years ago committed by Conduitry
parent 6a5e1d5033
commit 109639c57c

@ -29,13 +29,33 @@
font-weight: 700; font-weight: 700;
} }
div {
display: flex;
flex-direction: row;
padding: 0.2rem 3rem;
margin: 0 -3rem;
}
div.active {
background: rgba(0, 0, 0, 0.15) calc(100% - 3rem) 47% no-repeat
url(/icons/arrow-right.svg);
background-size: 1em 1em;
color: white;
}
div.active.loading {
background: rgba(0, 0, 0, 0.1) calc(100% - 3rem) 47% no-repeat
url(/icons/loading.svg);
background-size: 1em 1em;
color: white;
}
a { a {
display: flex; display: flex;
flex: 1 1 auto;
position: relative; position: relative;
color: var(--sidebar-text); color: var(--sidebar-text);
border-bottom: none; border-bottom: none;
padding: 0.2rem 3rem;
margin: 0 -3rem;
font-size: 1.6rem; font-size: 1.6rem;
align-items: center; align-items: center;
justify-content: start; justify-content: start;
@ -45,18 +65,11 @@
color: white; color: white;
} }
a.active { .repl-link {
background: rgba(0, 0, 0, 0.15) calc(100% - 3rem) 50% no-repeat flex: 0 1 auto;
url(/icons/arrow-right.svg); font-size: 1.2rem;
background-size: 1em 1em; font-weight: 700;
color: white; margin-right: 2.5rem;
}
a.active.loading {
background: rgba(0, 0, 0, 0.1) calc(100% - 3rem) 50% no-repeat
url(/icons/loading.svg);
background-size: 1em 1em;
color: white;
} }
.thumbnail { .thumbnail {
@ -72,27 +85,31 @@
<ul class="examples-toc"> <ul class="examples-toc">
{#each sections as section} {#each sections as section}
<li> <li>
<span class="section-title"> <span class="section-title">{section.title}</span>
{section.title}
</span>
{#each section.examples as example} {#each section.examples as example}
<a <div
href="examples#{example.slug}" class="row"
class="row" class:active={example.slug === active_section}
class:active="{example.slug === active_section}" class:loading={isLoading}>
class:loading="{isLoading}" <a
> href="examples#{example.slug}"
<img class="row"
class="thumbnail" class:active={example.slug === active_section}
alt="{example.title} thumbnail" class:loading={isLoading}>
src="examples/thumbnails/{example.slug}.jpg" <img
/> class="thumbnail"
alt="{example.title} thumbnail"
src="examples/thumbnails/{example.slug}.jpg" />
<span>{example.title}</span> <span>{example.title}</span>
</a> </a>
{/each} {#if example.slug === active_section}
</li> <a href="repl/{example.slug}" class="repl-link">REPL</a>
{/if}
</div>
{/each}
</li>
{/each} {/each}
</ul> </ul>

Loading…
Cancel
Save