social-icons-webfont
Version:
Icon font containing social media branding icons
579 lines (577 loc) • 20.5 kB
JavaScript
/* A polyfill for browsers that don't support ligatures. */
/* The script tag referring to this file must be placed before the ending body tag. */
/* To provide support for elements dynamically added, this script adds
method 'icomoonLiga' to the window object. You can pass element references to this method.
*/
(function () {
'use strict';
function supportsProperty(p) {
var prefixes = ['Webkit', 'Moz', 'O', 'ms'],
i,
div = document.createElement('div'),
ret = p in div.style;
if (!ret) {
p = p.charAt(0).toUpperCase() + p.substr(1);
for (i = 0; i < prefixes.length; i += 1) {
ret = prefixes[i] + p in div.style;
if (ret) {
break;
}
}
}
return ret;
}
var icons;
if (!supportsProperty('fontFeatureSettings')) {
icons = {
'4dopt': '',
'9gag': '',
'portfolio': '',
'adobeportfolio': '',
'afdian': '',
'airbnb': '',
'aliexpress': '',
'alibaba': '',
'allmylinks': '',
'alliance': '',
'amazon': '',
'amplement': '',
'android': '',
'angellist': '',
'angieslist': '',
'animaljam': '',
'animationframework': '',
'theanimationframework': '',
'animeplanet': '',
'anthroart': '',
'anthrodex': '',
'appnet': '',
'appstore': '',
'apple': '',
'archlinux': '',
'archiveofourown': '',
'archive': '',
'archive.org': '',
'archiveorg': '',
'artfight': '',
'arthaven': '',
'artstation': '',
'artconomy': '',
'artfol': '',
'artistree': '',
'ask': '',
'atabook': '',
'augment': '',
'avvo': '',
'backloggd': '',
'baidu': '',
'bale': '',
'bandcamp': '',
'barq': '',
'battlenet': '',
'bebee': '',
'beacons': '',
'beatport': '',
'bebo': '',
'behance': '',
'bigcartel': '',
'bing': '',
'bitbucket': '',
'blackberry': '',
'blingee': '',
'blizzard': '',
'blogger': '',
'bloglovin': '',
'bluesky': '',
'blue-sky': '',
'bonanza': '',
'bookbub': '',
'booking': '',
'boosty': '',
'buffer': '',
'bukkit': '',
'buymeacoffee': '',
'buzzly': '',
'buzzlyart': '',
'calendly': '',
'cara': '',
'carrd': '',
'cdbaby': '',
'characterhub': '',
'chickensmoothie': '',
'chrome': '',
'codepen': '',
'codeberg': '',
'coderwall': '',
'codered': '',
'cohost': '',
'collectorz': '',
'comicfury': '',
'commishes': '',
'craigslist': '',
'crunchbase': '',
'curiouscat': '',
'curse': '',
'dnaxcat': '',
'dailymotion': '',
'daz3d': '',
'debian': '',
'deezer': '',
'delicious': '',
'deviantart': '',
'diablo': '',
'dibujando': '',
'digg': '',
'digitalocean': '',
'digital-ocean': '',
'discord': '',
'displate': '',
'disqus': '',
'dlive': '',
'donorbox': '',
'doodle': '',
'douban': '',
'draugiem': '',
'dreamwidth': '',
'dribbble': '',
'dropbox': '',
'drupal': '',
'e-zbio': '',
'ezbio': '',
'ebay': '',
'eitaa': '',
'element': '',
'elementaryos': '',
'ello': '',
'endomodo': '',
'envato': '',
'epic': '',
'epicgames': '',
'escargot': '',
'etsy': '',
'facebook': '',
'fanfiction': '',
'fanbox': '',
'fandom': '',
'fanlore': '',
'fantia': '',
'fediverse': '',
'feedburner': '',
'fenrecs': '',
'filegarden': '',
'filmfreeway': '',
'filmweb': '',
'firefox': '',
'fiverr': '',
'flash': '',
'flattr': '',
'flickr': '',
'flightrising': '',
'flipboard': '',
'flipnote': '',
'flowcode': '',
'flowpage': '',
'forgejo': '',
'formulr': '',
'forrst': '',
'foursquare': '',
'freelancer': '',
'friendfeed': '',
'friendlycaptcha': '',
'fundable': '',
'furaffinity': '',
'furrynetwork': '',
'furrypaws': '',
'furry-paws': '',
'furtastic': '',
'furvilla': '',
'fyuse': '',
'gog': '',
'gaiaonline': '',
'gamefor': '',
'gamejolt': '',
'gamewisp': '',
'gamebanana': '',
'genius': '',
'ghost': '',
'git': '',
'github': '',
'gitea': '',
'gitlab': '',
'gitter': '',
'glaze': '',
'globalcomix': '',
'gnome': '',
'gofundme': '',
'gotomeeting': '',
'goatlings': '',
'gogs': '',
'goodreads': '',
'google': '',
'googlecalendar': '',
'googledrive': '',
'googlegroups': '',
'googlehangouts': '',
'googlemaps': '',
'googlephotos': '',
'googleplaymusic': '',
'googleplus': '',
'googlescholar': '',
'scholar': '',
'grooveshark': '',
'grundoscafe': '',
'guilded': '',
'gumroad': '',
'guru': '',
'gust': '',
'hackernews': '',
'hackerone': '',
'hackerrank': '',
'hearthstone': '',
'hellocoton': '',
'heroes': '',
'hipolink': '',
'homeadvisor': '',
'homefy': '',
'homes': '',
'horde': '',
'houzz': '',
'hypixel': '',
'imdb': '',
'ibispaint': '',
'icq': '',
'identica': '',
'imgur': '',
'indiedb': '',
'inkbunny': '',
'inkblot': '',
'inkitt': '',
'instagram': '',
'instructables': '',
'internet': '',
'invision': '',
'issuu': '',
'istock': '',
'itaku': '',
'itchio': '',
'itunes': '',
'jamendo': '',
'juxt': '',
'kakaotalk': '',
'keybase': '',
'kickstarter': '',
'kitsu': '',
'kofi': '',
'ko-fi': '',
'kobo': '',
'komimart': '',
'koo': '',
'lanyrd': '',
'lastfm': '',
'leprdspace': '',
'leprd.space': '',
'letterboxd': '',
'liberapay': '',
'line': '',
'link': '',
'linkstack': '',
'linkedin': '',
'linktree': '',
'linuxmint': '',
'lioden': '',
'livejournal': '',
'livemaster': '',
'logmein': '',
'loomly': '',
'lyft': '',
'mail': '',
'mailru': '',
'makeship': '',
'mastodon': '',
'matrix': '',
'mediawiki': '',
'medium': '',
'meetup': '',
'messenger': '',
'metapop': '',
'microsoft': '',
'minecraft': '',
'misskey': '',
'mix': '',
'mixer': '',
'mobcrush': '',
'moddb': '',
'modelmayhem': '',
'moderneopets': '',
'modernneopets': '',
'modrinth': '',
'mumble': '',
'myanimelist': '',
'myspace': '',
'nanowrimo': '',
'namemc': '',
'namicomi': '',
'napster': '',
'natgeo': '',
'naver': '',
'nekoweb': '',
'neocities': '',
'neopets': '',
'newgrounds': '',
'newsvine': '',
'nextdoor': '',
'nexus': '',
'nexusmods': '',
'niconico': '',
'nintendo': '',
'npm': '',
'nuzlockeforums': '',
'odnoklassniki': '',
'opencollective': '',
'opengameart': '',
'openworkbook': '',
'opera': '',
'origin': '',
'outlook': '',
'overwatch': '',
'pandora': '',
'paperdemon': '',
'papermc': '',
'patreon': '',
'paypal': '',
'periscope': '',
'persona': '',
'picarto': '',
'piczel': '',
'pillowfort': '',
'pinterest': '',
'pixilart': '',
'pixiv': '',
'plancke': '',
'play': '',
'playstation': '',
'player': '',
'plurk': '',
'pocket': '',
'polar': '',
'printables': '',
'pronounspage': '',
'pronounscc': '',
'pronouny': '',
'500px': '',
'qrcode': '',
'qobuz': '',
'qq': '',
'quora': '',
'quotev': '',
'rss': '',
'raidcall': '',
'rateyourmusic': '',
'ravelry': '',
'realtor': '',
'redbubble': '',
'reddit': '',
'redfin': '',
'refsheet': '',
'remote': '',
'renderosity': '',
'renren': '',
'rentry': '',
'researchgate': '',
'residentadvisor': '',
'retroachievements': '',
'retrospring': '',
'reverbnation': '',
'roblox': '',
'santae': '',
'scratch': '',
'seedrs': '',
'seenthis': '',
'session': '',
'sharepoint': '',
'sharethis': '',
'sheezyart': '',
'sheezy-art': '',
'sheezy': '',
'shopify': '',
'side7': '',
'signal': '',
'skeb': '',
'sketchfab': '',
'sketchersunited': '',
'skype': '',
'slack': '',
'slideshare': '',
'smashcast': '',
'smashwords': '',
'smugmug': '',
'snapchat': '',
'sofurry': '',
'society6': '',
'soloto': '',
'songkick': '',
'soroush': '',
'soundcloud': '',
'spacehey': '',
'spigot': '',
'spip': '',
'splice': '',
'sporcle': '',
'spotify': '',
'spreadshirt': '',
'squarespace': '',
'squidgeworld': '',
'stackexchange': '',
'stackoverflow': '',
'stage32': '',
'starcraft': '',
'stayfriends': '',
'steam': '',
'steamdb': '',
'stitcher': '',
'storehouse': '',
'storenvy': '',
'storygraph': '',
'strava': '',
'strawpage': '',
'streamjar': '',
'stripe': '',
'strudelcafe': '',
'strudel-cafe': '',
'stumbleupon': '',
'subeta': '',
'subscribestar': '',
'sudomemo': '',
'swarm': '',
'tapas': '',
'teamspeak': '',
'teamviewer': '',
'technic': '',
'technorati': '',
'teepublic': '',
'teespring': '',
'telegram': '',
'thingiverse': '',
'threads': '',
'threema': '',
'throne': '',
'tidal': '',
'tiddlywiki': '',
'tiktok': '',
'tinder': '',
'toneden': '',
'toptal': '',
'torial': '',
'toyhouse': '',
'8tracks': '',
'traxsource': '',
'trello': '',
'tripadvisor': '',
'tripit': '',
'triplej': '',
'trulia': '',
'tumblr': '',
'tunein': '',
'twitch': '',
'twitter': '',
'x-twitter': '',
'twitter-x': '',
'uber': '',
'ubuntu': '',
'udemy': '',
'unsplash': '',
'unvale': '',
'upwork': '',
'vgen': '',
'vrchat': '',
'vstream': '',
'ventrilo': '',
'viadeo': '',
'viber': '',
'viewbug': '',
'vimeo': '',
'vkontakte': '',
'vsco': '',
'warcraft': '',
'wattpad': '',
'wavebox': '',
'wechat': '',
'weasyl': '',
'webtoon': '',
'weibo': '',
'whatsapp': '',
'wickr': '',
'wikipedia': '',
'windguru': '',
'windows': '',
'wix': '',
'wordpress': '',
'worldanvil': '',
'wykop': '',
'theplatformformerlyknownastwitter': '',
'unicode-x': '',
'x': '',
'xbox': '',
'xing': '',
'ytgaming': '',
'yt-gaming': '',
'yahoo': '',
'yammer': '',
'yandex': '',
'yelp': '',
'yooco': '',
'younow': '',
'youtube': '',
'zapier': '',
'zazzle': '',
'zeniusivanisher': '',
'zenius-i-vanisher': '',
'zerply': '',
'zillow': '',
'zomato': '',
'zoom': '',
'zynga': '',
'box': '',
'jsr': '',
'lobsters': '',
'macos': '',
'mixcloud': '',
'onedev': '',
'recaptcha': '',
'captcha': '',
'sourcehut': '',
'0': 0
};
delete icons['0'];
window.icomoonLiga = function (els) {
var classes,
el,
i,
innerHTML,
key;
els = els || document.getElementsByTagName('*');
if (!els.length) {
els = [els];
}
for (i = 0; ; i += 1) {
el = els[i];
if (!el) {
break;
}
classes = el.className;
if (/social-icons/.test(classes)) {
innerHTML = el.innerHTML;
if (innerHTML && innerHTML.length > 1) {
for (key in icons) {
if (icons.hasOwnProperty(key)) {
innerHTML = innerHTML.replace(new RegExp(key, 'g'), icons[key]);
}
}
el.innerHTML = innerHTML;
}
}
}
};
window.icomoonLiga();
}
}());