|
25 | 25 | {{> member member=member baseurl=../baseurl }} |
26 | 26 | {{/each}} |
27 | 27 | </div> |
28 | | - </section> |
29 | | - |
30 | | -{{/inline}} |
31 | | - |
32 | | -{{#*inline "script"}} |
33 | | -<script type="text/javascript"> |
34 | | - // From https://stackoverflow.com/a/2450976/1107768 |
35 | | - function shuffle(array) { |
36 | | - let currentIndex = array.length; |
| 28 | + <script type="text/javascript"> |
| 29 | + // From https://stackoverflow.com/a/2450976/1107768 |
| 30 | + function shuffle(array) { |
| 31 | + let currentIndex = array.length; |
37 | 32 |
|
38 | | - // While there remain elements to shuffle... |
39 | | - while (currentIndex !== 0) { |
40 | | - // Pick a remaining element... |
41 | | - let randomIndex = Math.floor(Math.random() * currentIndex); |
42 | | - currentIndex--; |
| 33 | + // While there remain elements to shuffle... |
| 34 | + while (currentIndex !== 0) { |
| 35 | + // Pick a remaining element... |
| 36 | + let randomIndex = Math.floor(Math.random() * currentIndex); |
| 37 | + currentIndex--; |
43 | 38 |
|
44 | | - // And swap it with the current element. |
45 | | - [array[currentIndex], array[randomIndex]] = [ |
46 | | - array[randomIndex], array[currentIndex]]; |
| 39 | + // And swap it with the current element. |
| 40 | + [array[currentIndex], array[randomIndex]] = [ |
| 41 | + array[randomIndex], array[currentIndex]]; |
| 42 | + } |
47 | 43 | } |
48 | | - } |
49 | 44 |
|
50 | | - document.addEventListener("DOMContentLoaded", () => { |
51 | | - // Shuffle people to reduce ordering bias |
52 | | - const wrapper = document.querySelector("#people"); |
53 | | - const children = Array(...wrapper.children); |
54 | | - shuffle(children); |
55 | | - wrapper.replaceChildren(...children); |
56 | | - }); |
57 | | -</script> |
| 45 | + document.addEventListener("DOMContentLoaded", () => { |
| 46 | + // Shuffle people to reduce ordering bias |
| 47 | + const wrapper = document.querySelector("#people"); |
| 48 | + const children = Array(...wrapper.children); |
| 49 | + shuffle(children); |
| 50 | + wrapper.replaceChildren(...children); |
| 51 | + }); |
| 52 | + </script> |
| 53 | + </section> |
| 54 | + |
58 | 55 | {{/inline}} |
| 56 | + |
59 | 57 | {{~> (lookup this "parent")~}} |
0 commit comments