Compare commits
2 Commits
48af5e650d
...
b75b59aad5
Author | SHA1 | Date |
---|---|---|
Ben Visness | b75b59aad5 | |
Ben Visness | 2fbdf19f41 |
|
@ -8306,6 +8306,13 @@ nav.timecodes {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 10px 0; }
|
margin: 10px 0; }
|
||||||
|
|
||||||
|
.edu-course.highlight {
|
||||||
|
border-left: 0.25rem solid black;
|
||||||
|
border-color: #666;
|
||||||
|
border-color: var(--link-color);
|
||||||
|
background-color: #ccc;
|
||||||
|
background-color: var(--theme-color-dimmest); }
|
||||||
|
|
||||||
.edu-course .edu-article.coming-soon {
|
.edu-course .edu-article.coming-soon {
|
||||||
font-style: italic; }
|
font-style: italic; }
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
.edu-course {
|
.edu-course {
|
||||||
|
&.highlight {
|
||||||
|
border-left: 0.25rem solid black;
|
||||||
|
@include usevar(border-color, link-color);
|
||||||
|
@include usevar(background-color, theme-color-dimmest);
|
||||||
|
}
|
||||||
|
|
||||||
.edu-article.coming-soon {
|
.edu-article.coming-soon {
|
||||||
@extend .c--dimmer;
|
@extend .c--dimmer;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
|
|
|
@ -85,5 +85,29 @@
|
||||||
<div><a href="{{ .NewArticleUrl }}"><span class="big pr1">+</span> New Article</a></div>
|
<div><a href="{{ .NewArticleUrl }}"><span class="big pr1">+</span> New Article</a></div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function highlightHash(hash) {
|
||||||
|
if (!hash) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const courses = document.querySelectorAll('.edu-course');
|
||||||
|
for (const course of courses) {
|
||||||
|
course.classList.remove('highlight');
|
||||||
|
}
|
||||||
|
const selectedCourse = document.querySelector(hash);
|
||||||
|
if (selectedCourse) {
|
||||||
|
selectedCourse.classList.add('highlight');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
highlightHash(window.location.hash);
|
||||||
|
|
||||||
|
for (const a of document.querySelectorAll('a.edu-topic')) {
|
||||||
|
a.addEventListener('click', e => {
|
||||||
|
highlightHash(e.target.closest('a').hash);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -69,7 +69,7 @@ func EducationIndex(c *RequestContext) ResponseData {
|
||||||
Name: "Networking",
|
Name: "Networking",
|
||||||
Slug: "networking",
|
Slug: "networking",
|
||||||
Articles: []templates.EduArticle{
|
Articles: []templates.EduArticle{
|
||||||
article("networking"),
|
article("http"),
|
||||||
{
|
{
|
||||||
Title: "Internet infrastructure",
|
Title: "Internet infrastructure",
|
||||||
Description: "How does the internet actually work? How does your ISP know where to send your data? What happens to the internet if physical communication breaks down?",
|
Description: "How does the internet actually work? How does your ISP know where to send your data? What happens to the internet if physical communication breaks down?",
|
||||||
|
|
Reference in New Issue