mirror of
https://github.com/Mibew/simple-icons.git
synced 2024-11-17 19:04:13 +03:00
commit
7ba735c774
@ -602,8 +602,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Eventbrite",
|
"title": "Eventbrite",
|
||||||
"hex": "F6682F",
|
"hex": "F05537",
|
||||||
"source": "https://www.eventbrite.com"
|
"source": "https://www.eventbrite.com/signin/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Event Store",
|
"title": "Event Store",
|
||||||
|
@ -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 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "simple-icons",
|
"name": "simple-icons",
|
||||||
"version": "1.9.11",
|
"version": "1.9.12",
|
||||||
"description": "SVG icons for popular brands https://simpleicons.org",
|
"description": "SVG icons for popular brands https://simpleicons.org",
|
||||||
"homepage": "https://www.simpleicons.org",
|
"homepage": "https://www.simpleicons.org",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -4,13 +4,14 @@
|
|||||||
$search = document.querySelector('.search'),
|
$search = document.querySelector('.search'),
|
||||||
$searchClose = $search.querySelector('.search__close'),
|
$searchClose = $search.querySelector('.search__close'),
|
||||||
$searchInput = $search.querySelector('input'),
|
$searchInput = $search.querySelector('input'),
|
||||||
$sortColor = document.getElementById('sort-color'),
|
$orderByColor = document.getElementById('sort-color'),
|
||||||
$sortAlphabetically = document.getElementById('sort-alphabetically'),
|
$orderAlphabetically = document.getElementById('sort-alphabetically'),
|
||||||
$sortRelevance = document.getElementById('sort-relevance');
|
$orderByRelevance = document.getElementById('sort-relevance');
|
||||||
|
|
||||||
var queryParameter = 'q',
|
var queryParameter = 'q',
|
||||||
|
orderingPreferenceIdentifier = 'ordering-preference',
|
||||||
previousQuery = null,
|
previousQuery = null,
|
||||||
previousOrder = $sortColor;
|
previousOrdering = $orderByColor;
|
||||||
|
|
||||||
// Remove the "disabled" attribute from the search input
|
// Remove the "disabled" attribute from the search input
|
||||||
$searchInput.setAttribute('title', 'Search Simple Icons');
|
$searchInput.setAttribute('title', 'Search Simple Icons');
|
||||||
@ -108,47 +109,61 @@
|
|||||||
|
|
||||||
$grid.classList.toggle('search__empty', matchedIcons.length == 0);
|
$grid.classList.toggle('search__empty', matchedIcons.length == 0);
|
||||||
if (query === '') {
|
if (query === '') {
|
||||||
if ($sortRelevance.classList.contains('active')) {
|
if ($orderByRelevance.classList.contains('active')) {
|
||||||
selectSortingOrder(previousOrder);
|
selectOrdering(previousOrdering);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sortRelevance.setAttribute('display', 'none');
|
$orderByRelevance.setAttribute('display', 'none');
|
||||||
previousQuery = null;
|
previousQuery = null;
|
||||||
} else {
|
} else {
|
||||||
if (previousQuery === null) {
|
if (previousQuery === null) {
|
||||||
selectSortingOrder($sortRelevance);
|
selectOrdering($orderByRelevance);
|
||||||
}
|
}
|
||||||
|
|
||||||
previousQuery = query;
|
previousQuery = query;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function sort() {
|
function orderIcons() {
|
||||||
if ($sortColor.classList.contains('active')) {
|
if ($orderByColor.classList.contains('active')) {
|
||||||
$icons.forEach(icon => { icon.style.order = null; });
|
$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'); });
|
$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'); });
|
$icons.forEach(icon => { icon.style.order = icon.getAttribute('data-relevance'); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function selectSortingOrder(selected) {
|
function selectOrdering(selected) {
|
||||||
selected.classList.add('active');
|
selected.classList.add('active');
|
||||||
|
|
||||||
var options = [$sortColor, $sortAlphabetically, $sortRelevance];
|
var options = [$orderByColor, $orderAlphabetically, $orderByRelevance];
|
||||||
for (var option of options.filter(option => option !== selected)) {
|
for (var option of options.filter(option => option !== selected)) {
|
||||||
option.classList.remove('active');
|
option.classList.remove('active');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selected !== $sortRelevance) {
|
if (selected !== $orderByRelevance) {
|
||||||
previousOrder = selected;
|
previousOrdering = selected;
|
||||||
} else {
|
} 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() {
|
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
|
// Load search query if present
|
||||||
var query = getUrlParameter(queryParameter);
|
var query = getUrlParameter(queryParameter);
|
||||||
if (query) {
|
if (query) {
|
||||||
@ -179,13 +194,13 @@
|
|||||||
search('');
|
search('');
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
$sortColor.addEventListener('click', function() {
|
$orderByColor.addEventListener('click', function() {
|
||||||
selectSortingOrder($sortColor);
|
selectOrdering($orderByColor);
|
||||||
});
|
});
|
||||||
$sortAlphabetically.addEventListener('click', function() {
|
$orderAlphabetically.addEventListener('click', function() {
|
||||||
selectSortingOrder($sortAlphabetically);
|
selectOrdering($orderAlphabetically);
|
||||||
});
|
});
|
||||||
$sortRelevance.addEventListener('click', function() {
|
$orderByRelevance.addEventListener('click', function() {
|
||||||
selectSortingOrder($sortRelevance);
|
selectOrdering($orderByRelevance);
|
||||||
});
|
});
|
||||||
})( document );
|
})( document );
|
||||||
|
Loading…
Reference in New Issue
Block a user