Bulma v9 website (#3249)

* Add Bulma v9

* Add vendor dependencies

* Fix native

* Fix sponsors

* Add style attribute
This commit is contained in:
Jeremy Thomas
2021-01-27 23:30:42 +00:00
committed by GitHub
parent c5edaea84f
commit 08ef4df2c0
1963 changed files with 157468 additions and 9452 deletions

35
docs/_javascript/start.js Normal file
View File

@@ -0,0 +1,35 @@
document.addEventListener('DOMContentLoaded', () => {
// Utils
const tabs = getAll('.bd-tabs');
if (tabs && tabs.length > 0) {
tabs.forEach((tab) => {
const buttons = getAll('.bd-tabs-nav button', tab);
const items = getAll('.bd-tabs-item', tab);
buttons.forEach((button, index) => {
button.addEventListener('click', (event) => {
showTab(buttons, items, index);
});
});
});
}
function showTab(buttons, items, index) {
buttons.forEach((button) => {
button.classList.remove('bd-is-active');
});
items.forEach((item) => {
item.classList.remove('bd-is-active');
});
buttons[index].classList.add('bd-is-active');
items[index].classList.add('bd-is-active');
}
function getAll(selector, parent = document) {
return Array.prototype.slice.call(parent.querySelectorAll(selector), 0);
}
});