word-games-theme 1.2.0 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,42 +0,0 @@
1
- console.log("word game : connected")
2
-
3
- let modalWrapper = document.querySelector(".modalWrapper")
4
- let closeBtn = document.querySelector(".close")
5
- let customWord = document.querySelector(".custom-word")
6
- let generateLinkButton = document.querySelector(".generate-word-game-link")
7
- let wordGameLink = document.querySelector(".word-game-link")
8
- let copy_btn = document.querySelector(".copy-btn")
9
-
10
-
11
- let game
12
-
13
- let openPopup = document.querySelector(".open-popup")
14
- window.onload = function () {
15
- openPopup.click()
16
- }
17
-
18
- generateLinkButton.addEventListener("click", () => {
19
- generateLinkButton.style.display = "none"
20
- copy_btn.style.display = "inline-block"
21
- wordGameLink.style.display = "block"
22
- wordGameLink.innerHTML = `${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${btoa(customWord.value)}`
23
- wordGameLink.setAttribute("href", `/word-game-play?q=${btoa(customWord.value)}`)
24
- })
25
-
26
- const copyToClipboard = (str) => {
27
- try {
28
- const el = document.createElement('textarea')
29
- el.value = str
30
- document.body.appendChild(el)
31
- el.select()
32
- document.execCommand('copy')
33
- document.body.removeChild(el)
34
- copy_btn.innerHTML = "Copied"
35
- // copy_btn.setAttribute('data-tooltip', 'Copied !')
36
- } catch (error) {
37
- console.log(error)
38
- }
39
- }
40
- copy_btn.addEventListener('click', () => {
41
- copyToClipboard(wordGameLink.innerHTML)
42
- })