|
1 | 1 | {{#*inline "member"}} |
2 | | - <div class="w-100 w-25-l mb3 flex flex-row items-center"> |
| 2 | + <div class="person w-100 w-25-l mb3 flex flex-row items-center"> |
3 | 3 | <a class="mr4 w4 h4 flex-shrink-0" href="{{baseurl}}/governance/people/{{member.github}}"> |
4 | 4 | <img class="w-100 h-100 bg-white br2" |
5 | 5 | src="https://avatars.githubusercontent.com/{{member.github}}" |
|
20 | 20 | </section> |
21 | 21 |
|
22 | 22 | <section class="green" style="padding-bottom: 15px;"> |
23 | | - <div class="w-100 mw-none mw-8-m mw9-l flex flex-column flex-row-l flex-wrap-l center ph3"> |
| 23 | + <div id="people" class="w-100 mw-none mw-8-m mw9-l flex flex-column flex-row-l flex-wrap-l center ph3"> |
24 | 24 | {{#each data.people as |member|}} |
25 | 25 | {{> member member=member baseurl=../baseurl }} |
26 | 26 | {{/each}} |
27 | 27 | </div> |
28 | 28 | </section> |
29 | 29 |
|
30 | 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; |
| 37 | +
|
| 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--; |
| 43 | +
|
| 44 | + // And swap it with the current element. |
| 45 | + [array[currentIndex], array[randomIndex]] = [ |
| 46 | + array[randomIndex], array[currentIndex]]; |
| 47 | + } |
| 48 | + } |
| 49 | +
|
| 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> |
| 58 | +{{/inline}} |
31 | 59 | {{~> (lookup this "parent")~}} |
0 commit comments