Jcink Re-order Awards

Set an order for awards to display regardless of when they were awarded

  1. FizzyElf
    To have awards in miniprofiles always appear in the same order for all users, include your awards in your Miniprofile or Main Profile HTML Template like this:
    Code:
    <div class='awards'><!-- |awards| --></div>
    and add this to the bottom of your board wrapper:
    Code:
    <style>
    .awards{display: flex; flex-wrap: wrap;}
    </style>
    <script>
    /* list of all award image file names in the order you want them to appear */
    const awardorder = ['staff.svg', 'start.svg', 'oneofus.svg', 'characters.svg'];
    
    $('.awards img').each(function() {
      let imgname = $(this).attr('src');
      let setorder = 999;
      imgname = imgname.substring(imgname.lastIndexOf('/')+1);
      if (awardorder.indexOf(imgname) != -1)
         setorder = awardorder.indexOf(imgname)
      $(this).css('order', setorder.toString());
    });
    </script>