Commit fdcacb0f4a3fa929a428168cb57ab3b698917349

Authored by Rémi Emonet
1 parent f2aa222078
Exists in master

ind

Showing 1 changed file with 20 additions and 11 deletions

... ... @@ -14,14 +14,17 @@
14 14 body {display: inline-block;}
15 15 h1 {color: gray; margin-bottom: 2em;}
16 16 h2 {color: white; background: black; margin:0; margin-top: 120px;}
17   - a {display:inline-block; float: left; width: 165px; padding: 15px;}
18   - a {margin-left: 6px;}
19   - a:nth-child(4n+1) {margin-left:0;}
  17 +
  18 + a>a {flex: 1 1 auto; margin: 5px;}
  19 + a[href$=".pdf"] { box-shadow: black 2px 2px 2px; }
20 20 a {background: rgb(225, 73, 56); color: white; text-decoration: none; font-weight: bold;}
21   - a.proj {min-height: 65px;}
22   - a:hover {background: rgb(255, 127, 0);}
  21 +
  22 + div>a {display:flex; float: left; width: 165px; padding: 15px;}
  23 + div>a {margin-left: 6px;}
  24 + div>a:nth-child(4n+1) {margin-left:0;}
  25 + div>a.proj {min-height: 65px;}
  26 + div>a:hover {background: rgb(255, 127, 0);}
23 27 .outlined {outline: 1px solid black;}
24   - .pdf { box-shadow: blue 2px 2px 5px; }
25 28 .vil {
26 29 outline: 2px solid black;
27 30 }
28 31  
29 32  
... ... @@ -77,13 +80,19 @@
77 80 <script>
78 81 forEachInSelector("a[data-lesson]", function(e, i) {
79 82 var l = e.getAttribute("data-lesson");
80   - e.setAttribute("href", "lesson-"+l+".html");
  83 + var cont = document.createElement("a");
  84 + var parent = e.parentElement;
  85 + parent.replaceChild(cont, e);
  86 + cont.textContent = e.textContent;
  87 +
  88 + var html = e.cloneNode();
  89 + html.textContent = "[html]";
  90 + html.setAttribute("href", "lesson-"+l+".html");
  91 + cont.append(html)
81 92 var pdf = e.cloneNode();
82   - pdf.innerHTML = e.innerHTML + "<br/> (pdf)";
  93 + pdf.textContent = "[pdf]";
83 94 pdf.setAttribute("href", "lesson-"+l+".pdf");
84   - pdf.classList.add("pdf");
85   - e.parentElement.insertBefore(pdf, e);
86   - e.innerHTML += "<br/> ";
  95 + cont.append(pdf);
87 96 });
88 97 forEachInSelector("a", function(e, i) {
89 98 e.setAttribute("target", "_blank");