| for newline and drum roll + text edit for hostux

This commit is contained in:
reind33r 2021-11-30 21:58:34 +00:00
parent 75dc799599
commit a2abbf41a0
2 changed files with 44 additions and 14 deletions

View file

@ -1,4 +1,3 @@
<!doctype html>
<html>
<head>
@ -158,7 +157,28 @@
<p>No signup, no email, no bullshit. Just a straightforward <a href="https://github.com/arcanis/secretsanta">open-source</a> tool to help you generate your secret santa pairings. One static page, and that's it.</p>
<p>In the most common case (no exclusion rules, pair each guest with another at random), enter the name of your guests one line at a time. Once done, press "generate" and you're all set: send the generated links to your guests (by mail, chat, whatever floats your boat) and their pairing will be revealed to them (and only them) once they open the link.</p>
<h2>Where does this tool come from?</h2>
<p>I wanted to make a Secret Santa over Facebook without having to reveal to anyone my guests email addresses (so nothing that would require a backend). I also wanted not to know who was paired with me, so I had to find a way to somehow obfuscate the information. And being a developer, well, my first thought was "Let's AES it, for fun and profits!". Classic.</p>
<p>This tool has been forked from <a href="https://github.com/arcanis/secretsanta" target="_blank">arcanis/secretsanta</a>. It is self-hosted on <a href="https://hostux.fr" target="_blank">hostux.fr</a>.</p>
<h2>What about my privacy?</h2>
<p>There is no backend, i.e. no data stored on my server! The links that are generated contain all the encrypted information.</p>
<h2>How to use?</h2>
<pre># You can add a user by adding a line
Santa
# You can add some details if you want to, using parentheses after the name
Nicholas (the elf)
Nicholas (the elf|with a second line)
# You can prevent someone from being paired with someone else
Maël !Aurélie
Aurélie !Maël
You can also exclude someone from being paired with multiple people
Careful: too many exclusion rules can make your secret santa less interesting!
Rudolph !Santa !Nicholas (the elf)
You can also cheat a bit and force someone to be paired with another
Nicholas (the saint) =Nicholas (the elf)
...</pre>
</div>
</div>
@ -176,6 +196,7 @@
# You can add some details if you want to, using parentheses after the name
Nicholas (the elf)
Nicholas (the elf|with a second line)
# You can prevent someone from being paired with someone else
Maël !Aurélie

View file

@ -50,7 +50,7 @@
padding: 20px;
font-size: 10px;
font-size: 12px;
text-decoration: none;
color: #FFFFFF;
@ -103,6 +103,7 @@
}
#pairing-details {
margin-top: 20px;
margin-bottom: 20px;
font-size: 20px;
@ -134,7 +135,7 @@
var name = queryString.name;
var pairing = CryptoJS.AES.decrypt( queryString.pairing, queryString.key ).toString(CryptoJS.enc.Utf8);
var pairingDefinition = pairing.match( /^([^(]+)(?: (\([^)]+\)))?$/ );
var pairingDefinition = pairing.match( /^([^(]+)(?: \(([^)]+)\))?$/ );
</script>
@ -147,35 +148,43 @@
<div class="wrapper">
<div class="content">
<div class="title">Hi <span id="name"></span>! You've been paired with</div>
<div class="title">
Hej <span id="name"></span>!<br>
Your secret child is (drum roll<span id="drum-roll"></span>)
</div>
<script>document.getElementById('name').innerText = name</script>
<div class="pairing">
<div class="pairing" id="pairing-box">
<div id="pairing-name"></div>
<div id="pairing-details"></div>
<script>
document.getElementById('pairing-name').innerText = pairingDefinition[1];
if (pairingDefinition[2]) {
document.getElementById('pairing-details').innerText = pairingDefinition[2];
document.getElementById('pairing-details').innerHTML = pairingDefinition[2].replace(/\|/g, '<br>');
} else {
document.getElementById('pairing-details').style.display = 'none';
}
</script>
</div>
<div class="title">Good luck!</div>
<script>
if (queryString.extra) {
document.write('<iframe class="affiliate" src="http://rcm-eu.amazon-adsystem.com/e/cm?t=secrsant02e-21&o=8&p=48&l=ur1&category=books&banner=10DQAXJ7D1D2VTXMR682&f=ifr" width="728" height="90" scrolling="no" border="0" marginwidth="0" frameborder="0"></iframe>');
}
document.getElementById('pairing-box').style.color = 'white';
intervalId = window.setInterval(function() {
document.getElementById('drum-roll').innerText += '.';
}, 200);
window.setTimeout(function() {
document.getElementById('pairing-box').style.color = 'inherit';
clearInterval(intervalId);
}, 3000);
</script>
<div class="title">
May you bring them joy and happiness with your gift!
</div>
</div>
</div>
<a href="http://arcanis.github.io/secretsanta/" class="spirit-of-christmas">
<a href="https://louis.hostux.fr/secretsanta/" class="spirit-of-christmas">
Want to start your own Secret Santa with your friends? Click here to get started!
</a>