From 98cf145270881567805b17652527a3c3bde2ac53 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Thu, 21 Dec 2017 22:32:01 +0100 Subject: [PATCH] Order icons alphabetically --- index.html | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index fda092f50..0ccc1be60 100644 --- a/index.html +++ b/index.html @@ -36,11 +36,13 @@ {% endcase %} {% unless forloop.last %}{% assign rgbString = rgbString | append: "," %}{% endunless %} {% endfor %} + {% assign rgbArray = rgbString | split: "," %} {% assign rgbRed = rgbArray[0] | times: 16 | plus: rgbArray[1] | divided_by: 255.0 | round: 2 %} {% assign rgbGreen = rgbArray[2] | times: 16 | plus: rgbArray[3] | divided_by: 255.0 | round: 2 %} {% assign rgbBlue = rgbArray[4] | times: 16 | plus: rgbArray[5] | divided_by: 255.0 | round: 2 %} {% assign rgbMax = 0.0 %} + {% if rgbRed > rgbMax %} {% assign rgbMax = rgbRed %} {% endif %} @@ -105,18 +107,17 @@ {% endif %} {% assign hslHue = hslHue | plus: 90.0 | modulo: 360.0 %} {% endif %} + {% if hslSaturation < 10 %} {% assign hslLuminance = hslLuminance | round: 0 | prepend: "000" | slice: -3, 3 %} - {% capture greyscaleIconsUnsortedString %}{{ greyscaleIconsUnsortedString }}{{ hslLuminance }},{{ filename }},{{ hslHue }},{{ hslSaturation }},{{ hex }},{{ title }},{{ class }}{% unless forloop.last %};{% endunless %}{% endcapture %} + {% capture greyscaleIconsUnsortedString %}{{ greyscaleIconsUnsortedString }}{{ hslLuminance }},{{ filename }},{{ hslHue }},{{ hslSaturation }},{{ hex }},{{ title }},{{ class }},{{ forloop.index }}{% unless forloop.last %};{% endunless %}{% endcapture %} {% else %} {% assign hslHue = hslHue | round: 0 | prepend: "000" | slice: -3, 3 %} - {% capture iconsUnsortedString %}{{ iconsUnsortedString }}{{ hslHue }},{{ hslSaturation }},{{ hslLuminance }},{{ filename }},{{ hex }},{{ title }},{{ class }}{% unless forloop.last %};{% endunless %}{% endcapture %} + {% capture iconsUnsortedString %}{{ iconsUnsortedString }}{{ hslHue }},{{ hslSaturation }},{{ hslLuminance }},{{ filename }},{{ hex }},{{ title }},{{ class }},{{ forloop.index }}{% unless forloop.last %};{% endunless %}{% endcapture %} {% endif %} {% endfor %} -{% assign iconsArray = iconsUnsortedString | split: ";" %} -{% assign iconsArray = iconsArray | sort %} -{% assign greyscaleIconsArray = greyscaleIconsUnsortedString | split: ";" %} -{% assign greyscaleIconsArray = greyscaleIconsArray | sort | reverse %} +{% assign iconsArray = iconsUnsortedString | split: ";" | sort %} +{% assign greyscaleIconsArray = greyscaleIconsUnsortedString | split: ";" | sort | reverse %} @@ -498,24 +499,24 @@ {% for icon in iconsArray %} {% assign iconArray = icon | split: "," %} -
  • +
  • {% assign filePath = iconArray[3] | prepend: "icons/" | append: ".svg" %} {% include_relative {{ filePath }} %}

    {{ iconArray[5] }}

    -

    #{{ iconArray[4] }}

    +

    #{{ iconArray[4] }} - {{ iconArray[7] }}

  • {% endfor %} {% for icon in greyscaleIconsArray %} {% assign iconArray = icon | split: "," %} -
  • +
  • {% assign filePath = iconArray[1] | prepend: "icons/" | append: ".svg" %} {% include_relative {{ filePath }} %}

    {{ iconArray[5] }}

    -

    #{{ iconArray[4] }}

    +

    #{{ iconArray[4] }} - {{ iconArray[7] }}

  • {% endfor %}