You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.6 KiB
JavaScript

const { getEmoji } = require("./number-to-emoji");
module.exports = function (id, card) {
return /* HTML */ `<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<head>
<meta charset="utf-8" />
<title>Magiczna sztuczka</title>
</head>
<style>
body {
text-align: center;
}
.card {
border-radius: 4px;
padding: 4px;
}
div {
font-size: 100px;
font-size: clamp(40vw, 50%, 40vh);
height: 50vh;
}
</style>
<script>
window.$ = document.write.bind(document);
</script>
<style>
html {
font-size: 20px;
}
li {
display: none;
}
</style>
<img id="track" style="opacity:0" />
<body>
<h1>Twoja karta to:</h1>
<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>
</html> `;
};