Skip to content

Commit 998d862

Browse files
authored
Merge pull request #284 from cinnamon-coder-hub/#283-rework-and-split-menu
#283: modified left and added right menu
2 parents 3dc008f + 8b92830 commit 998d862

File tree

6 files changed

+159
-4
lines changed

6 files changed

+159
-4
lines changed

asciidoctor-backend/erb/html5/document.html.erb

+2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ end
101101

102102
<script src="/website/components/header/search-engine/bundle.js"></script>
103103

104+
<script src="/website/shared/rightmenu.js"></script>
105+
104106
<!-- ************** Google analytics ************ -->
105107

106108
<!-- Global site tag (gtag.js) - Google Analytics -->

asciidoctor-stylesheet/sass/devonfw.scss

+103-4
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,116 @@ tr:nth-child(even) {
222222
}
223223
}
224224

225+
226+
227+
#content {
228+
max-width: 90em;
229+
padding-left: 1em;
230+
padding-right: 1em;
231+
232+
}
233+
225234
@media screen and (min-width: 768px) {
226235
.sect1 {
227236
padding-bottom: 3rem;
228237
}
229238
}
230239

231-
#content {
232-
max-width: 90em;
233-
padding-left: 1em;
234-
padding-right: 1em;
240+
@media only screen and (min-width: 1025px) {
241+
body.book.toc2.toc-left {
242+
display: grid;
243+
grid-template-rows: auto 0 40px 1fr auto;
244+
grid-template-columns: calc(90em * 0.01) calc(90em * 0.20) calc(90em * 0.52) calc(90em * 0.01) calc(90em * 0.25);
245+
padding-left: 0;
246+
}
247+
248+
body.book.toc2.toc-left .website-navbar {
249+
max-width: 100vw;
250+
grid-row-start: 1;
251+
grid-row-end: 2;
252+
grid-column-start: 1;
253+
grid-column-end: 7;
254+
}
255+
256+
body.book.toc2.toc-left #header > :nth-child(3) {
257+
grid-row-start: 3;
258+
position: relative;
259+
background-color: white;
260+
border: none;
261+
grid-column-start: 1;
262+
grid-column-end: 2;
263+
width: 66%;
264+
padding-right: 2rem;
265+
}
266+
267+
#toc .sectlevel1 > li > a::before { position: relative; top: 6px; content:url('/images/[email protected]');}
268+
#toc #actSectLev::before { content: var(--link-to-chevron); }
269+
270+
#toc.toc2 .sectlevel3 { padding-left: 2.5em; }
271+
272+
.sectlevel3 { max-width: 100%; top: 8.2%; position: fixed; left: 80%; margin-left: 3%; color: #555555; }
273+
.sectlevel3 li { margin: 9px 0 10px; }
274+
275+
276+
#toc .sectlevel3 .activeLine { color: #4cbdec;}
277+
278+
279+
body.book.toc2.toc-left #content {
280+
padding: 1.25em 1.75em 2em 0;
281+
}
282+
283+
#toc .sectlevel3 .activeLine::before {
284+
position: relative;
285+
content: '';
286+
display: inline-block;
287+
width: 3px;
288+
height: 32px;
289+
background: #4cbdec;
290+
top: 12px;
291+
left: -10px;
292+
margin-top: -20px;
293+
margin-right: -3px;
294+
}
295+
296+
#content-caption-li {
297+
font-size: 18px;
298+
margin-bottom: 30px;
299+
margin-left: -8.2px;
300+
}
301+
302+
#content-caption {
303+
font-weight: bold;
304+
}
305+
306+
.sectlevel2 > li > a {
307+
margin-left: 8px;
308+
}
309+
body.book.toc2.toc-left #footer {
310+
max-width: 100vw;
311+
margin-left: 0;
312+
grid-row-start: 5;
313+
grid-column-start: 1;
314+
grid-column-end: 7;
315+
}
316+
317+
.footnote {
318+
grid-row-start: 6;
319+
grid-column-start: 2;
320+
grid-row-end: 7;
321+
grid-column-end: 3;
322+
}
323+
324+
}
325+
326+
#content h3, h4 { color: #23576e; }
327+
#content p { color: #555555; }
328+
329+
.toc-root {
330+
display: none
331+
}
235332

333+
h3 {
334+
font-weight: bold;
236335
}
237336

238337
.white-button-overlay {

website/images/[email protected]

342 Bytes
Loading

website/images/[email protected]

371 Bytes
Loading

website/shared/editlinks.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const editLinksModule = (function(window) {
22
// Function definitions
33

4+
45
function executeRules(rules) {
56
let result;
67
let path = $("li").has(".sectlevel1").has(".toc-current").find("a").first().attr("href") || window.location.pathname;

website/shared/rightmenu.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
document.addEventListener("DOMContentLoaded", function(event) {
2+
3+
document.querySelector('.sectlevel2').previousElementSibling.setAttribute("id", "actSectLev");
4+
document.getElementById("actSectLev").setAttribute("style","--link-to-chevron: url('/images/[email protected]')");
5+
6+
7+
let sections = document.querySelectorAll(".sectlevel3 a");
8+
9+
let sectHref = sections[0].getAttribute('href');
10+
sectHref = sectHref.split("#").pop();
11+
12+
13+
let sectId = document.querySelectorAll(".sect3 h4");
14+
15+
sections = sectId;
16+
17+
//include li-a-tag for Content headline over right menu
18+
document.getElementsByClassName('sectlevel3')[0].innerHTML += '<li id="content-caption-li"> <a id="content-caption" class="" href="">Content</a> </li>';
19+
20+
document.getElementsByClassName('sectlevel3')[0].prepend(document.getElementById('content-caption-li'))
21+
22+
const sectlevA = document.querySelectorAll('.sectlevel3 li a');
23+
let flag = 0;
24+
25+
window.addEventListener('scroll', ()=> {
26+
let current = '';
27+
28+
sections.forEach( section => {
29+
const sectionTop = section.offsetTop;
30+
if( scrollY >= sectionTop)
31+
{
32+
current = section.getAttribute('id');
33+
}
34+
})
35+
36+
//adding id to current sectlevel3-heading element on the right sight
37+
sectlevA.forEach( a => {
38+
if(a.getAttribute('id') != 'content-caption')
39+
{
40+
a.classList.remove('activeLine');
41+
flag = 0;
42+
if(a.getAttribute('href').split("#").pop() == current)
43+
{
44+
document.getElementsByClassName('activeLine');
45+
a.classList.add('activeLine');
46+
flag = 1;
47+
}
48+
}
49+
50+
})
51+
})
52+
53+
})

0 commit comments

Comments
 (0)