permalink | title |
---|---|
/candidates |
Campaign Statements |
{% if site.campaign-2019.size == 0 %}
Hey, we just launched the election and are waiting for our first election statements. Interested in joining the race? {% else %}
Interested in joining the race? Here's how to get started.
{% assign candidates = site.campaign-2019 %}
{% endif %}
<script type="text/javascript"> document.addEventListener('DOMContentLoaded', function() { var cookieName = 'candidates'; var cookie = Cookies.getJSON(cookieName); var ul = document.querySelector('section.card-container'); var values = new Array(); for (var i = 0; i < ul.children.length; i++) { values.push(Math.random() * i | 0); } console.log(cookie); if (cookie != null && values.length == cookie.values.length) { /* reset if candidate lengths change */ values = cookie.values; } else { Cookies.set(cookieName, { values : values }, { expires: 1 /*days*/ }); } for(var i=0; i < values.length; i++) { ul.appendChild(ul.children[values[i] | 0]); } }, false); </script>