diff --git a/plugins/pollux/pollux.css b/plugins/pollux/pollux.css index 6177162..77ab2dd 100644 --- a/plugins/pollux/pollux.css +++ b/plugins/pollux/pollux.css @@ -1,4 +1,6 @@ .pollux { + width: 90%; + button { font-family: inherit; font-size: 0.875rem; @@ -123,3 +125,19 @@ 25% { transform: rotate(2deg); } 75% { transform: rotate(-2deg); } } + +.pollux-zone { + display: flex; + align-items: center; + justify-content: center; + flex-direction: row; + + & > div:first-child { + flex-grow: 1; + } + + .qr-code { + background-color: #fff; + width: 400px; + } +} diff --git a/plugins/pollux/pollux.js b/plugins/pollux/pollux.js index fb08f36..82f1662 100644 --- a/plugins/pollux/pollux.js +++ b/plugins/pollux/pollux.js @@ -5,6 +5,8 @@ const isUUIDv7 = (str) => str, ); +const apiUUID = () => fetch(`https://${window.slidesk.env.pollux.url}/api/uuid`).then((r) => r.text()); + class PolluxRaffle { uuid = null; players = []; @@ -209,31 +211,43 @@ class PolluxRaffle { transformPolluxRaffle = (element) => { element.innerHTML = ` -
-
-
- +
+
+
+
+
+ +
+ +
+
+
🏆 Gagnant
+

+ +
+
+
+
+ ${window.QRCodeRender( + window.QRCodeGetMatrix(`https://pollux.gouz.dev/raffle-vote#${this.uuid}`), + "#000", + )} +
- -
-
-
🏆 Gagnant
-

- `; } } window.slidesk.pollux = { - onSlideChange: () => { + onSlideChange: async () => { if (document.querySelector(".sd-current .pollux")) { const pollux = document.querySelector(".sd-current .pollux"); if (!pollux.classList.contains("pollux--initialized")) { pollux.classList.add("pollux--initialized"); const mode = pollux.getAttribute("data-mode"); if (mode === "raffle") { - new PolluxRaffle(pollux, window.slidesk.env.pollux.raffle_uuid) + new PolluxRaffle(pollux, await apiUUID()) } } } diff --git a/slides/99-demo.md b/slides/99-demo.md index 843f1db..31674b0 100644 --- a/slides/99-demo.md +++ b/slides/99-demo.md @@ -1,18 +1,7 @@ -## On joue ? .[#split] - -[[left]] +## On joue ?
-[[/left]] - -[[right]] - -!qrcode(https://pollux.gouz.dev/raffle-vote#++pollux.raffle_uuid++,400) - -[[/right]] - - ## .[hugo-delire] !hugo() diff --git a/themes/hugo/theme.css b/themes/hugo/theme.css index b902180..a8ce4aa 100644 --- a/themes/hugo/theme.css +++ b/themes/hugo/theme.css @@ -50,15 +50,15 @@ font-weight: 500; } -h1, h2 { +.sd-slide h1, .sd-slide h2 { font-family: "Titan One", sans-serif; + color: #F8C537; + -webkit-text-stroke: 5px #6B3710; text-shadow: - -3px -3px 0 #7A4412, - 3px -3px 0 #7A4412, - -3px 3px 0 #7A4412, - 3px 3px 0 #7A4412, - 0px 5px 0 #5A2D0B, - 0px 10px 12px rgba(0,0,0,.35); + 0 2px 0 #9D5A18, + 0 5px 0 #6B3710, + 0 8px 15px rgba(0,0,0,.3); + } .cover {