Prevent refreshing having influence on the card

master
Kuba Orlik 3 years ago
parent e473c4dce3
commit 1d4e35cee4

@ -36,18 +36,25 @@ module.exports = function (id, card) {
} }
</style> </style>
<img id="track" style="opacity:0" /> <img id="track" style="opacity:0" />
<script>
track.src = \`/track?id=${id}&DNT=\${navigator.doNotTrack}&lang=\${
navigator.language
}&res=\${
window.screen.width + "x" + window.screen.height
}&appCodeName=\${navigator.appCodeName}&appVersion=\${
navigator.appVersion
}&platform=\${navigator.platform}\`;
</script>
<body> <body>
<h1>Twoja karta to:</h1> <h1>Twoja karta to:</h1>
<div>${getEmoji(card)}</div> <div id="card">${getEmoji(card)}</div>
<script>
(function () {
if (localStorage.getItem("card")) {
card.innerHTML = localStorage.getItem("card");
return;
}
localStorage.setItem("card", \`${getEmoji(card)}\`);
track.src = \`/track?id=${id}&DNT=\${navigator.doNotTrack}&lang=\${
navigator.language
}&res=\${
window.screen.width + "x" + window.screen.height
}&appCodeName=\${navigator.appCodeName}&appVersion=\${
navigator.appVersion
}&platform=\${navigator.platform}\`;
})();
</script>
</body> </body>
</html> `; </html> `;
}; };

Loading…
Cancel
Save