👽 New API for generative icons, Re: #163
This commit is contained in:
@@ -3,4 +3,11 @@ import { hideFurnitureOn } from '@/utils/defaults';
|
||||
/* Returns false if page furniture should be hidden on said route */
|
||||
export const shouldBeVisible = (routeName) => !hideFurnitureOn.includes(routeName);
|
||||
|
||||
export const x = () => null;
|
||||
/* Very rudimentary hash function for generative icons */
|
||||
export const asciiHash = (input) => {
|
||||
const str = (!input || input.length === 0) ? Math.random().toString() : input;
|
||||
const reducer = (previousHash, char) => (previousHash || 0) + char.charCodeAt(0);
|
||||
const asciiSum = str.split('').reduce(reducer).toString();
|
||||
const shortened = asciiSum.slice(0, 30) + asciiSum.slice(asciiSum.length - 30);
|
||||
return window.btoa(shortened);
|
||||
};
|
||||
|
||||
@@ -173,10 +173,10 @@ module.exports = {
|
||||
fa: 'https://kit.fontawesome.com',
|
||||
mdi: 'https://cdn.jsdelivr.net/npm/@mdi/font@5.9.55/css/materialdesignicons.min.css',
|
||||
si: 'https://unpkg.com/simple-icons@v5/icons',
|
||||
generative: 'https://ipsicon.io',
|
||||
generative: 'https://avatars.dicebear.com/api/identicon/{icon}.svg',
|
||||
localPath: '/item-icons',
|
||||
faviconName: 'favicon.ico',
|
||||
homeLabIcons: 'https://raw.githubusercontent.com/WalkxCode/dashboard-icons/master/',
|
||||
homeLabIcons: 'https://raw.githubusercontent.com/WalkxCode/dashboard-icons/master/png/{icon}.png',
|
||||
},
|
||||
/* URLs for web search engines */
|
||||
searchEngineUrls: {
|
||||
|
||||
Reference in New Issue
Block a user