Web/scripts/social.js

64 lines
1.5 KiB
JavaScript
Raw Normal View History

2018-07-24 22:45:53 +02:00
const socials = [{
2018-07-31 21:03:09 +02:00
'name': 'Email',
2018-12-30 02:26:56 +01:00
'link': 'mailto:me@ellpeck.de',
'darkIcon': true
2018-07-31 21:03:09 +02:00
},
{
2018-07-24 22:45:53 +02:00
'name': 'Discord',
'link': 'https://www.ellpeck.de/discord',
},
{
'name': 'Twitter',
'link': 'https://twitter.com/Ellpeck'
2018-12-30 02:26:56 +01:00
},
{
2018-09-24 19:52:27 +02:00
'name': 'GitHub',
2018-12-30 02:26:56 +01:00
'link': 'https://github.com/Ellpeck/',
'darkIcon': true
2018-07-24 22:45:53 +02:00
},
{
'name': 'YouTube',
'link': 'https://www.youtube.com/c/ellpeck'
},
{
'name': 'Twitch',
'link': 'http://twitch.tv/ellpeck'
},
{
'name': 'Reddit',
2018-12-30 02:26:56 +01:00
'link': 'https://www.reddit.com/user/Ellpeck/',
'darkIcon': true
2018-07-24 22:45:53 +02:00
},
{
'name': 'Instagram',
'link': 'https://instagram.com/Ellopecko'
},
{
'name': 'Spotify',
'link': 'https://open.spotify.com/user/ellpeck'
},
{
'name': 'Last.fm',
'link': 'https://www.last.fm/user/Ellpeck'
},
{
'name': 'Steam',
'link': 'http://steamcommunity.com/id/ellpeck/'
},
{
'name': 'Facebook',
'link': 'https://www.facebook.com/Ellpeck'
}
];
let s = '';
for (social of socials) {
2018-12-30 02:26:56 +01:00
s += '<a class="btn ' + (dark ? "btn-dark" : "btn-light") + ' social-button rounded-0" href="' + social['link'] + '"">';
let icon = social['name'].toLowerCase();
if (dark && social['darkIcon'])
icon += '_dark';
s += '<img class="social-image" src="res/social/' + icon + '.png" alt="">';
2018-08-01 20:22:48 +02:00
s += social['name'];
2018-07-24 22:45:53 +02:00
s += '</a>'
}
$('#social-list').html(s);