make support into scripts instead because it's cleaner yo

This commit is contained in:
Ellpeck 2018-08-13 21:20:37 +02:00
parent 38ca5d71de
commit 064c16f5f7
2 changed files with 32 additions and 15 deletions

View file

@ -118,22 +118,10 @@
<br>If you want, you can do so using one of the ways below. <br>If you want, you can do so using one of the ways below.
<br><em>Keep in mind that doing this is, of course, optional. I don't expect you to give me money for what I do, people appreciating it is already really awesome to me. Plus, if you want to, you can always support me by telling other people about me and my projects as well.</em> <br><em>Keep in mind that doing this is, of course, optional. I don't expect you to give me money for what I do, people appreciating it is already really awesome to me. Plus, if you want to, you can always support me by telling other people about me and my projects as well.</em>
</p> </p>
<div class="row align-items-center"> <div id="support-list">
<div class="col-md-auto"> <noscript><em>The content that should be here is dynamically generated. Please enable JavaScript if you see this.</em></noscript>
<a class="btn btn-light support-button rounded-0" href="https://patreon.com/Ellpeck"><img src="res/support/patreon.png" class="support-image" alt="">Support me on Patreon</a>
</div>
<div class="col">
Patreon is a great way of giving me money regularly. You automatically give me a set amount each month, and in return, you can get cool rewards like beta access to my game or visual fanciness for your Minecraft character when using my mods.
</div>
</div>
<div class="row align-items-center">
<div class="col-md-auto">
<a class="btn btn-light support-button rounded-0" href="https://paypal.me/Ellpeck"><img src="res/support/paypal.png" class="support-image" alt="">Donate with PayPal</a>
</div>
<div class="col">
If you prefer the idea of giving me some money as a one-time payment, using PayPal is probably your best bet. It's quick and easy, and it helps me out just the same way.
</div>
</div> </div>
<script src="scripts/support.js"></script>
</div> </div>
</div> </div>

29
scripts/support.js Normal file
View file

@ -0,0 +1,29 @@
const support = [{
'name': 'Support me on Patreon',
'desc': 'Patreon is a great way of giving me money regularly. You automatically give me a set amount each month, and in return, you can get cool rewards like beta access to my game or visual fanciness for your Minecraft character when using my mods.',
'link': 'https://patreon.com/Ellpeck',
'icon': 'patreon'
},
{
'name': 'Donate with PayPal',
'desc': 'If you prefer the idea of giving me some money as a one-time payment, using PayPal is probably your best bet. It\'s quick and easy, and it helps me out just the same way.',
'link': 'https://paypal.me/Ellpeck',
'icon': 'paypal'
}
];
let sp = '';
for (way of support) {
sp += '<div class="row align-items-center">';
sp += '<div class="col-md-auto">';
sp += '<a class="btn btn-light support-button rounded-0" href="' + way['link'] + '"><img src="res/support/' + way['icon'] + '.png" class="support-image" alt="">' + way['name'] + '</a>';
sp += '</div>';
sp += '<div class="col">';
sp += way['desc'];
sp += '</div>';
sp += '</div>';
}
$('#support-list').html(sp);