diff --git a/.dockerignore b/.dockerignore
index 7cdc52416..86dd99838 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -2,12 +2,6 @@
node_modules/
npm-debug.log
-# Jekyll
-_site/
-.sass-cache/
-.jekyll-cache/
-.jekyll-metadata
-
# Build files
icons/*.js
/index.js
diff --git a/.editorconfig b/.editorconfig
index 1645df351..2c3ac55a4 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -18,6 +18,3 @@ trim_trailing_whitespace=false # Templates with trailing whitespace are more usa
[_data/simple-icons.json]
indent_size=4
-
-[index.html]
-indent_size=4
diff --git a/.gitattributes b/.gitattributes
index 771bd59de..2714ea0c1 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -5,14 +5,7 @@
# Don't diff machine generated files
package-lock.json -diff
-Gemfile.lock -diff
slugs.md -diff
-# Treat images as binary
-*.ico binary
-*.png binary
-
# Don't export/archive these files
.github export-ignore
-.gitpod.yml export-ignore
-CNAME export-ignore
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 000000000..5de8ca4bd
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,4 @@
+contact_links:
+ - name: Website
+ about: Issues and improvements for the website
+ url: https://github.com/simple-icons/simple-icons-website/issues/new?assignees=&labels=&template=website.md
diff --git a/.github/ISSUE_TEMPLATE/website.md b/.github/ISSUE_TEMPLATE/website.md
deleted file mode 100644
index 97d1e9901..000000000
--- a/.github/ISSUE_TEMPLATE/website.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-name: Website
-about: Issues and improvements for the website
-labels: website
----
-
-
-
-
-### Kind of issue
- - [ ] Improvement
- - [ ] Bug
- - [ ] Other, namely:
-
-### Description
-
-
-
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
index 165311b5f..208c5c353 100644
--- a/.github/workflows/verify.yml
+++ b/.github/workflows/verify.yml
@@ -2,6 +2,20 @@ name: Verify Source
on: [pull_request, push]
jobs:
+ build:
+ name: Build package
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Use Node.js 12.x
+ uses: actions/setup-node@v2
+ with:
+ node-version: 12.x
+ - name: Install dependencies
+ run: npm ci
+ - name: Build NodeJS package
+ run: npm run build
lint:
name: Lint
runs-on: ubuntu-latest
@@ -20,20 +34,6 @@ jobs:
npm run svglint
npm run wslint
npm run our-lint
- build:
- name: Build website
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Use Ruby 2.7
- uses: ruby/setup-ruby@v1
- with:
- ruby-version: 2.7
- # https://github.com/ruby/setup-ruby/blob/master/README.md#caching-bundle-install-automatically
- bundler-cache: true
- - name: Build website
- run: bundle exec jekyll build
test:
name: Test package
runs-on: ubuntu-latest
diff --git a/.gitignore b/.gitignore
index bfb03d993..2c06d5e44 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,24 @@
-# Created by https://www.gitignore.io/api/macos,jekyll
+# Files generated by build script
+/index.js
+
+# Ignore all files in the icons folder
+icons/*
+# Except SVG files
+!icons/*.svg
+
+
+### NodeJS ###
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+lerna-debug.log*
+
+# Dependency directories
+node_modules/
-### Jekyll ###
-_site/
-.sass-cache/
-.jekyll-cache/
-.jekyll-metadata
### macOS ###
# General
@@ -33,21 +47,3 @@ Icon
Network Trash Folder
Temporary Items
.apdisk
-
-# End of https://www.gitignore.io/api/macos,jekyll
-
-
-# NPM dependencies
-node_modules/
-
-### Ruby ###
-/.bundle/
-/vendor/bundle
-
-# Files generated by build script
-/index.js
-
-# Ignore all files in the icons folder
-icons/*
-# Except SVG files
-!icons/*.svg
diff --git a/.gitpod.yml b/.gitpod.yml
deleted file mode 100644
index 04b0b104e..000000000
--- a/.gitpod.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-ports:
- - port: 4000
- onOpen: ignore
-tasks:
- - command: gp await-port 4000 && sleep 3 && gp preview $(gp url 4000)
- - init: gem install jekyll bundler
- command: jekyll serve --host 0.0.0.0
diff --git a/CNAME b/CNAME
deleted file mode 100644
index de53684e8..000000000
--- a/CNAME
+++ /dev/null
@@ -1 +0,0 @@
-simpleicons.org
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c7951f130..c42022e4a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -27,7 +27,6 @@ Simple Icons welcomes contributions and corrections. Before contributing, please
* [Requesting an Icon](#requesting-an-icon)
* [Adding or Updating an Icon](#adding-or-updating-an-icon)
-* [Building the Website](#building-locally)
* [Using Docker](#using-docker)
## Requesting an Icon
@@ -358,15 +357,6 @@ Once you've completed the previous steps, create a pull request to merge your ed
If you have an affiliation to the brand you contributing that allows you to speak on their behalf then please disclose that in your pull request as it can help speed up our research and review processes.
-## Building Website Locally
-
-* Make sure you have [Ruby](https://www.ruby-lang.org/en/downloads/) installed.
-* Make sure you have [Bundler](https://bundler.io/) installed (using `$ gem install bundler`).
-* Set your local gems installation location for the simple-icons website using `$ bundle config set path 'vendor/bundle'`.
-* Install dependencies using `$ bundle install`.
-* Build and run the website locally using `$ bundle exec jekyll serve`.
-* Connect to the website in your browser via the "Server address" provided by the output of this command, e.g. `http://localhost:4000/`
-
## Testing Package Locally
* Make sure you have [NodeJS](https://nodejs.org/en/download/) installed. At least version 12.4.0 is required.
@@ -374,12 +364,6 @@ If you have an affiliation to the brand you contributing that allows you to spea
* Build and test the package using `$ npm test`.
* Run the project linting process using `$ npm run lint`.
-## Building in Your Browser
-
-Alternatively, you can build and run the website in a readily configured online workspace:
-
-[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/simple-icons/simple-icons)
-
## Using Docker
You can build a Docker image for this project from the Dockerfile by running:
@@ -392,21 +376,6 @@ $ docker build . -t simple-icons
$ docker run -it --rm --entrypoint "/bin/ash" simple-icons
```
-### Jekyll Server using Docker
-
-To use a Docker container to run the Jekyll server for the website, run:
-
-```bash
-# Start a container running `jekyll serve` in the background
-$ docker run -d -p 4000:4000 --rm --volume $PWD:/srv/jekyll --name simple-icons-server jekyll/jekyll jekyll serve
-
-# Inspect the server logs
-$ docker logs simple-icons-server
-
-# Stop the server (and delete the container)
-$ docker stop simple-icons-server
-```
-
---
# Versioning
diff --git a/Gemfile b/Gemfile
deleted file mode 100644
index 8363d9983..000000000
--- a/Gemfile
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-gem "jekyll", "4.2"
diff --git a/Gemfile.lock b/Gemfile.lock
deleted file mode 100644
index f7878d24d..000000000
--- a/Gemfile.lock
+++ /dev/null
@@ -1,68 +0,0 @@
-GEM
- remote: https://rubygems.org/
- specs:
- addressable (2.7.0)
- public_suffix (>= 2.0.2, < 5.0)
- colorator (1.1.0)
- concurrent-ruby (1.1.7)
- em-websocket (0.5.2)
- eventmachine (>= 0.12.9)
- http_parser.rb (~> 0.6.0)
- eventmachine (1.2.7)
- ffi (1.14.1)
- forwardable-extended (2.6.0)
- http_parser.rb (0.6.0)
- i18n (1.8.5)
- concurrent-ruby (~> 1.0)
- jekyll (4.2.0)
- addressable (~> 2.4)
- colorator (~> 1.0)
- em-websocket (~> 0.5)
- i18n (~> 1.0)
- jekyll-sass-converter (~> 2.0)
- jekyll-watch (~> 2.0)
- kramdown (~> 2.3)
- kramdown-parser-gfm (~> 1.0)
- liquid (~> 4.0)
- mercenary (~> 0.4.0)
- pathutil (~> 0.9)
- rouge (~> 3.0)
- safe_yaml (~> 1.0)
- terminal-table (~> 2.0)
- jekyll-sass-converter (2.1.0)
- sassc (> 2.0.1, < 3.0)
- jekyll-watch (2.2.1)
- listen (~> 3.0)
- kramdown (2.3.1)
- rexml
- kramdown-parser-gfm (1.1.0)
- kramdown (~> 2.0)
- liquid (4.0.3)
- listen (3.3.3)
- rb-fsevent (~> 0.10, >= 0.10.3)
- rb-inotify (~> 0.9, >= 0.9.10)
- mercenary (0.4.0)
- pathutil (0.16.2)
- forwardable-extended (~> 2.6)
- public_suffix (4.0.6)
- rb-fsevent (0.10.4)
- rb-inotify (0.10.1)
- ffi (~> 1.0)
- rexml (3.2.5)
- rouge (3.26.0)
- safe_yaml (1.0.5)
- sassc (2.4.0)
- ffi (~> 1.9)
- terminal-table (2.0.0)
- unicode-display_width (~> 1.1, >= 1.1.1)
- unicode-display_width (1.7.0)
-
-PLATFORMS
- ruby
- x86_64-linux
-
-DEPENDENCIES
- jekyll (= 4.2)
-
-BUNDLED WITH
- 2.2.0
diff --git a/_config.yml b/_config.yml
deleted file mode 100644
index 3007b266b..000000000
--- a/_config.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-exclude:
- - tests
- - scripts
- - composer.json
- - CONTRIBUTING.md
- - Dockerfile
- - index.js
- - package-lock.json
- - package.json
- - README.md
diff --git a/images/apple-touch-icon.png b/images/apple-touch-icon.png
deleted file mode 100755
index 61df9e55d..000000000
Binary files a/images/apple-touch-icon.png and /dev/null differ
diff --git a/images/favicon.ico b/images/favicon.ico
deleted file mode 100755
index 8c437f2c2..000000000
Binary files a/images/favicon.ico and /dev/null differ
diff --git a/images/favicon.png b/images/favicon.png
deleted file mode 100755
index 61df9e55d..000000000
Binary files a/images/favicon.png and /dev/null differ
diff --git a/images/logo.svg b/images/logo.svg
deleted file mode 100755
index 0487afd3e..000000000
--- a/images/logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/images/og.png b/images/og.png
deleted file mode 100644
index 36e5a2ccd..000000000
Binary files a/images/og.png and /dev/null differ
diff --git a/index.html b/index.html
deleted file mode 100644
index 74fa52840..000000000
--- a/index.html
+++ /dev/null
@@ -1,264 +0,0 @@
----
----
-
-{%- assign iconCount = site.data.simple-icons.icons.size -%}
-{%- assign iconsUnsortedString = "" -%}
-{%- assign greyscaleIconsUnsortedString = "" -%}
-{%- for icon in site.data.simple-icons.icons -%}
- {% assign title = icon.title %}
-
- {% assign filename = icon.title %}
-
- {% assign filename = filename | downcase %}
- {% assign filename = filename | replace: "à", "a" | replace: "á", "a" | replace: "â", "a" | replace: "ã", "a" | replace: "ä", "a" | replace: "ā", "a" | replace: "ă", "a" | replace: "ą", "a" %}
- {% assign filename = filename | replace: "ç", "c" | replace: "ć", "c" | replace: "ĉ", "c" | replace: "ċ", "c" | replace: "č", "c" %}
- {% assign filename = filename | replace: "ď", "d" | replace: "đ", "d" %}
- {% assign filename = filename | replace: "è", "e" | replace: "é", "e" | replace: "ê", "e" | replace: "ë", "e" | replace: "ē", "e" | replace: "ĕ", "e" | replace: "ė", "e" | replace: "ę", "e" | replace: "ě", "e" %}
- {% assign filename = filename | replace: "ĝ", "g" | replace: "ğ", "g" | replace: "ġ", "g" | replace: "ģ", "g" %}
- {% assign filename = filename | replace: "ĥ", "h" | replace: "ħ", "h" %}
- {% assign filename = filename | replace: "ì", "i" | replace: "í", "i" | replace: "î", "i" | replace: "ï", "i" | replace: "ĩ", "i" | replace: "ī", "i" | replace: "ĭ", "i" | replace: "į", "i" | replace: "ı", "i" %}
- {% assign filename = filename | replace: "ĵ", "j" %}
- {% assign filename = filename | replace: "ķ", "k" | replace: "ĸ", "k" %}
- {% assign filename = filename | replace: "ĺ", "l" | replace: "ļ", "l" | replace: "ľ", "l" | replace: "ŀ", "l" | replace: "ł", "l" %}
- {% assign filename = filename | replace: "ñ", "n" | replace: "ń", "n" | replace: "ņ", "n" | replace: "ň", "n" %}
- {% assign filename = filename | replace: "ò", "o" | replace: "ó", "o" | replace: "ô", "o" | replace: "õ", "o" | replace: "ö", "o" | replace: "ō", "o" | replace: "ŏ", "o" | replace: "ő", "o" %}
- {% assign filename = filename | replace: "ŕ", "r" | replace: "ŗ", "r" | replace: "ř", "r" %}
- {% assign filename = filename | replace: "ś", "s" | replace: "ŝ", "s" | replace: "ş", "s" | replace: "š", "s" %}
- {% assign filename = filename | replace: "ß", "ss" %}
- {% assign filename = filename | replace: "ţ", "t" | replace: "ť", "t" | replace: "ŧ", "t" %}
- {% assign filename = filename | replace: "ù", "u" | replace: "ú", "u" | replace: "û", "u" | replace: "ü", "u" | replace: "ũ", "u" | replace: "ū", "u" | replace: "ŭ", "u" | replace: "ů", "u" | replace: "ű", "u" | replace: "ų", "u" %}
- {% assign filename = filename | replace: "ŵ", "w" %}
- {% assign filename = filename | replace: "ý", "y" | replace: "ÿ", "y" | replace: "ŷ", "y" %}
- {% assign filename = filename | replace: "ź", "z" | replace: "ż", "z" | replace: "ž", "z" %}
-
- {% assign searchTerm = filename %}
- {% assign filename = filename | replace: "+", "plus" %}
- {% assign filename = filename | replace: ".", "dot" %}
- {% assign filename = filename | replace: "&", "and" %}
- {% assign filename = filename | replace: " ", "" | replace: "-", "" | replace: "_", "" | replace: "!", "" | replace: ":", "" | replace: "’", "" | replace: "'", "" | replace: "°", "" %}
- {% if icon.slug %}
- {% assign filename = icon.slug %}
- {% endif %}
-
- {% assign hex = icon.hex %}
- {% assign hexCharacter1 = hex | slice: 0, 1 %}
- {% assign hexCharacter2 = hex | slice: 1, 1 %}
- {% assign hexCharacter3 = hex | slice: 2, 1 %}
- {% assign hexCharacter4 = hex | slice: 3, 1 %}
- {% assign hexCharacter5 = hex | slice: 4, 1 %}
- {% assign hexCharacter6 = hex | slice: 5, 1 %}
- {% capture hexCharacterString %}{{ hexCharacter1 }},{{ hexCharacter2 }},{{ hexCharacter3 }},{{ hexCharacter4 }},{{ hexCharacter5 }},{{ hexCharacter6 }}{% endcapture %}
- {% assign hexCharacterArray = hexCharacterString | split: "," %}
- {% assign rgbString = "" %}
- {% for hexCharacter in hexCharacterArray %}
- {% case hexCharacter %}
- {% when "A" %}
- {% assign rgbString = rgbString | append: "10" %}
- {% when "B" %}
- {% assign rgbString = rgbString | append: "11" %}
- {% when "C" %}
- {% assign rgbString = rgbString | append: "12" %}
- {% when "D" %}
- {% assign rgbString = rgbString | append: "13" %}
- {% when "E" %}
- {% assign rgbString = rgbString | append: "14" %}
- {% when "F" %}
- {% assign rgbString = rgbString | append: "15" %}
- {% else %}
- {% assign rgbString = rgbString | append: hexCharacter %}
- {% 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 %}
- {% if rgbGreen > rgbMax %}
- {% assign rgbMax = rgbGreen %}
- {% endif %}
- {% if rgbBlue > rgbMax %}
- {% assign rgbMax = rgbBlue %}
- {% endif %}
- {% assign rgbMin = 1.0 %}
- {% if rgbRed < rgbMin %}
- {% assign rgbMin = rgbRed %}
- {% endif %}
- {% if rgbGreen < rgbMin %}
- {% assign rgbMin = rgbGreen %}
- {% endif %}
- {% if rgbBlue < rgbMin %}
- {% assign rgbMin = rgbBlue %}
- {% endif %}
-
- {% assign redLuminance = rgbArray[0] | times: 16 | plus: rgbArray[1] | times: 0.299 | round: 0 %}
- {% assign greenLuminance = rgbArray[2] | times: 16 | plus: rgbArray[3] | times: 0.587 | round: 0 %}
- {% assign blueLuminance = rgbArray[4] | times: 16 | plus: rgbArray[5] | times: 0.114 | round: 0 %}
- {% assign luminance = redLuminance | plus: greenLuminance | plus: blueLuminance %}
- {% if luminance < 160 %}
- {% assign class = "grid-item--light" %}
- {% else %}
- {% assign class = "grid-item--dark" %}
- {% endif %}
-
- {% assign hslLuminance = rgbMax | plus: rgbMin | times: 50.0 %}
- {% assign rgbDelta = rgbMax | minus: rgbMin %}
- {% if rgbDelta == 0 %}
- {% assign hslHue = 0 %}
- {% assign hslSaturation = 0 %}
- {% else %}
- {% if hslLuminance < 0.5 %}
- {% assign rgbMaxPlusMin = rgbMax | plus: rgbMin %}
- {% assign hslSaturation = 100 | times: rgbDelta | divided_by: rgbMaxPlusMin %}
- {% else %}
- {% assign rgbTwoMinusMaxMinusMin = 2 | minus: rgbMax | minus: rgbMin %}
- {% assign hslSaturation = 100 | times: rgbDelta | divided_by: rgbTwoMinusMaxMinusMin %}
- {% endif %}
- {% if rgbMax == rgbRed %}
- {% assign hslHue = rgbGreen | minus: rgbBlue | divided_by: rgbDelta | times: 60.0 | modulo: 360.0 %}
- {% elsif rgbMax == rgbGreen %}
- {% assign hslHue = rgbBlue | minus: rgbRed | divided_by: rgbDelta | plus: 2.0 | times: 60.0 | modulo: 360.0 %}
- {% else %}
- {% assign hslHue = rgbRed | minus: rgbGreen | divided_by: rgbDelta | plus: 4.0 | times: 60.0 | modulo: 360.0 %}
- {% 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 }},{{ searchTerm }},{{ 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 }},{{ searchTerm }},{{ forloop.index }}{% unless forloop.last %};{% endunless %}{% endcapture %}
- {% endif %}
-{%- endfor -%}
-
-{%- assign iconsArray = iconsUnsortedString | split: ";" | sort -%}
-{%- assign greyscaleIconsArray = greyscaleIconsUnsortedString | split: ";" | sort | reverse -%}
-
-{%- assign allIconNames = "" -%}
-{%- for icon in iconsArray -%}
- {% assign iconArray = icon | split: "," %}
- {% capture allIconNames %}{{ allIconNames }}"{{ iconArray[7] }}",{% endcapture %}
-{%- endfor -%}
-{%- for icon in greyscaleIconsArray -%}
- {% assign iconArray = icon | split: "," %}
- {% capture allIconNames %}{{ allIconNames }}"{{ iconArray[7] }}"{% unless forloop.last %},{% endunless %}{% endcapture %}
-{%- endfor -%}
-
-
-
-
-
-
-
-
-
- Simple Icons
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ iconCount }} Free SVG icons for popular brands
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/site_script.js b/site_script.js
deleted file mode 100644
index 7b84772ae..000000000
--- a/site_script.js
+++ /dev/null
@@ -1,249 +0,0 @@
-(function(document) {
- var $body = document.body,
- $grid = document.querySelector('.grid'),
- $icons = $grid.querySelectorAll('.grid-item:not(.grid-item--ad)'),
- $search = document.querySelector('.search'),
- $searchClose = $search.querySelector('.search__close'),
- $searchInput = $search.querySelector('input'),
- $orderByColor = document.getElementById('sort-color'),
- $orderAlphabetically = document.getElementById('sort-alphabetically'),
- $orderByRelevance = document.getElementById('sort-relevance');
-
- var queryParameter = 'q',
- orderingPreferenceIdentifier = 'ordering-preference',
- previousQuery = '',
- previousOrdering = $orderByColor;
-
- // Remove the "disabled" attribute from the search input
- $searchInput.setAttribute('title', 'Search Simple Icons');
- $searchInput.removeAttribute('disabled');
- $searchInput.focus();
-
- // include a modified debounce underscorejs helper function.
- // see
- // - http://underscorejs.org/docs/underscore.html#section-83
- // - http://underscorejs.org/#debounce
- function debounce(func, wait, immediate) {
- var timeout, args, context, timestamp, result;
-
- var later = function() {
- var last = +new Date - timestamp;
-
- if (last < wait && last >= 0) {
- timeout = setTimeout(later, wait - last);
- } else {
- timeout = null;
- if (!immediate) {
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- }
- }
- };
-
- return function() {
- context = this;
- args = arguments;
- timestamp = +new Date;
- var callNow = immediate && !timeout;
- if (!timeout) timeout = setTimeout(later, wait);
- if (callNow) {
- result = func.apply(context, args);
- context = args = null;
- }
-
- return result;
- };
- }
-
- // Get a parameter from the URL's search section (location.search). Based on:
- // - https://davidwalsh.name/query-string-javascript
- // - https://github.com/WebReflection/url-search-params
- // - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping
- function getUrlParameter(parameter) {
- var name = parameter.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
- var regex = new RegExp('[\\?&]' + name + '=([^]*)');
- var results = regex.exec(location.search);
- return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
- }
-
- function normalizeSearchTerm(value) {
- return value.toLowerCase()
- .replace(/đ/g, "d")
- .replace(/ħ/g, "h")
- .replace(/ı/g, "i")
- .replace(/ĸ/g, "k")
- .replace(/ŀ/g, "l")
- .replace(/ł/g, "l")
- .replace(/ß/g, "ss")
- .replace(/ŧ/g, "t")
- .normalize("NFD")
- .replace(/[\u0300-\u036f]/g, "");
- }
-
- function search(value) {
- var query = normalizeSearchTerm(value)
- queryLetters = query.split('');
-
- var matchedIcons = icons.filter(function(iconName, iconIndex) {
- var element = $icons[iconIndex];
- var score = iconName.length - query.length;
- var index = 0;
-
- for (var i = 0; i < queryLetters.length; i++) {
- var letter = queryLetters[i];
- index = iconName.indexOf(letter, index);
-
- if (index === -1) {
- element.classList.add('hidden');
- return false;
- }
-
- score += index;
- index++;
- }
-
- element.style.setProperty("--order-relevance", score);
- element.classList.remove('hidden');
- return true;
- });
-
- $grid.classList.toggle('search__empty', matchedIcons.length == 0);
- $body.classList.toggle('search__active', matchedIcons.length < icons.length);
-
- if (query === '') {
- if ($body.classList.contains('order-by-relevance')) {
- selectOrdering(previousOrdering);
- }
- } else {
- if (previousQuery === '') {
- selectOrdering($orderByRelevance);
- }
- }
-
- previousQuery = query;
- }
- function selectOrdering(selected) {
- // Set the ordering type as a class on body
- $body.classList.remove('order-alphabetically', 'order-by-color', 'order-by-relevance');
- if (selected === $orderByColor) {
- $body.classList.add('order-by-color');
- } else if (selected === $orderAlphabetically) {
- $body.classList.add('order-alphabetically');
- } else if (selected === $orderByRelevance) {
- $body.classList.add('order-by-relevance');
- }
-
- // Store ordering preference
- var preferenceOptions = [$orderByColor, $orderAlphabetically];
- if (localStorage && preferenceOptions.includes(selected)) {
- localStorage.setItem(orderingPreferenceIdentifier, selected.id);
- }
- if (selected !== $orderByRelevance) {
- previousOrdering = selected;
- }
- }
-
- document.addEventListener('DOMContentLoaded', function() {
- // Restore ordering preference of the user. This should be performed before
- // applying the search query as it would overwrite "order by relevance"
- if (localStorage) {
- var storedOrderingId = localStorage.getItem(orderingPreferenceIdentifier);
- var ordering = document.getElementById(storedOrderingId);
- if (ordering) selectOrdering(ordering);
- }
-
- // Load search query if present
- var query = getUrlParameter(queryParameter);
- if (query) {
- $search.classList.add('search--active');
- $searchInput.value = query;
- search(query);
- }
- });
- $search.addEventListener('input', debounce(function(e) {
- e.preventDefault();
-
- var value = e.target.value;
- if (value) {
- $search.classList.add('search--active');
- window.history.replaceState(null, '', '?' + queryParameter + '=' + value);
- } else {
- $search.classList.remove('search--active');
- window.history.replaceState(null, '', '/');
- }
- search(value);
- }, 200), false);
- $searchClose.addEventListener('click', function(e) {
- e.stopPropagation();
-
- $searchInput.value = '';
- $search.classList.remove('search--active');
- window.history.replaceState(null, '', '/');
- search('');
- }, false);
-
- $orderByColor.addEventListener('click', function() {
- selectOrdering($orderByColor);
- });
- $orderAlphabetically.addEventListener('click', function() {
- selectOrdering($orderAlphabetically);
- });
- $orderByRelevance.addEventListener('click', function() {
- selectOrdering($orderByRelevance);
- });
-
- /* Redesign */
-
- var $banner = document.querySelector('.redesign-banner'),
- $redirectAutomatically = document.getElementById('redirect-to-redesign'),
- $hideOnce = document.getElementById('hide-feedback-request-once'),
- $hideAlways = document.getElementById('hide-feedback-request');
-
- var redesignUrl = 'https://simple-icons.github.io/simple-icons-website/',
- redesignRootDomain = 'simple-icons.github.io',
- hideBannerAlwaysIdentifier = 'hide-banner',
- redirectAutomaticallyIdentifier = 'redirect-to-redesign';
-
- $redirectAutomatically.addEventListener('click', function() {
- var redirect = true;
- if (localStorage) {
- var currentVal = localStorage.getItem(redirectAutomaticallyIdentifier);
- if (currentVal === 'true') {
- redirect = false;
- }
-
- localStorage.setItem(redirectAutomaticallyIdentifier, redirect);
- }
-
- if (redirect) {
- window.location.replace(redesignUrl);
- } else {
- $redirectAutomatically.innerHTML = "Redirect automatically";
- }
- });
- $hideOnce.addEventListener('click', function () {
- $banner.classList.add('hidden');
- });
- $hideAlways.addEventListener('click', function () {
- if (localStorage) {
- localStorage.setItem(hideBannerAlwaysIdentifier, true);
- }
-
- $banner.classList.add('hidden');
- });
-
- if (localStorage) {
- var redirect = localStorage.getItem(redirectAutomaticallyIdentifier);
- if (redirect === 'true') {
- $redirectAutomatically.innerHTML = "Disable redirect";
- if (document.referrer.split('/')[2] !== redesignRootDomain) {
- window.location.replace(redesignUrl);
- }
- }
-
- var hide = localStorage.getItem(hideBannerAlwaysIdentifier);
- if (hide) {
- $banner.classList.add('hidden');
- }
- }
-})( document );
diff --git a/stylesheet.css b/stylesheet.css
deleted file mode 100644
index b6bc2227b..000000000
--- a/stylesheet.css
+++ /dev/null
@@ -1,405 +0,0 @@
-* {
- box-sizing: border-box;
-}
-
-:root {
- font-size: 100%;
- height: 100%;
-}
-
-a {
- text-decoration: none;
-}
-
-abbr {
- text-decoration: none;
-}
-
-body {
- background-color: #FFFFFF;
- display: flex;
- flex-direction: column;
- color: #263238;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
- font-size: 0.875rem;
- height: 100%;
- line-height: 1.5rem;
- margin: 0;
-}
-
-svg {
- fill: currentColor;
- height: 1.5rem;
- width: 1.5rem;
-}
-
-#carbonads {
- height: 100%;
- width: 100%;
-}
-#carbonads a {
- color: #263238;
-}
-#carbonads > span {
- display: flex;
- flex-direction: column;
- height: 100%;
- justify-content: space-between;
-}
-
-.carbon-img {
- display: block;
- padding: 1rem 1rem 0.5rem;
-}
-
-.carbon-text {
- display: block;
- font-size: 0.75rem;
- line-height: 1rem;
- margin: 0 auto;
- max-width: 15rem;
-}
-
-.carbon-poweredby {
- font-size: 0.625rem;
- font-weight: 700;
- line-height: 1.5rem;
- opacity: 0.25;
- text-transform: uppercase;
-}
-
-.footer {
- background-color: #EEE;
- margin-top: auto;
- padding: 1.5rem;
-}
-@media (min-width: 45rem) {
- .footer {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 3rem;
- }
-}
-.footer a {
- color: #263238;
- text-decoration: underline;
-}
-.footer p {
- margin: 0;
- opacity: 0.5;
-}
-a.share-button {
- background-color: #1DA1F2;
- border-radius: 0.125rem;
- color: #FFF;
- display: block;
- margin: 0.75rem 0 0;
- padding: 0.75rem 1.5rem;
- text-align: center;
- text-decoration: none;
-}
-@media (min-width: 45rem) {
- a.share-button {
- margin: 0;
- }
-}
-
-.hero {
- font-size: 1.5rem;
- line-height: 2rem;
- margin: 0;
- padding: 3rem 1.5rem 1.5rem;
- text-align: center;
-}
-@media (min-width: 45rem) {
- .hero {
- padding: 4.5rem 3rem 1.5rem;
- }
-}
-
-.search {
- display: flex;
- align-items: center;
- margin: 1rem 1.5rem;
- text-align: center;
-}
-@media (min-width: 45rem) {
- .search {
- margin: 1rem 3rem;
- text-align: left;
- }
-}
-
-.search .search__wrapper {
- display: inline-block;
- position: relative;
-}
-.search .search__close {
- display: none;
- font-size: 1rem;
- padding: 6px 12px;
- position: absolute;
- right: 0;
- top: 1px;
-}
-.search .search__close span {
- cursor: pointer;
-}
-
-.search input {
- color: #333;
- font-size: 1rem;
- padding: 6px 12px;
-}
-@media (min-width: 45rem) {
- .search input {
- width: 250px;
- }
-}
-
-.search--active .search__close {
- display: block;
-}
-.search--active input {
- padding-right: 32px;
-}
-
-.sort-btn {
- cursor: pointer;
- margin-left: .5rem;
- opacity: .5;
-}
-.sort-btn:first-of-type {
- margin-left: 1rem;
-}
-
-.sort-btn:hover {
- opacity: 1;
-}
-.sort-btn:hover path:first-of-type {
- opacity: 0.8;
-}
-
-#sort-color:hover path:nth-of-type(2) {
- fill: #E57373;
-}
-#sort-color:hover path:nth-of-type(3) {
- fill: #F44336;
-}
-#sort-color:hover path:nth-of-type(4) {
- fill: #D32F2F;
-}
-#sort-color:hover path:nth-of-type(5) {
- fill: #B71C1C;
-}
-
-#sort-alphabetically:hover path:nth-of-type(2),
-#sort-alphabetically:hover path:nth-of-type(3) {
- opacity: 1;
-}
-
-#sort-relevance:hover path:not(:nth-of-type(1)) {
- fill: #fbc02d;
-}
-
-.grid {
- display: flex;
- flex-wrap: wrap;
- list-style: none;
- margin: 1.5rem;
- margin-top: 0;
- padding: 0;
-}
-@media (min-width: 45rem) {
- .grid {
- margin: 3rem;
- margin-top: 0;
- }
-}
-
-.grid > .grid-item--if-empty {
- display: none;
-}
-
-.grid.search__empty > .grid-item--if-empty {
- display: block;
- font-size: 1.25em;
- grid-column: span 3;
- line-height: 1.5em;
-}
-
-@supports (display: grid) {
- .grid {
- display: grid;
- grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
- grid-auto-rows: min-content;
- grid-column-gap: 0.375rem;
- grid-row-gap: 0.375rem;
- grid-auto-flow: dense;
- }
- .grid.search__empty:after {
- grid-column: 1/span 2;
- }
-
- @media (min-width: 30.75rem) {
- .grid.search__empty:after {
- grid-column: 1/-3;
- }
- }
-}
-
-.grid-item {
- background-color: #757575;
- display: flex;
- flex-direction: column;
- justify-content: center;
- padding: 1rem;
- text-align: center;
-}
-.grid-item--light {
- color: #FFF;
-}
-.grid-item--dark {
- color: #222;
-}
-@supports not (display: grid) {
- .grid-item {
- border: 0.1875rem solid #FFF;
- padding: 0 0 0.75rem;
- width: 20%;
- }
-}
-
-.grid-item--ad {
- background-color: #EEE;
- grid-column: -2 / -1;
- grid-row-end: span 2;
- height: auto;
-}
-@media (min-width: 21.75rem) {
- .grid-item--ad {
- grid-column: -3 / -1;
- }
-}
-@supports not (display: grid) {
- .grid-item--ad {
- width: 100%;
- }
-}
-
-.grid-item__link {
- color: inherit;
- display: block;
- text-align: center;
- width: 100%;
-}
-
-.grid-item__image {
- height: 1.5rem;
- width: 1.5rem;
-}
-
-.grid-item__title {
- font-size: 0.75rem;
- font-weight: 400;
- line-height: 1rem;
- margin: 0;
-}
-
-.grid-item__subtitle {
- font-size: 0.75rem;
- line-height: 1rem;
- margin: 0;
- opacity: 0.5;
-}
-
-.navbar {
- background-color: #263238;
-}
-
-.navbar__nav {
- display: flex;
- list-style: none;
- margin: 0;
- padding: 0;
-}
-@media (min-width: 45rem) {
- .navbar__nav {
- padding: 0 1.5rem;
- }
-}
-
-.navbar__nav-item a {
- color: #FFF;
- display: block;
- opacity: 0.5;
- padding: 1.5rem 0.375rem;
-}
-.navbar__nav-item a:focus, .navbar__nav-item a:hover {
- opacity: 1;
-}
-.navbar__nav-item:last-child a {
- padding: 1.5rem 1.5rem 1.5rem 0.375rem;
-}
-
-.navbar__nav-item--home {
- flex-grow: 1;
-}
-.navbar__nav-item--home a {
- opacity: 1;
- padding: 1.5rem 0 1.5rem 1.5rem;
-}
-
-.redesign-banner {
- background-color: #565f63;
- color: #FFF;
- margin: 0;
- padding: 0.5rem 1.5rem;
-}
-.redesign-banner a {
- color: #0096ee;
-}
-.redesign-banner a:focus, .redesign-banner a:hover,
-.redesign-banner button:focus, .redesign-banner button:hover {
- text-decoration: underline;
-}
-.redesign-banner span {
- float: right
-}
-.redesign-banner button {
- border: none;
- background-color: transparent;
- color: #0096ee;
- cursor: pointer;
- margin: 0;
- padding: 0;
-}
-
-.hidden {
- display: none;
-}
-
-body.order-by-color #sort-color {
- opacity: 1;
-}
-
-body.order-by-relevance .grid-item {
- order: var(--order-relevance);
-}
-
-body.order-by-relevance #sort-relevance {
- opacity: 1;
-}
-
-body.order-alphabetically .grid-item {
- order: var(--order-alpha);
-}
-
-body.order-alphabetically #sort-alphabetically {
- opacity: 1;
-}
-
-body:not(.search__active) #sort-relevance {
- display: none;
-}