slayder-theme 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +1 -0
- data/assets/css/slayder.css +67 -0
- data/assets/images/a11y.svg +275 -0
- data/assets/images/devices.svg +1080 -0
- data/assets/images/orange-logo.svg +1 -0
- data/assets/images/slayder-sprites.svg +20 -0
- data/assets/js/colorModeToggler.js +80 -0
- data/assets/js/slayder.js +97 -0
- metadata +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283.46 283.46"><defs><style>#a{fill:#ff7900}#b,#c{fill:#fff}@media (max-width:49.98px){#b{display:none}}@media (min-width:50px){#c{display:none}}</style></defs><path d="M0 0h283.46v283.46H0z" id="a"/><path d="M40.51 202.47h202.47v40.5H40.51z" id="c"/><path d="M111.2 256a23.23 23.23 0 0 1-13 3.92c-7.36 0-11.71-4.9-11.71-11.46 0-8.83 8.12-13.51 24.85-15.4v-2.19c0-2.87-2.18-4.53-6.2-4.53a11.76 11.76 0 0 0-9.61 4.53l-7-4q5.52-7.71 16.82-7.7c10.28 0 16 4.45 16 11.7v28.6h-9.2zm-14.55-8.3c0 2.65 1.67 5.13 4.68 5.13 3.27 0 6.44-1.36 9.62-4.16v-9.34c-9.7 1.23-14.3 3.72-14.3 8.39zM129.54 221.07l8.59-1.19.94 4.68c4.85-3.55 8.7-5.44 13.55-5.44 8.12 0 12.3 4.31 12.3 12.84v27.47h-10.37v-25.66c0-4.83-1.26-7-5-7-3.1 0-6.19 1.43-9.71 4.38v28.3h-10.3zM233.69 260.18c-11.63 0-18.57-7.47-18.57-20.45s7-20.61 18.4-20.61 18.15 7.25 18.15 20.08c0 .68-.08 1.36-.08 2h-26.27c.08 7.47 3.18 11.24 9.29 11.24 3.93 0 6.52-1.58 8.95-5l7.61 4.22c-3.35 5.58-9.37 8.52-17.48 8.52zm7.78-25.66c0-5.28-3-8.38-7.95-8.38-4.68 0-7.61 3-8 8.38zM34.89 260.61c-10.27 0-19.52-6.54-19.52-20.82S24.62 219 34.89 219s19.52 6.55 19.52 20.82-9.26 20.79-19.52 20.79zm0-32.86c-7.75 0-9.19 7-9.19 12s1.44 12.05 9.19 12.05 9.19-7 9.19-12.05-1.44-12-9.19-12zM61.53 220h9.87v4.64a15.29 15.29 0 0 1 10.87-5.45 8.6 8.6 0 0 1 1.34.07V229h-.5c-4.52 0-9.46.7-11 4.21v26.24H61.53zM190.34 251c7.88-.06 8.54-8.07 8.54-13.31 0-6.16-3-11.18-8.61-11.18-3.73 0-7.89 2.72-7.89 11.61 0 4.88.34 12.93 7.96 12.88zm18.52-31.12v37.35c0 6.6-.5 17.45-19.31 17.57-7.75 0-14.94-3.05-16.38-9.83l10.25-1.65c.43 1.94 1.61 3.88 7.42 3.88 5.39 0 8-2.58 8-8.75v-4.59l-.14-.14c-1.65 2.94-4.16 5.74-10.19 5.74-9.19 0-16.44-6.38-16.44-19.72 0-13.19 7.47-20.57 15.86-20.58 7.87 0 10.79 3.57 11.46 5.46h-.12l.85-4.72zM255.75 206.79h-4.08v11.3h-2.16v-11.3h-4.08v-1.74h10.32zm17 11.3h-2.15V207.2h-.07l-4.27 10.89h-1.36l-4.27-10.89h-.06v10.89h-2.15v-13h3.32l3.89 9.9 3.83-9.9h3.29z" id="b"/></svg>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
|
+
<symbol id="check" viewBox="0 0 1000 1000" fill="currentColor">
|
|
3
|
+
<path d="M729.667 250 396.333 583.333l-125-125L188 541.667l125 125L396.333 750l83.334-83.333L813 333.333z"/>
|
|
4
|
+
</symbol>
|
|
5
|
+
<symbol id="ui-auto-mode" viewBox="0 0 1000 1000" fill="currentColor">
|
|
6
|
+
<path d="M500 75C265.3 75 75 265.5 75 500.5S265.3 926 500 926s425-190.5 425-425.5S734.7 75 500 75m0 775V150c192.6.9 350 157.5 350 350.5S692.6 849.1 500 850"/>
|
|
7
|
+
</symbol>
|
|
8
|
+
<symbol id="ui-dark-mode" viewBox="0 0 1000 1000" fill="currentColor">
|
|
9
|
+
<path d="M675 649.88c-179.493 0-325-145.57-325-325.141A324.478 324.478 0 0 1 465.721 76C247.03 93.463 75 276.537 75 499.815 75 734.638 265.279 925 500 925c223.181 0 406.175-172.106 423.63-390.891A324.222 324.222 0 0 1 675 649.88Z"/>
|
|
10
|
+
</symbol>
|
|
11
|
+
<symbol id="ui-light-mode" viewBox="0 0 1000 1000" fill="currentColor">
|
|
12
|
+
<path d="M287.868 712.132a25.073 25.073 0 0 0-35.355 0l-53.033 53.033a25 25 0 0 0 35.355 35.355l53.033-53.033a25.073 25.073 0 0 0 0-35.355Zm424.264-424.264a25.073 25.073 0 0 0 35.355 0l53.033-53.033a25 25 0 0 0-35.355-35.355l-53.033 53.033a25.073 25.073 0 0 0 0 35.355Zm35.355 424.264a25.073 25.073 0 0 0-35.355 0 25.073 25.073 0 0 0 0 35.355l53.033 53.033a25 25 0 0 0 35.355-35.355ZM252.513 287.868a25.073 25.073 0 0 0 35.355 0 25.073 25.073 0 0 0 0-35.355l-53.033-53.033a25 25 0 0 0-35.355 35.355ZM200 500a25.073 25.073 0 0 0-25-25h-75a25 25 0 0 0 0 50h75a25.073 25.073 0 0 0 25-25Zm700-25h-75a25 25 0 0 0 0 50h75a25 25 0 0 0 0-50ZM500 800a25.073 25.073 0 0 0-25 25v75a25 25 0 0 0 50 0v-75a25.073 25.073 0 0 0-25-25Zm0-600a25.073 25.073 0 0 0 25-25v-75a25 25 0 0 0-50 0v75a25.073 25.073 0 0 0 25 25Zm0 50c-138.071 0-250 111.929-250 250s111.929 250 250 250 250-111.929 250-250-111.929-250-250-250Z"/>
|
|
13
|
+
</symbol>
|
|
14
|
+
<symbol id="full-screen" viewBox="0 0 1000 1000" fill="currentColor">
|
|
15
|
+
<path d="M125,125V375h75V200H375V125H125Zm675,0H625v75H800V375h75V125H800Zm0,675H625v75H875V625H800V800ZM200,625H125V875H375V800H200V625Z" style="fill-rule:evenodd"/>
|
|
16
|
+
</symbol>
|
|
17
|
+
<symbol id="clock-white" viewBox="0 0 1000 1000" fill="currentColor">
|
|
18
|
+
<path d="M597.517,590.517 C590.484346,597.549917 580.945861,601.500991 571,601.500991 C561.054139,601.500991 551.515654,597.549917 544.483,590.517 L397.983,444.017 C397.962,443.995 397.943,443.973 397.922,443.952 C397.506667,443.534667 397.101667,443.108667 396.707,442.674 C396.507,442.449 396.312,442.218 396.114,441.99 C395.916,441.762 395.707,441.526 395.514,441.29 C395.275,440.998 395.048,440.7 394.814,440.404 C394.673,440.221 394.528,440.042 394.39,439.856 C394.147,439.529 393.916,439.197 393.685,438.864 C393.57,438.699 393.452,438.536 393.339,438.364 C393.109,438.022 392.892,437.675 392.674,437.327 C392.568,437.158 392.46,436.99 392.357,436.819 C392.151,436.478 391.957,436.133 391.763,435.786 C391.656,435.596 391.547,435.407 391.444,435.215 C391.27,434.889 391.104,434.56 390.944,434.23 C390.832,434.006 390.718,433.783 390.61,433.556 C390.468,433.256 390.333,432.95 390.199,432.645 C390.083,432.382 389.965,432.119 389.855,431.853 C389.745,431.587 389.637,431.308 389.532,431.034 C389.413,430.728 389.295,430.422 389.184,430.112 C389.099,429.873 389.02,429.632 388.94,429.392 C388.824,429.044 388.709,428.697 388.603,428.346 C388.539,428.133 388.481,427.919 388.421,427.706 C388.314,427.328 388.209,426.951 388.114,426.569 C388.065,426.369 388.022,426.169 387.975,425.969 C387.884,425.575 387.794,425.181 387.716,424.782 C387.675,424.582 387.643,424.373 387.606,424.169 C387.536,423.776 387.465,423.384 387.406,422.988 C387.371,422.751 387.346,422.514 387.316,422.277 C387.269,421.912 387.216,421.548 387.184,421.177 C387.153,420.863 387.135,420.548 387.112,420.234 C387.091,419.934 387.064,419.647 387.049,419.351 C387.019,418.733 387.002,418.115 387.002,417.497 L387.002,142.497 C387.002,121.786322 403.791322,104.997 424.502,104.997 C445.212678,104.997 462.002,121.786322 462.002,142.497 L462.002,401.967 L597.517,537.483 C604.549917,544.515654 608.500991,554.054139 608.500991,564 C608.500991,573.945861 604.549917,583.484346 597.517,590.517 L597.517,590.517 Z M425,0 C659.721,0 850,190.279 850,425 C850,659.721 659.721,850 425,850 C190.279,850 0,659.721 0,425 C0,190.279 190.279,0 425,0 Z M425,75 C231.7,75 75,231.7 75,425 C75,618.3 231.7,775 425,775 C618.3,775 775,618.3 775,425 C775,231.7 618.3,75 425,75 Z" transform="translate(75 75)"/>
|
|
19
|
+
</symbol>
|
|
20
|
+
</svg>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
|
|
3
|
+
* Copyright 2011-2024 The Bootstrap Authors
|
|
4
|
+
* Licensed under the Creative Commons Attribution 3.0 Unported License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
(() => {
|
|
8
|
+
'use strict'
|
|
9
|
+
|
|
10
|
+
const getStoredTheme = () => localStorage.getItem('theme')
|
|
11
|
+
const setStoredTheme = theme => localStorage.setItem('theme', theme)
|
|
12
|
+
|
|
13
|
+
const getPreferredTheme = () => {
|
|
14
|
+
const storedTheme = getStoredTheme()
|
|
15
|
+
if (storedTheme) {
|
|
16
|
+
return storedTheme
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const setTheme = theme => {
|
|
23
|
+
if (theme === 'auto') {
|
|
24
|
+
document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'))
|
|
25
|
+
} else {
|
|
26
|
+
document.documentElement.setAttribute('data-bs-theme', theme)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
setTheme(getPreferredTheme())
|
|
31
|
+
|
|
32
|
+
const showActiveTheme = (theme, focus = false) => {
|
|
33
|
+
const themeSwitcher = document.querySelector('#bd-theme')
|
|
34
|
+
|
|
35
|
+
if (!themeSwitcher) {
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const themeSwitcherText = document.querySelector('#bd-theme-text')
|
|
40
|
+
const activeThemeIcon = document.querySelector('.theme-icon-active use')
|
|
41
|
+
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`)
|
|
42
|
+
const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('xlink:href')
|
|
43
|
+
|
|
44
|
+
document.querySelectorAll('[data-bs-theme-value]').forEach(element => {
|
|
45
|
+
element.classList.remove('active')
|
|
46
|
+
element.setAttribute('aria-pressed', 'false')
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
btnToActive.classList.add('active')
|
|
50
|
+
btnToActive.setAttribute('aria-pressed', 'true')
|
|
51
|
+
activeThemeIcon.setAttribute('xlink:href', svgOfActiveBtn)
|
|
52
|
+
const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`
|
|
53
|
+
themeSwitcher.setAttribute('aria-label', themeSwitcherLabel)
|
|
54
|
+
|
|
55
|
+
if (focus) {
|
|
56
|
+
themeSwitcher.focus()
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
|
61
|
+
const storedTheme = getStoredTheme()
|
|
62
|
+
if (storedTheme !== 'light' && storedTheme !== 'dark') {
|
|
63
|
+
setTheme(getPreferredTheme())
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
window.addEventListener('DOMContentLoaded', () => {
|
|
68
|
+
showActiveTheme(getPreferredTheme())
|
|
69
|
+
|
|
70
|
+
document.querySelectorAll('[data-bs-theme-value]')
|
|
71
|
+
.forEach(toggle => {
|
|
72
|
+
toggle.addEventListener('click', () => {
|
|
73
|
+
const theme = toggle.getAttribute('data-bs-theme-value')
|
|
74
|
+
setStoredTheme(theme)
|
|
75
|
+
setTheme(theme)
|
|
76
|
+
showActiveTheme(theme, true)
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
})()
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
// Interface lang
|
|
5
|
+
function i18n(key) {
|
|
6
|
+
const translations = {
|
|
7
|
+
en: {
|
|
8
|
+
training: "Training",
|
|
9
|
+
previous: "Previous",
|
|
10
|
+
next: "Next"
|
|
11
|
+
},
|
|
12
|
+
fr: {
|
|
13
|
+
training: "Formation",
|
|
14
|
+
previous: "Précédente",
|
|
15
|
+
next: "Suivante"
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
return translations[document.documentElement.lang || 'en'][key] || key;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Observe section change
|
|
22
|
+
const observer = new IntersectionObserver(entries => {
|
|
23
|
+
entries.forEach(entry => {
|
|
24
|
+
if (entry.isIntersecting) {
|
|
25
|
+
let main_title = document.querySelector('section h1');
|
|
26
|
+
let section_title = entry.target.querySelector('h1') ? null : (function () {
|
|
27
|
+
for (let section = entry.target.previousElementSibling; section; section = section.previousElementSibling) {
|
|
28
|
+
if (section.querySelector('h1')) return section.querySelector('h1');
|
|
29
|
+
}
|
|
30
|
+
})();
|
|
31
|
+
|
|
32
|
+
// Change URL
|
|
33
|
+
if (location.hash !== `#${entry.target.id}`) history.replaceState(null, "", `#${entry.target.id}`);
|
|
34
|
+
|
|
35
|
+
// Change H1
|
|
36
|
+
document.querySelector('h1').innerText = entry.target === document.querySelector('section') ? i18n('training') : (section_title ? section_title.innerText : main_title.innerText);
|
|
37
|
+
|
|
38
|
+
// Change title
|
|
39
|
+
document.title = `${section_title ? `${main_title.innerText} - ${section_title.innerText}` : (entry.target === document.querySelector('section')) ? i18n('training') : main_title.innerText} - ${entry.target.querySelector('h1, h2, h3, h4, h5, h6')?.innerText || entry.target.id}`;
|
|
40
|
+
|
|
41
|
+
// Summary buils
|
|
42
|
+
document.querySelector('#summary .dropdown-menu').innerHTML = [...document.querySelectorAll('section h1')].map(heading => `
|
|
43
|
+
<li ${heading === (section_title || entry.target.querySelector('h1')) ? 'class="active"' : ''}><a class="dropdown-item d-flex align-items-center" href="#${heading.closest('section').id}">${heading.textContent}<svg class="ms-auto d-none" width="1em" height="1em"><use xlink:href="assets/images/slayder-sprites.svg#check"></use></svg></a></li>
|
|
44
|
+
`).join('');
|
|
45
|
+
|
|
46
|
+
// Pagination buid
|
|
47
|
+
const slides = [...document.querySelectorAll('section')].map(slide => slide.id);
|
|
48
|
+
const currentIndex = slides.indexOf(entry.target.id);
|
|
49
|
+
document.querySelector('#pagination .pagination').innerHTML = `
|
|
50
|
+
<li class="page-item ${currentIndex === 0 ? 'disabled' : ''}">
|
|
51
|
+
<a ${currentIndex > 0 ? `href="#${slides[currentIndex - 1]}"` : ''} class="page-link">${i18n('previous')}</a>
|
|
52
|
+
</li>
|
|
53
|
+
${slides.map((slide, index) => `
|
|
54
|
+
<li class="page-item ${currentIndex === index ? 'active' : ''}" ${currentIndex === index ? 'aria-current="page"' : ''}>
|
|
55
|
+
<a href="#${slide}" class="page-link">${index + 1}</a>
|
|
56
|
+
</li>
|
|
57
|
+
`).join('')}
|
|
58
|
+
<li class="page-item ${currentIndex === slides.length - 1 ? 'disabled' : ''}">
|
|
59
|
+
<a ${currentIndex < slides.length - 1 ? `href="#${slides[currentIndex + 1]}"` : ''} class="page-link">${i18n('next')}</a>
|
|
60
|
+
</li>
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}, { threshold: .5 });
|
|
65
|
+
document.querySelectorAll('section').forEach(section => observer.observe(section));
|
|
66
|
+
|
|
67
|
+
// Fullscreen enable
|
|
68
|
+
document.querySelector('#fullscreen').addEventListener('click', (event) => {
|
|
69
|
+
if (document.fullscreenElement) {
|
|
70
|
+
document.exitFullscreen();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
document.body.requestFullscreen();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Popovers init
|
|
77
|
+
const popoverList = [...document.querySelectorAll('[data-bs-toggle="popover"]')].map(popoverTriggerEl => new boosted.Popover(popoverTriggerEl));
|
|
78
|
+
|
|
79
|
+
// Quiz validation
|
|
80
|
+
document.querySelectorAll('.quiz').forEach(form => {
|
|
81
|
+
form.addEventListener('submit', event => {
|
|
82
|
+
const validateInput = () => {
|
|
83
|
+
form.querySelectorAll('input').forEach(input => {
|
|
84
|
+
input.classList.toggle('valid', input.checked === !!input.parentElement.querySelector(".badge"));
|
|
85
|
+
input.classList.toggle('invalid', input.checked !== !!input.parentElement.querySelector(".badge"));
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
validateInput();
|
|
90
|
+
form.addEventListener('change', () => validateInput());
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
form.classList.add('validated');
|
|
94
|
+
form.querySelector("button[type='submit']").disabled = true;
|
|
95
|
+
}, false);
|
|
96
|
+
});
|
|
97
|
+
})()
|
metadata
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: slayder-theme
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Christopher Abate
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2025-02-18 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: jekyll
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '4.0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '4.0'
|
|
27
|
+
description:
|
|
28
|
+
email:
|
|
29
|
+
- contact@christopherabate.com
|
|
30
|
+
executables: []
|
|
31
|
+
extensions: []
|
|
32
|
+
extra_rdoc_files: []
|
|
33
|
+
files:
|
|
34
|
+
- README.md
|
|
35
|
+
- assets/css/slayder.css
|
|
36
|
+
- assets/images/a11y.svg
|
|
37
|
+
- assets/images/devices.svg
|
|
38
|
+
- assets/images/orange-logo.svg
|
|
39
|
+
- assets/images/slayder-sprites.svg
|
|
40
|
+
- assets/js/colorModeToggler.js
|
|
41
|
+
- assets/js/slayder.js
|
|
42
|
+
homepage: https://github.com/christopherabate/slayder-theme
|
|
43
|
+
licenses:
|
|
44
|
+
- MIT
|
|
45
|
+
metadata: {}
|
|
46
|
+
post_install_message:
|
|
47
|
+
rdoc_options: []
|
|
48
|
+
require_paths:
|
|
49
|
+
- lib
|
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0'
|
|
60
|
+
requirements: []
|
|
61
|
+
rubygems_version: 3.3.27
|
|
62
|
+
signing_key:
|
|
63
|
+
specification_version: 4
|
|
64
|
+
summary: Custom Jekyll theme
|
|
65
|
+
test_files: []
|