Merge pull request #1057 from simple-icons/develop

Publish Eventbrite
This commit is contained in:
Johan Fagerberg 2018-11-05 19:13:40 +01:00 committed by GitHub
commit 7ba735c774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 33 deletions

View File

@ -602,8 +602,8 @@
},
{
"title": "Eventbrite",
"hex": "F6682F",
"source": "https://www.eventbrite.com"
"hex": "F05537",
"source": "https://www.eventbrite.com/signin/"
},
{
"title": "Event Store",

View File

@ -1 +1 @@
<svg aria-labelledby="simpleicons-eventbrite-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-eventbrite-icon">Eventbrite icon</title><path d="M8.128 0h11.011c.176 0 .264.09.264.267v4.124c0 .18-.09.267-.264.267H9.422c-.177 0-.265.09-.265.27v4.491c.045.18.135.27.266.27h8.617c.179 0 .269.09.269.27v3.982c0 .18-.09.27-.269.27H9.429c-.134 0-.221.09-.266.27V19c0 .179.09.269.265.269h10.046c.135 0 .224.075.27.21.06.225.104.494.119.837.015.346-.015.72-.119 1.154-.104.434-.285.837-.54 1.197-.254.374-.673.689-1.242.944-.585.254-1.288.389-2.096.389H4.399c-.178 0-.266-.091-.266-.269V3.997c0-1.107.389-2.052 1.164-2.829C6.076.389 7.017 0 8.128 0z"/></svg>
<svg aria-labelledby="simpleicons-eventbrite-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-eventbrite-icon">Eventbrite icon</title><path d="M10.5 5.8c2.7-.6 5.3.5 6.8 2.5L5.6 11c.4-2.5 2.3-4.6 4.9-5.2zm6.9 9.8c-.9 1.3-2.3 2.3-3.9 2.6-2.7.6-5.3-.5-6.8-2.6L18.4 13l1.9-.4 3.7-.8c0-.8-.1-1.6-.3-2.3C22.2 3 15.8-.9 9.3.6S-1.2 8.4.3 14.7 8.2 25 14.7 23.5c3.8-.9 6.8-3.4 8.2-6.6.1-.1-5.5-1.3-5.5-1.3z"/></svg>

Before

Width:  |  Height:  |  Size: 694 B

After

Width:  |  Height:  |  Size: 452 B

View File

@ -1,6 +1,6 @@
{
"name": "simple-icons",
"version": "1.9.11",
"version": "1.9.12",
"description": "SVG icons for popular brands https://simpleicons.org",
"homepage": "https://www.simpleicons.org",
"keywords": [

View File

@ -4,13 +4,14 @@
$search = document.querySelector('.search'),
$searchClose = $search.querySelector('.search__close'),
$searchInput = $search.querySelector('input'),
$sortColor = document.getElementById('sort-color'),
$sortAlphabetically = document.getElementById('sort-alphabetically'),
$sortRelevance = document.getElementById('sort-relevance');
$orderByColor = document.getElementById('sort-color'),
$orderAlphabetically = document.getElementById('sort-alphabetically'),
$orderByRelevance = document.getElementById('sort-relevance');
var queryParameter = 'q',
orderingPreferenceIdentifier = 'ordering-preference',
previousQuery = null,
previousOrder = $sortColor;
previousOrdering = $orderByColor;
// Remove the "disabled" attribute from the search input
$searchInput.setAttribute('title', 'Search Simple Icons');
@ -108,47 +109,61 @@
$grid.classList.toggle('search__empty', matchedIcons.length == 0);
if (query === '') {
if ($sortRelevance.classList.contains('active')) {
selectSortingOrder(previousOrder);
if ($orderByRelevance.classList.contains('active')) {
selectOrdering(previousOrdering);
}
$sortRelevance.setAttribute('display', 'none');
$orderByRelevance.setAttribute('display', 'none');
previousQuery = null;
} else {
if (previousQuery === null) {
selectSortingOrder($sortRelevance);
selectOrdering($orderByRelevance);
}
previousQuery = query;
}
}
function sort() {
if ($sortColor.classList.contains('active')) {
function orderIcons() {
if ($orderByColor.classList.contains('active')) {
$icons.forEach(icon => { icon.style.order = null; });
} else if ($sortAlphabetically.classList.contains('active')) {
} else if ($orderAlphabetically.classList.contains('active')) {
$icons.forEach(icon => { icon.style.order = icon.getAttribute('order'); });
} else if ($sortRelevance.classList.contains('active')) {
} else if ($orderByRelevance.classList.contains('active')) {
$icons.forEach(icon => { icon.style.order = icon.getAttribute('data-relevance'); });
}
}
function selectSortingOrder(selected) {
function selectOrdering(selected) {
selected.classList.add('active');
var options = [$sortColor, $sortAlphabetically, $sortRelevance];
var options = [$orderByColor, $orderAlphabetically, $orderByRelevance];
for (var option of options.filter(option => option !== selected)) {
option.classList.remove('active');
}
if (selected !== $sortRelevance) {
previousOrder = selected;
if (selected !== $orderByRelevance) {
previousOrdering = selected;
} else {
$sortRelevance.removeAttribute('display');
$orderByRelevance.removeAttribute('display');
}
sort();
orderIcons();
// Store ordering preference
var preferenceOptions = [$orderByColor, $orderAlphabetically];
if (localStorage && preferenceOptions.includes(selected)) {
localStorage.setItem(orderingPreferenceIdentifier, selected.id);
}
}
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) {
@ -179,13 +194,13 @@
search('');
}, false);
$sortColor.addEventListener('click', function() {
selectSortingOrder($sortColor);
$orderByColor.addEventListener('click', function() {
selectOrdering($orderByColor);
});
$sortAlphabetically.addEventListener('click', function() {
selectSortingOrder($sortAlphabetically);
$orderAlphabetically.addEventListener('click', function() {
selectOrdering($orderAlphabetically);
});
$sortRelevance.addEventListener('click', function() {
selectSortingOrder($sortRelevance);
$orderByRelevance.addEventListener('click', function() {
selectOrdering($orderByRelevance);
});
})( document );