Web/scripts/social.js
Ell ee5c7b64f0
All checks were successful
Web/pipeline/head This commit looks good
overhauled most of the script code
2021-03-19 07:55:18 +01:00

55 lines
No EOL
1.4 KiB
JavaScript

const socials = [{
name: 'Twitter',
link: 'https://twitter.com/Ellpeck'
},
{
name: 'GitHub',
link: 'https://github.com/Ellpeck/',
darkIcon: true
},
{
name: 'Twitch',
link: 'http://twitch.tv/ellpeck'
},
{
name: 'YouTube',
link: 'https://www.youtube.com/c/ellpeck'
},
{
name: "itch.io",
link: "https://ellpeck.itch.io/",
darkIcon: true
},
{
name: 'Instagram',
link: 'https://instagram.com/Ellopecko'
},
{
name: 'LinkedIn',
link: 'https://www.linkedin.com/in/ellpeck/'
},
{
name: 'Email',
link: 'mailto:me@ellpeck.de',
darkIcon: true
}
];
let s = '';
for (let social of socials) {
let icon = social.name.toLowerCase();
if (dark && social.darkIcon)
icon += '_dark';
s += /*html*/ `
<a class="btn ${dark ? "btn-dark" : "btn-light"} social-button rounded-0" href="${social.link}"">
<img class="social-image" src="res/social/${icon}.png" alt=""> ${social.name}
</a>
`;
}
$('#social-list').html(s);
let disc = $("#discord-div");
let theme = dark ? "dark" : "light";
disc.html( /*html*/ `
<iframe id="discord-widget" src="https://discordapp.com/widget?id=181435613147430913&theme=${theme}" width="300" height="450" allowtransparency="true" frameborder="0"></iframe>
`);