|
29 | 29 | font-weight: 700;
|
30 | 30 | }
|
31 | 31 |
|
| 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 | +
|
32 | 53 | a {
|
33 | 54 | display: flex;
|
| 55 | + flex: 1 1 auto; |
34 | 56 | position: relative;
|
35 | 57 | color: var(--sidebar-text);
|
36 | 58 | border-bottom: none;
|
37 |
| - padding: 0.2rem 3rem; |
38 |
| - margin: 0 -3rem; |
39 | 59 | font-size: 1.6rem;
|
40 | 60 | align-items: center;
|
41 | 61 | justify-content: start;
|
|
45 | 65 | color: white;
|
46 | 66 | }
|
47 | 67 |
|
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; |
60 | 73 | }
|
61 | 74 |
|
62 | 75 | .thumbnail {
|
|
72 | 85 |
|
73 | 86 | <ul class="examples-toc">
|
74 | 87 | {#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> |
79 | 90 |
|
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" /> |
92 | 105 |
|
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> |
97 | 114 | {/each}
|
98 | 115 | </ul>
|
0 commit comments