fix opacity on examples TOC

pull/2481/head
Richard Harris 6 years ago
parent 0129277b51
commit 9dc554203d

@ -40,7 +40,7 @@
border-right: 1px solid var(--second); border-right: 1px solid var(--second);
background-color: var(--second); background-color: var(--second);
color: white; color: white;
padding: 2em 2em 0 2em; padding: 3rem 3rem 0 3rem;
} }
.examples-toc li { .examples-toc li {
@ -49,13 +49,6 @@
margin: 0 0 4.8rem 0; margin: 0 0 4.8rem 0;
} }
a {
position: relative;
opacity: 0.7;
transition: opacity 0.2s;
color: white;
}
.section-title { .section-title {
display: block; display: block;
padding: 0 0 .8rem 0; padding: 0 0 .8rem 0;
@ -74,35 +67,43 @@
.example-title:hover { .example-title:hover {
color: var(--flash); color: var(--flash);
opacity: 1
} }
.active { /* .active {
opacity: 1;
font-weight: 600; font-weight: 600;
} } */
.row { a {
position: relative;
margin: 0.5em 0;
display: flex; display: flex;
position: relative;
color: white;
border-bottom: none;
padding: 0.2rem 3rem;
margin: 0 -3rem;
/* margin: 0.5em 0; */
align-items: center; align-items: center;
justify-content: space-between; justify-content: start;
} }
.info { a:hover {
display: flex; color: var(--flash);
align-items: center; }
a.active {
background: rgba(255, 255, 255, 0.1) calc(100% - 3rem) 50% no-repeat url(/icons/arrow-right.svg);
background-size: 1em 1em;
color: white;
} }
.thumbnail { .thumbnail {
background: white 50% 50% no-repeat; background-color: white;
background-size: contain; object-fit: contain;
width: 5rem; width: 5rem;
height: 5rem; height: 5rem;
border: 1px solid #ccc; /* border: 1px solid #ccc; */
border-radius: 2px; border-radius: 2px;
box-shadow: 1px 1px 3px rgba(0,0,0,0.13); box-shadow: 1px 1px 3px rgba(0,0,0,0.13);
margin: 0.2em 0.5em 0.2em 0;
} }
</style> </style>
@ -114,24 +115,21 @@
</span> </span>
{#each section.examples as example} {#each section.examples as example}
<a href="examples#{example.slug}"> <a
<div href="examples#{example.slug}"
class="row" class="row"
class:active="{example.slug === active_section}" class:active="{example.slug === active_section}"
> >
<div class="info"> <img
<div
class="thumbnail" class="thumbnail"
style="background-image: url(examples/thumbnails/{example.slug}.jpg)" alt="{example.title} thumbnail"
></div> src="examples/thumbnails/{example.slug}.jpg"
<div class="example-title"> >
{example.title}
</div> <span>{example.title}</span>
</div> <!-- {#if example.slug === active_section}
{#if example.slug === active_section}
<Icon name="arrow-right" /> <Icon name="arrow-right" />
{/if} {/if} -->
</div>
</a> </a>
{/each} {/each}
</li> </li>

Loading…
Cancel
Save