-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] Add the jekyll-code-tabs plugin
- refer to clustergarage/jekyll-code-tabs#5
- Loading branch information
1 parent
7e64487
commit 32871af
Showing
5 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<meta charset="utf-8" /> | ||
|
||
{% include seo.html %} {% unless site.atom_feed.hide %} | ||
<link | ||
href="{% if site.atom_feed.path %}{{ site.atom_feed.path }}{% else %}{{ '/feed.xml' | relative_url }}{% endif %}" | ||
type="application/atom+xml" | ||
rel="alternate" | ||
title="{{ site.title }} Feed" | ||
/> | ||
{% endunless %} | ||
|
||
<!-- https://t.co/dKP3o1e --> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
|
||
<script> | ||
document.documentElement.className = | ||
document.documentElement.className.replace(/\bno-js\b/g, "") + " js "; | ||
</script> | ||
|
||
<!-- For all browsers --> | ||
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}" /> | ||
<link | ||
rel="preload" | ||
href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css" | ||
as="style" | ||
onload="this.onload=null;this.rel='stylesheet'" | ||
/> | ||
<noscript | ||
><link | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css" | ||
/></noscript> | ||
|
||
{% if site.head_scripts %} {% for script in site.head_scripts %} | ||
<script src="{{ script | relative_url }}"></script> | ||
{% endfor %} {% endif %} | ||
|
||
<script> | ||
document.addEventListener("DOMContentLoaded", function () { | ||
document.getElementById("default").click(); | ||
}); | ||
|
||
function showTab(evt, tabId) { | ||
// Declare all variables | ||
var i, tabcontent, tablinks; | ||
|
||
// Get all elements with class="tabcontent" and hide them | ||
tabcontent = document.getElementsByClassName("tabcontent"); | ||
for (i = 0; i < tabcontent.length; i++) { | ||
tabcontent[i].style.display = "none"; | ||
} | ||
|
||
// Get all elements with class="tablinks" and remove the class "active" | ||
tablinks = document.getElementsByClassName("tablinks"); | ||
for (i = 0; i < tablinks.length; i++) { | ||
tablinks[i].className = tablinks[i].className.replace(" active", ""); | ||
} | ||
|
||
// Show the current tab, and add an "active" class to the button that opened the tab | ||
document.getElementById(tabId).style.display = "block"; | ||
evt.currentTarget.className += " active"; | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
# Only the main Sass file needs front matter (the dashes are enough) | ||
--- | ||
|
||
@charset "utf-8"; | ||
|
||
@import "minimal-mistakes/skins/{{ site.minimal_mistakes_skin | default: 'default' }}"; // skin | ||
@import "minimal-mistakes"; // main partials | ||
|
||
/* TABS */ | ||
|
||
/* Style the tab */ | ||
.tab { | ||
overflow: hidden; | ||
border: 1px solid #ccc; | ||
background-color: #f1f1f1; | ||
} | ||
|
||
/* Style the buttons that are used to open the tab content */ | ||
.tab button { | ||
background-color: inherit; | ||
float: left; | ||
border: none; | ||
outline: none; | ||
cursor: pointer; | ||
padding: 14px 16px; | ||
transition: 0.3s; | ||
} | ||
|
||
/* Change background color of buttons on hover */ | ||
.tab button:hover { | ||
background-color: #ddd; | ||
} | ||
|
||
/* Create an active/current tablink class */ | ||
.tab button.active { | ||
background-color: #ccc; | ||
} | ||
|
||
/* Style the tab content */ | ||
.tabcontent { | ||
display: none; | ||
padding: 6px 12px; | ||
border: 1px solid #ccc; | ||
border-top: none; | ||
} | ||
|
||
.tabcontent { | ||
animation: fadeEffect 0.5s; /* Fading effect takes 1 second */ | ||
} | ||
|
||
/* Go from zero to full opacity */ | ||
@keyframes fadeEffect { | ||
from { | ||
opacity: 0.5; | ||
} | ||
to { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
/* END TABS */ |