Commit 87c8edaf55ad852f9bb5019a49b3ce146a3484b6

Authored by Rémi Emonet
1 parent 6429bca3a5
Exists in master

push centering

Showing 1 changed file with 13 additions and 5 deletions

... ... @@ -18,9 +18,12 @@
18 18 body>div>* {text-align: center; vertical-align: middle;}
19 19  
20 20  
21   - .tile {margin-top: 5px; min-height: 2.3em;}
  21 + .tile {margin-top: 5px; min-height: 2.3em;align-items: center;}
22 22 .tile>a {flex: 1 1 auto; }
23 23 .tile>a {margin: 2px; }
  24 + .tile>.side {display: flex; flex-direction: column;}
  25 + .tile>.side>a {margin: 3px 0 0;}
  26 + .tile>p {flex-grow: 1; margin: 0 2px 0 0;}
24 27 a[href$=".pdf"] { box-shadow: black 2px 2px 2px; }
25 28 a[href$=".zip"] { box-shadow: darkred 2px 2px 2px; }
26 29 a, .tile {background: rgb(225, 73, 56); color: white; text-decoration: none; font-weight: bold;}
27 30  
28 31  
29 32  
... ... @@ -143,21 +146,26 @@
143 146 var parent = e.parentElement;
144 147 parent.replaceChild(cont, e);
145 148 cont.classList.add("tile");
146   - cont.textContent = e.textContent;
  149 + var txt = document.createElement("p");
  150 + txt.textContent = e.textContent;
  151 + cont.appendChild(txt);
  152 + var side = document.createElement("div");
  153 + side.classList.add('side');
  154 + cont.appendChild(side);
147 155  
148 156 var html = document.createElement("a");
149 157 html.textContent = "[html]";
150 158 html.setAttribute("href", "cours-"+l+".html");
151   - cont.appendChild(html)
  159 + side.appendChild(html)
152 160 var pdf = document.createElement("a");
153 161 pdf.textContent = "[pdf]";
154 162 pdf.setAttribute("href", "export-cours-"+l+".pdf");
155   - cont.appendChild(pdf);
  163 + side.appendChild(pdf);
156 164 if (e.getAttribute("data-hascode")) {
157 165 var code = document.createElement("a");
158 166 code.textContent = "[src]";
159 167 code.setAttribute("href", "raw/cours-"+l+".zip");
160   - cont.appendChild(code);
  168 + side.appendChild(code);
161 169 }
162 170 });
163 171 forEachInSelector("a", function(e, i) {