-
Notifications
You must be signed in to change notification settings - Fork 0
/
_right_column.html.twig
73 lines (68 loc) · 3.79 KB
/
_right_column.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{% set nav = [
['Getting Started', 'installation', true],
['Introduction', ''],
['Installation', 'installation'],
['Configuration', 'configuration'],
['Upgrade Guide', 'upgrade'],
['Cookbook', 'cookbook'],
['Theme', 'themes', true],
['Find a Theme', 'themes'],
['Customize the current theme or change the theme', '#'],
['Override the Current Theme', '#'],
['Create a new theme', '#'],
['Extensions', 'create-extension', true],
['Find an extension', 'extensions'],
['Customize your Pushword installation', '#'],
['Create an extension (and package it)', 'create-extension'],
['Contribute', 'contribute', true],
['Issues and Pull Request', 'contribute'],
['The Architecture', 'architecture'],
['Roadmap', 'roadmap'],
] %}
<div class="h-full">
<input type="checkbox" id="right-column" class="hidden">
<label for="right-column" id="right-column-toggler" class="fixed bottom-0 left-0 z-50 block w-12 h-12 p-3 m-2 cursor-pointer bg-primary hover:bg-primary-light">
<div class="relative flex flex-wrap content-center w-6 h-6">
<span class="block w-full h-1 border-b-2 border-gray-100"></span>
<span class="block w-full h-1 my-1 border-b-2 border-gray-100"></span>
<span class="block w-full h-1 border-b-2 border-gray-100"></span>
</div>
</label>
<div id="right-column-nav" class="sticky z-40 h-full px-3 mr-24 overflow-hidden text-sm bg-white border-r border-gray-200 w-60 lg:block lg:top-18 lg:mr-3 dark:bg-gray-900 dark:border-gray-700">
{% set heading_class = 'block px-3 mb-3 text-sm font-semibold tracking-wide text-gray-900 dark:text-gray-100 uppercase lg:mb-3 lg:text-xs mt-3' %}
{% set link_class = 'block px-3 py-2 transition-colors duration-200 relative hover:text-white hover:bg-primary-light text-gray-900 dark:text-gray-100 rounded' %}
{% for n in nav %}
{% set uri = n.1 == '#' ? '#' : page(n.1) %}
<a href="{{ uri }}" class="{{ n.2 is defined ? heading_class : link_class }} {{ n.2 is not defined and isCurrentPage(uri, page) ? ' bg-gray-200 dark:bg-gray-700' : '' }}">
{{ n.0 }}</a>
{% endfor %}
{{ link('<div style="display:inline-block;margin-bottom: -2px;"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-github" viewBox="0 0 16 16"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg></div> Source Code', 'https://github.com/Pushword/Pushword', link_class) }}
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
if (window.screen.width >= 1025) {
document.querySelector('#right-column').checked=true;
document.querySelector('#right-column-toggler').classList.add('lg:hidden');
}
});
</script>
<style>
#right-column:checked ~ label span:nth-child(1){
transform: rotate(45deg) translateY(0.2rem) translateX(0.1rem);
}
#right-column:checked ~ label span:nth-child(2){
border-color:transparent;
margin:0 !important;
}
#right-column:checked ~ label span:nth-child(3){
transform: rotate(-45deg) translateY(-0.3rem) translateX(0.1rem);
}
#right-column:not(:checked) ~ #right-column-nav {
height: 0 !important;
width: 0;
}
#right-column:checked ~ label {
left: 15rem;
}
</style>