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.
- checksums.yaml +4 -4
- data/_data/wordgames/en/root.json +2 -0
- data/_data/wordgames/en/word-game-generator-online.json +2 -2
- data/_data/wordgames/en/word-game-play.json +21 -0
- data/_data/wordgames/fr/four_letter_word_finder.json +1 -0
- data/_data/wordgames/hi/four_letter_word_finder.json +1 -0
- data/_includes/adBlocker/adBlocker.html +7 -7
- data/_includes/autogenerated/content.html +1 -1
- data/_includes/footer/index.html +2 -2
- data/_includes/footer/unqFooter.html +4 -4
- data/_includes/head/index.html +3 -3
- data/_includes/script.html +1 -1
- data/_includes/section/commonPage.html +1 -1
- data/_includes/section/home.html +1 -1
- data/_includes/section/home2.html +3 -2
- data/_includes/word-game/word-game-generator-online.html +23 -139
- data/_includes/word-game/word-game-play.html +191 -0
- data/_includes/wordfinderstrategy/content.html +1 -1
- data/_includes/wordle-solver/wordle-solver.html +12 -1
- data/_includes/xyzpages/xyz.html +2 -2
- data/_layouts/page.html +2 -2
- data/assets/css/game.css +406 -0
- data/assets/css/wordleSolver.css +11 -0
- data/assets/images/close.png +0 -0
- data/assets/images/copy.svg +1 -0
- data/assets/images/facebooks.svg +1 -0
- data/assets/images/twitters.svg +1 -0
- data/assets/images/whatsapp.svg +1 -0
- data/assets/images/wordle.png +0 -0
- data/assets/js/confetti.js +130 -0
- data/assets/js/createWordle.js +71 -0
- data/assets/js/game.js +282 -0
- metadata +14 -4
- data/assets/css/wordGame.css +0 -99
- data/assets/js/wordGame.js +0 -42
@@ -0,0 +1 @@
|
|
1
|
+
<svg id="SvgjsSvg1044" width="288" height="288" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"><circle id="SvgjsCircle1050" r="144" cx="144" cy="144" transform="matrix(0.7916,0,0,0.7916,30.009600000000006,30.009600000000006)" fill="#4267b2"></circle><defs id="SvgjsDefs1045"></defs><g id="SvgjsG1046" transform="matrix(0.4652,0,0,0.4652,77.01128160400391,77.0111979598999)"><svg xmlns="http://www.w3.org/2000/svg" width="288" height="288" viewBox="0 0 24 24"><path d="M12 2.04C6.5 2.04 2 6.53 2 12.06C2 17.06 5.66 21.21 10.44 21.96V14.96H7.9V12.06H10.44V9.85C10.44 7.34 11.93 5.96 14.22 5.96C15.31 5.96 16.45 6.15 16.45 6.15V8.62H15.19C13.95 8.62 13.56 9.39 13.56 10.18V12.06H16.34L15.89 14.96H13.56V21.96A10 10 0 0 0 22 12.06C22 6.53 17.5 2.04 12 2.04Z" fill="#ffffff" class="color000 svgShape"></path></svg></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg id="SvgjsSvg1030" width="288" height="288" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"><circle id="SvgjsCircle1036" r="144" cx="144" cy="144" transform="matrix(0.7916,0,0,0.7916,30.009600000000006,30.009600000000006)" fill="#1da1f2"></circle><defs id="SvgjsDefs1031"></defs><g id="SvgjsG1032" transform="matrix(0.4652,0,0,0.4652,77.0111979598999,80.22)"><svg xmlns="http://www.w3.org/2000/svg" width="288" height="288" viewBox="0 0 24 24"><path d="M22.46,6C21.69,6.35 20.86,6.58 20,6.69C20.88,6.16 21.56,5.32 21.88,4.31C21.05,4.81 20.13,5.16 19.16,5.36C18.37,4.5 17.26,4 16,4C13.65,4 11.73,5.92 11.73,8.29C11.73,8.63 11.77,8.96 11.84,9.27C8.28,9.09 5.11,7.38 3,4.79C2.63,5.42 2.42,6.16 2.42,6.94C2.42,8.43 3.17,9.75 4.33,10.5C3.62,10.5 2.96,10.3 2.38,10C2.38,10 2.38,10 2.38,10.03C2.38,12.11 3.86,13.85 5.82,14.24C5.46,14.34 5.08,14.39 4.69,14.39C4.42,14.39 4.15,14.36 3.89,14.31C4.43,16 6,17.26 7.89,17.29C6.43,18.45 4.58,19.13 2.56,19.13C2.22,19.13 1.88,19.11 1.54,19.07C3.44,20.29 5.7,21 8.12,21C16,21 20.33,14.46 20.33,8.79C20.33,8.6 20.33,8.42 20.32,8.23C21.16,7.63 21.88,6.87 22.46,6Z" fill="#ffffff" class="color000 svgShape"></path></svg></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg id="SvgjsSvg1066" width="288" height="288" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"><circle id="SvgjsCircle1072" r="144" cx="144" cy="144" transform="matrix(0.7916,0,0,0.7916,30.009600000000006,30.009600000000006)" fill="#25d366"></circle><defs id="SvgjsDefs1067"></defs><g id="SvgjsG1068" transform="matrix(0.4652,0,0,0.4652,77.0112040802002,77.0112)"><svg xmlns="http://www.w3.org/2000/svg" width="288" height="288" viewBox="0 0 24 24"><path d="M12.04 2C6.58 2 2.13 6.45 2.13 11.91C2.13 13.66 2.59 15.36 3.45 16.86L2.05 22L7.3 20.62C8.75 21.41 10.38 21.83 12.04 21.83C17.5 21.83 21.95 17.38 21.95 11.92C21.95 9.27 20.92 6.78 19.05 4.91C17.18 3.03 14.69 2 12.04 2M12.05 3.67C14.25 3.67 16.31 4.53 17.87 6.09C19.42 7.65 20.28 9.72 20.28 11.92C20.28 16.46 16.58 20.15 12.04 20.15C10.56 20.15 9.11 19.76 7.85 19L7.55 18.83L4.43 19.65L5.26 16.61L5.06 16.29C4.24 15 3.8 13.47 3.8 11.91C3.81 7.37 7.5 3.67 12.05 3.67M8.53 7.33C8.37 7.33 8.1 7.39 7.87 7.64C7.65 7.89 7 8.5 7 9.71C7 10.93 7.89 12.1 8 12.27C8.14 12.44 9.76 14.94 12.25 16C12.84 16.27 13.3 16.42 13.66 16.53C14.25 16.72 14.79 16.69 15.22 16.63C15.7 16.56 16.68 16.03 16.89 15.45C17.1 14.87 17.1 14.38 17.04 14.27C16.97 14.17 16.81 14.11 16.56 14C16.31 13.86 15.09 13.26 14.87 13.18C14.64 13.1 14.5 13.06 14.31 13.3C14.15 13.55 13.67 14.11 13.53 14.27C13.38 14.44 13.24 14.46 13 14.34C12.74 14.21 11.94 13.95 11 13.11C10.26 12.45 9.77 11.64 9.62 11.39C9.5 11.15 9.61 11 9.73 10.89C9.84 10.78 10 10.6 10.1 10.45C10.23 10.31 10.27 10.2 10.35 10.04C10.43 9.87 10.39 9.73 10.33 9.61C10.27 9.5 9.77 8.26 9.56 7.77C9.36 7.29 9.16 7.35 9 7.34C8.86 7.34 8.7 7.33 8.53 7.33Z" fill="#ffffff" class="color000 svgShape"></path></svg></g></svg>
|
Binary file
|
@@ -0,0 +1,130 @@
|
|
1
|
+
var maxParticleCount = 150; //set max confetti count
|
2
|
+
var particleSpeed = 2; //set the particle animation speed
|
3
|
+
var startConfetti; //call to start confetti animation
|
4
|
+
var stopConfetti; //call to stop adding confetti
|
5
|
+
var toggleConfetti; //call to start or stop the confetti animation depending on whether it's already running
|
6
|
+
var removeConfetti; //call to stop the confetti animation and remove all confetti immediately
|
7
|
+
|
8
|
+
(function () {
|
9
|
+
startConfetti = startConfettiInner;
|
10
|
+
stopConfetti = stopConfettiInner;
|
11
|
+
toggleConfetti = toggleConfettiInner;
|
12
|
+
removeConfetti = removeConfettiInner;
|
13
|
+
var colors = ["DodgerBlue", "OliveDrab", "Gold", "Pink", "SlateBlue", "LightBlue", "Violet", "PaleGreen", "SteelBlue", "SandyBrown", "Chocolate", "Crimson"]
|
14
|
+
var streamingConfetti = false;
|
15
|
+
var animationTimer = null;
|
16
|
+
var particles = [];
|
17
|
+
var waveAngle = 0;
|
18
|
+
|
19
|
+
function resetParticle(particle, width, height) {
|
20
|
+
particle.color = colors[(Math.random() * colors.length) | 0];
|
21
|
+
particle.x = Math.random() * width;
|
22
|
+
particle.y = Math.random() * height - height;
|
23
|
+
particle.diameter = Math.random() * 10 + 5;
|
24
|
+
particle.tilt = Math.random() * 10 - 10;
|
25
|
+
particle.tiltAngleIncrement = Math.random() * 0.07 + 0.05;
|
26
|
+
particle.tiltAngle = 0;
|
27
|
+
return particle;
|
28
|
+
}
|
29
|
+
|
30
|
+
function startConfettiInner() {
|
31
|
+
var width = window.innerWidth;
|
32
|
+
var height = window.innerHeight;
|
33
|
+
window.requestAnimFrame = (function () {
|
34
|
+
return window.requestAnimationFrame ||
|
35
|
+
window.webkitRequestAnimationFrame ||
|
36
|
+
window.mozRequestAnimationFrame ||
|
37
|
+
window.oRequestAnimationFrame ||
|
38
|
+
window.msRequestAnimationFrame ||
|
39
|
+
function (callback) {
|
40
|
+
return window.setTimeout(callback, 16.6666667);
|
41
|
+
};
|
42
|
+
})();
|
43
|
+
var canvas = document.getElementById("confetti-canvas");
|
44
|
+
if (canvas === null) {
|
45
|
+
canvas = document.createElement("canvas");
|
46
|
+
canvas.setAttribute("id", "confetti-canvas");
|
47
|
+
canvas.setAttribute("style", "display:block;z-index:999999;pointer-events:none");
|
48
|
+
document.body.appendChild(canvas);
|
49
|
+
canvas.width = width;
|
50
|
+
canvas.height = height;
|
51
|
+
window.addEventListener("resize", function () {
|
52
|
+
canvas.width = window.innerWidth;
|
53
|
+
canvas.height = window.innerHeight;
|
54
|
+
}, true);
|
55
|
+
}
|
56
|
+
var context = canvas.getContext("2d");
|
57
|
+
while (particles.length < maxParticleCount)
|
58
|
+
particles.push(resetParticle({}, width, height));
|
59
|
+
streamingConfetti = true;
|
60
|
+
if (animationTimer === null) {
|
61
|
+
(function runAnimation() {
|
62
|
+
context.clearRect(0, 0, window.innerWidth, window.innerHeight);
|
63
|
+
if (particles.length === 0)
|
64
|
+
animationTimer = null;
|
65
|
+
else {
|
66
|
+
updateParticles();
|
67
|
+
drawParticles(context);
|
68
|
+
animationTimer = requestAnimFrame(runAnimation);
|
69
|
+
}
|
70
|
+
})();
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
function stopConfettiInner() {
|
75
|
+
streamingConfetti = false;
|
76
|
+
}
|
77
|
+
|
78
|
+
function removeConfettiInner() {
|
79
|
+
stopConfetti();
|
80
|
+
particles = [];
|
81
|
+
}
|
82
|
+
|
83
|
+
function toggleConfettiInner() {
|
84
|
+
if (streamingConfetti)
|
85
|
+
stopConfettiInner();
|
86
|
+
else
|
87
|
+
startConfettiInner();
|
88
|
+
}
|
89
|
+
|
90
|
+
function drawParticles(context) {
|
91
|
+
var particle;
|
92
|
+
var x;
|
93
|
+
for (var i = 0; i < particles.length; i++) {
|
94
|
+
particle = particles[i];
|
95
|
+
context.beginPath();
|
96
|
+
context.lineWidth = particle.diameter;
|
97
|
+
context.strokeStyle = particle.color;
|
98
|
+
x = particle.x + particle.tilt;
|
99
|
+
context.moveTo(x + particle.diameter / 2, particle.y);
|
100
|
+
context.lineTo(x, particle.y + particle.tilt + particle.diameter / 2);
|
101
|
+
context.stroke();
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
function updateParticles() {
|
106
|
+
var width = window.innerWidth;
|
107
|
+
var height = window.innerHeight;
|
108
|
+
var particle;
|
109
|
+
waveAngle += 0.01;
|
110
|
+
for (var i = 0; i < particles.length; i++) {
|
111
|
+
particle = particles[i];
|
112
|
+
if (!streamingConfetti && particle.y < -15)
|
113
|
+
particle.y = height + 100;
|
114
|
+
else {
|
115
|
+
particle.tiltAngle += particle.tiltAngleIncrement;
|
116
|
+
particle.x += Math.sin(waveAngle);
|
117
|
+
particle.y += (Math.cos(waveAngle) + particle.diameter + particleSpeed) * 0.5;
|
118
|
+
particle.tilt = Math.sin(particle.tiltAngle) * 15;
|
119
|
+
}
|
120
|
+
if (particle.x > width + 20 || particle.x < -20 || particle.y > height) {
|
121
|
+
if (streamingConfetti && particles.length <= maxParticleCount)
|
122
|
+
resetParticle(particle, width, height);
|
123
|
+
else {
|
124
|
+
particles.splice(i, 1);
|
125
|
+
i--;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}
|
129
|
+
}
|
130
|
+
})();
|
@@ -0,0 +1,71 @@
|
|
1
|
+
let customWord = document.querySelector(".custom-word")
|
2
|
+
let generateLinkButton = document.querySelector(".generate-word-game-link")
|
3
|
+
let wordleGameLink = document.querySelector(".wordle-game-link")
|
4
|
+
let copy_btn = document.querySelector(".copy-btn")
|
5
|
+
|
6
|
+
let form = document.querySelector('#create-wordle-form')
|
7
|
+
let openPopup = document.querySelector(".open-popup")
|
8
|
+
|
9
|
+
const alertContainer = document.querySelector(".alert-container")
|
10
|
+
let errorMsg = document.querySelector("#errorMsg")
|
11
|
+
|
12
|
+
customWord.focus()
|
13
|
+
|
14
|
+
|
15
|
+
let dictionary
|
16
|
+
async function getData() {
|
17
|
+
const response = await fetch("/dictionary.json")
|
18
|
+
const data = await response.json()
|
19
|
+
dictionary = data
|
20
|
+
}
|
21
|
+
getData()
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
const createWordle = (e) => {
|
26
|
+
e.preventDefault();
|
27
|
+
|
28
|
+
if (customWord.value.length < 5) {
|
29
|
+
errorMsg.innerHTML = "Not enough letters"
|
30
|
+
alertContainer.classList.add("active-alert")
|
31
|
+
setTimeout(() => {
|
32
|
+
alertContainer.classList.remove("active-alert")
|
33
|
+
}, 1000)
|
34
|
+
}
|
35
|
+
if (customWord.value.length === 5 && !dictionary.includes(customWord.value.toLocaleLowerCase())) {
|
36
|
+
errorMsg.innerHTML = "Not a valid word"
|
37
|
+
alertContainer.classList.add("active-alert")
|
38
|
+
setTimeout(() => {
|
39
|
+
alertContainer.classList.remove("active-alert")
|
40
|
+
}, 1000)
|
41
|
+
} else {
|
42
|
+
if (customWord.value.length === 5) {
|
43
|
+
openPopup.click()
|
44
|
+
copy_btn.innerHTML = "Copy"
|
45
|
+
copy_btn.style.background = "dodgerblue"
|
46
|
+
wordleGameLink.setAttribute("href", `/word-game-play?q=${btoa(customWord.value.toLocaleLowerCase())}`)
|
47
|
+
wordleGameLink.innerHTML = `${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${btoa(customWord.value.toLocaleLowerCase())}`
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
form.addEventListener('submit', createWordle);
|
52
|
+
|
53
|
+
|
54
|
+
const copyToClipboard = (str) => {
|
55
|
+
try {
|
56
|
+
const el = document.createElement('textarea')
|
57
|
+
el.value = str
|
58
|
+
document.body.appendChild(el)
|
59
|
+
el.select()
|
60
|
+
document.execCommand('copy')
|
61
|
+
document.body.removeChild(el)
|
62
|
+
copy_btn.innerHTML = "Copied !"
|
63
|
+
copy_btn.style.background = "#444"
|
64
|
+
// copy_btn.setAttribute('data-tooltip', 'Copied !')
|
65
|
+
} catch (error) {
|
66
|
+
console.log(error)
|
67
|
+
}
|
68
|
+
}
|
69
|
+
copy_btn.addEventListener('click', () => {
|
70
|
+
copyToClipboard(wordleGameLink.innerHTML)
|
71
|
+
})
|
data/assets/js/game.js
ADDED
@@ -0,0 +1,282 @@
|
|
1
|
+
const params = new URLSearchParams(window.location.search)
|
2
|
+
let gameBoard = document.querySelector(".game-board")
|
3
|
+
let serachValue = params.get('q')
|
4
|
+
let decodeBase64 = atob(serachValue)
|
5
|
+
let word = decodeBase64
|
6
|
+
let targetWord = word.toLocaleLowerCase()
|
7
|
+
let ANIMATION_DURATION = 500
|
8
|
+
let wordLength = 5
|
9
|
+
let keyboard = document.querySelector(".game-keyboard")
|
10
|
+
let alertContainer = document.querySelector(".alert-container")
|
11
|
+
let errorMsg = document.querySelector("#errorMsg")
|
12
|
+
let gameResult = document.querySelector(".gameResult")
|
13
|
+
let openPopup = document.querySelector(".open-popup")
|
14
|
+
let wordleGameShareLink = document.querySelector(".wordle-game-share-link")
|
15
|
+
let wordleGameCopyLink = document.querySelector(".wordle-game-copy-link")
|
16
|
+
let ResutlGuessWord = document.querySelector(".guess-word")
|
17
|
+
let answer = document.querySelector("#answer")
|
18
|
+
let facebookSHareLink = document.querySelector(".facebook-share-link")
|
19
|
+
let twitterSHareLink = document.querySelector(".twitter-share-link")
|
20
|
+
let whatsappSHareLink = document.querySelector(".whatsapp-share-link")
|
21
|
+
|
22
|
+
document.querySelector(".navbar").style.display = "none"
|
23
|
+
document.querySelector(".tools_headings").style.display = "none"
|
24
|
+
document.querySelector(".ads_layout").style.display = "none"
|
25
|
+
document.querySelector(".relatedPosts").style.display = "none"
|
26
|
+
document.querySelector(".footer-section").style.display = "none"
|
27
|
+
document.querySelector(".rating-tool").style.display = "none"
|
28
|
+
|
29
|
+
|
30
|
+
let dictionary
|
31
|
+
let attempt = 0
|
32
|
+
async function getData() {
|
33
|
+
const response = await fetch("/dictionary.json")
|
34
|
+
const data = await response.json()
|
35
|
+
dictionary = data
|
36
|
+
}
|
37
|
+
getData()
|
38
|
+
|
39
|
+
const handleClick = (e) => {
|
40
|
+
if (e.target.matches("[data-key]")) {
|
41
|
+
pressKey(e.target.dataset.key)
|
42
|
+
return
|
43
|
+
}
|
44
|
+
if (e.target.matches("[data-enter]")) {
|
45
|
+
handleSubmit()
|
46
|
+
return
|
47
|
+
}
|
48
|
+
if (e.target.matches("[data-delete]")) {
|
49
|
+
deleteKey()
|
50
|
+
return
|
51
|
+
}
|
52
|
+
}
|
53
|
+
const handleKeyPress = (e) => {
|
54
|
+
if (e.key === "Enter") {
|
55
|
+
handleSubmit()
|
56
|
+
return
|
57
|
+
}
|
58
|
+
if (e.key === "Delete" || e.key === "Backspace") {
|
59
|
+
deleteKey()
|
60
|
+
return
|
61
|
+
}
|
62
|
+
|
63
|
+
if (e.key.match(/^[a-zA-Z]$/)) {
|
64
|
+
pressKey(e.key)
|
65
|
+
return
|
66
|
+
}
|
67
|
+
}
|
68
|
+
const getActiveTiles = () => {
|
69
|
+
return gameBoard.querySelectorAll('[data-state="active"]')
|
70
|
+
}
|
71
|
+
const pressKey = (key) => {
|
72
|
+
const activeTiles = getActiveTiles()
|
73
|
+
if (activeTiles.length >= wordLength) return
|
74
|
+
const nextTile = gameBoard.querySelector(":not([data-letter])")
|
75
|
+
nextTile.dataset.letter = key.toLowerCase()
|
76
|
+
nextTile.dataset.state = "active"
|
77
|
+
nextTile.classList.add("popAni")
|
78
|
+
nextTile.innerText = key
|
79
|
+
nextTile.style.border = "2px solid #a7adc0"
|
80
|
+
}
|
81
|
+
const deleteKey = () => {
|
82
|
+
const activeTiles = getActiveTiles()
|
83
|
+
const lastTile = activeTiles[activeTiles.length - 1]
|
84
|
+
if (lastTile == null) return
|
85
|
+
lastTile.textContent = ""
|
86
|
+
delete lastTile.dataset.state
|
87
|
+
delete lastTile.dataset.letter
|
88
|
+
lastTile.style.border = "2px solid #dee1e9"
|
89
|
+
lastTile.classList.remove("popAni")
|
90
|
+
}
|
91
|
+
const handleSubmit = () => {
|
92
|
+
const allTiles = [...getActiveTiles()]
|
93
|
+
if (allTiles.length !== wordLength) {
|
94
|
+
showAlertMessage("Not enough letters")
|
95
|
+
shakeTiles(allTiles)
|
96
|
+
return
|
97
|
+
}
|
98
|
+
const guessWord = allTiles.reduce((word, tile) => {
|
99
|
+
return word + tile.dataset.letter
|
100
|
+
}, "")
|
101
|
+
|
102
|
+
|
103
|
+
if (guessWord === targetWord) {
|
104
|
+
} else {
|
105
|
+
if (!dictionary.includes(guessWord)) {
|
106
|
+
showAlertMessage("Not a valid word")
|
107
|
+
shakeTiles(allTiles)
|
108
|
+
return
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
stopAllEventListeners()
|
113
|
+
let matchLetters = [...targetWord]
|
114
|
+
let matchedLettersCount = matchLetters.reduce((obj, letter) => {
|
115
|
+
if (obj[letter]) {
|
116
|
+
obj[letter]++;
|
117
|
+
return obj;
|
118
|
+
}
|
119
|
+
|
120
|
+
obj[letter] = 1;
|
121
|
+
return obj;
|
122
|
+
}, {})
|
123
|
+
evaluateTiles(allTiles, matchedLettersCount, guessWord)
|
124
|
+
}
|
125
|
+
const evaluateTiles = (allTiles, matchedLettersCount, guessWord) => {
|
126
|
+
let reEvaluate = []
|
127
|
+
allTiles.map((tile, index) => {
|
128
|
+
|
129
|
+
if (targetWord !== guessWord) {
|
130
|
+
setTimeout(() => {
|
131
|
+
tile.classList.add("flip")
|
132
|
+
}, (index * ANIMATION_DURATION) / 2)
|
133
|
+
|
134
|
+
tile.addEventListener(
|
135
|
+
"transitionend",
|
136
|
+
() => {
|
137
|
+
tile.classList.remove("flip")
|
138
|
+
})
|
139
|
+
}
|
140
|
+
|
141
|
+
|
142
|
+
let letter = tile.dataset.letter
|
143
|
+
let key = keyboard.querySelector(`[data-key="${letter}"i]`)
|
144
|
+
if (targetWord[index] === letter) {
|
145
|
+
tile.dataset.state = "correct-spot"
|
146
|
+
key.dataset.state = "correct-spot"
|
147
|
+
matchedLettersCount[letter]--;
|
148
|
+
return
|
149
|
+
}
|
150
|
+
reEvaluate.push(tile)
|
151
|
+
})
|
152
|
+
reEvaluate.map((tile) => {
|
153
|
+
let letter = tile.dataset.letter
|
154
|
+
let key = keyboard.querySelector(`[data-key="${letter}"i]`)
|
155
|
+
if (matchedLettersCount[letter] > 0) {
|
156
|
+
tile.dataset.state = "wrong-spot"
|
157
|
+
key.dataset.state = "wrong-spot"
|
158
|
+
matchedLettersCount[letter]--;
|
159
|
+
}
|
160
|
+
else {
|
161
|
+
tile.dataset.state = "wrong-word"
|
162
|
+
key.dataset.state = "wrong-word"
|
163
|
+
}
|
164
|
+
|
165
|
+
})
|
166
|
+
startAllEventListeners()
|
167
|
+
gameOver(guessWord, allTiles)
|
168
|
+
}
|
169
|
+
const shakeTiles = (tiles) => {
|
170
|
+
tiles.forEach(tile => {
|
171
|
+
tile.classList.add("shake")
|
172
|
+
tile.addEventListener('animationend', () => {
|
173
|
+
// console.log('Animation ended');
|
174
|
+
tile.classList.remove("shake")
|
175
|
+
});
|
176
|
+
})
|
177
|
+
}
|
178
|
+
const gameOver = (guessWord, tiles) => {
|
179
|
+
attempt++
|
180
|
+
const danceTiles = (tiles) => {
|
181
|
+
tiles.forEach((tile) => {
|
182
|
+
tile.classList.add("dance")
|
183
|
+
tile.addEventListener("animationend", () => {
|
184
|
+
tile.classList.remove("dance")
|
185
|
+
})
|
186
|
+
})
|
187
|
+
}
|
188
|
+
if (guessWord === targetWord) {
|
189
|
+
// console.log(`Wordle guessed in ${attempt}/6!`)
|
190
|
+
facebookSHareLink.setAttribute("href",
|
191
|
+
`https://www.facebook.com/share.php?u=${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${(serachValue)}"e=
|
192
|
+
I guessed this wordle in ${attempt}/6 tries. Can you do better ?
|
193
|
+
Try this wordle:
|
194
|
+
${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${(serachValue)}`)
|
195
|
+
|
196
|
+
twitterSHareLink.setAttribute("href",
|
197
|
+
`https://www.twitter.com/compose/tweet?&text=I guessed this wordle in ${attempt}/6 tries.
|
198
|
+
Can you do better ? Try this wordle: ${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${(serachValue)}`)
|
199
|
+
|
200
|
+
whatsappSHareLink.setAttribute("href", `whatsapp://send?text=I guessed this wordle in ${attempt}/6 tries.
|
201
|
+
Can you do better ? Try this wordle: ${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${(serachValue)}`)
|
202
|
+
|
203
|
+
startConfetti()
|
204
|
+
showAlertMessage("You WON! 🏆")
|
205
|
+
stopAllEventListeners()
|
206
|
+
danceTiles(tiles)
|
207
|
+
setTimeout(() => {
|
208
|
+
openPopup.click()
|
209
|
+
stopConfetti()
|
210
|
+
}, 1500);
|
211
|
+
return
|
212
|
+
}
|
213
|
+
const remainingTiles = gameBoard.querySelectorAll(":not([data-letter])")
|
214
|
+
if (remainingTiles.length === 0) {
|
215
|
+
facebookSHareLink.setAttribute("href",
|
216
|
+
`https://www.facebook.com/share.php?u=${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${(serachValue)}"e=
|
217
|
+
I guessed this wordle in ${attempt}/6 tries. Can you do better ?
|
218
|
+
Try this wordle:
|
219
|
+
${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${(serachValue)}`)
|
220
|
+
twitterSHareLink.setAttribute("href",
|
221
|
+
`https://www.twitter.com/compose/tweet?&text=I guessed this wordle in ${attempt}/6 tries.
|
222
|
+
Can you do better ? Try this wordle: ${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${(serachValue)}`)
|
223
|
+
whatsappSHareLink.setAttribute("href", `whatsapp://send?text=I guessed this wordle in ${attempt}/6 tries.
|
224
|
+
Can you do better ? Try this wordle: ${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${(serachValue)}`)
|
225
|
+
showAlertMessage("You LOST!")
|
226
|
+
setTimeout(() => {
|
227
|
+
openPopup.click()
|
228
|
+
}, 1000);
|
229
|
+
stopAllEventListeners()
|
230
|
+
}
|
231
|
+
|
232
|
+
}
|
233
|
+
const startAllEventListeners = () => {
|
234
|
+
document.addEventListener("keydown", handleKeyPress)
|
235
|
+
document.addEventListener("click", handleClick)
|
236
|
+
}
|
237
|
+
startAllEventListeners()
|
238
|
+
|
239
|
+
const stopAllEventListeners = () => {
|
240
|
+
document.removeEventListener("click", handleClick)
|
241
|
+
document.removeEventListener("keydown", handleKeyPress)
|
242
|
+
}
|
243
|
+
const showAlertMessage = (msg) => {
|
244
|
+
if (msg === "You LOST!") {
|
245
|
+
answer.innerText = "The answer was"
|
246
|
+
}
|
247
|
+
|
248
|
+
ResutlGuessWord.innerHTML = targetWord
|
249
|
+
gameResult.innerHTML = msg
|
250
|
+
errorMsg.innerHTML = msg
|
251
|
+
|
252
|
+
alertContainer.classList.add("active-alert")
|
253
|
+
setTimeout(() => {
|
254
|
+
alertContainer.classList.remove("active-alert")
|
255
|
+
}, 1000)
|
256
|
+
}
|
257
|
+
const copyToClipboard = (str) => {
|
258
|
+
try {
|
259
|
+
const el = document.createElement('textarea')
|
260
|
+
el.value = str
|
261
|
+
document.body.appendChild(el)
|
262
|
+
el.select()
|
263
|
+
document.execCommand('copy')
|
264
|
+
document.body.removeChild(el)
|
265
|
+
errorMsg.innerHTML = "Copied !"
|
266
|
+
alertContainer.classList.add("active-alert")
|
267
|
+
setTimeout(() => {
|
268
|
+
alertContainer.classList.remove("active-alert")
|
269
|
+
}, 1000)
|
270
|
+
} catch (error) {
|
271
|
+
console.log(error)
|
272
|
+
}
|
273
|
+
}
|
274
|
+
wordleGameCopyLink.addEventListener('click', () => {
|
275
|
+
copyToClipboard(`${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${(serachValue)}`)
|
276
|
+
})
|
277
|
+
wordleGameShareLink.addEventListener('click', () => {
|
278
|
+
copyToClipboard(`${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${(serachValue)}`)
|
279
|
+
})
|
280
|
+
|
281
|
+
|
282
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: word-games-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- manpreet-appscms
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- _data/wordgames/en/unscramble_letters_to_make_words.json
|
107
107
|
- _data/wordgames/en/unscramble_words_and_jumble_solver.json
|
108
108
|
- _data/wordgames/en/word-game-generator-online.json
|
109
|
+
- _data/wordgames/en/word-game-play.json
|
109
110
|
- _data/wordgames/en/word-meaning.json
|
110
111
|
- _data/wordgames/en/words_with_friends_word_finder.json
|
111
112
|
- _data/wordgames/es/four_letter_word_finder.json
|
@@ -173,6 +174,7 @@ files:
|
|
173
174
|
- _includes/seo.html
|
174
175
|
- _includes/share/socialshare.html
|
175
176
|
- _includes/word-game/word-game-generator-online.html
|
177
|
+
- _includes/word-game/word-game-play.html
|
176
178
|
- _includes/wordfinderstrategy/content.html
|
177
179
|
- _includes/wordle-solver/wordle-solver.html
|
178
180
|
- _includes/xyzpages/xyz.html
|
@@ -202,10 +204,10 @@ files:
|
|
202
204
|
- assets/css/content.css
|
203
205
|
- assets/css/feature.css
|
204
206
|
- assets/css/footer.css
|
207
|
+
- assets/css/game.css
|
205
208
|
- assets/css/home.css
|
206
209
|
- assets/css/news.css
|
207
210
|
- assets/css/style.css
|
208
|
-
- assets/css/wordGame.css
|
209
211
|
- assets/css/wordGroup.css
|
210
212
|
- assets/css/wordScrabble.css
|
211
213
|
- assets/css/wordleSolver.css
|
@@ -221,8 +223,11 @@ files:
|
|
221
223
|
- assets/images/bg_elements.png
|
222
224
|
- assets/images/bg_elements.svg
|
223
225
|
- assets/images/board-game.png
|
226
|
+
- assets/images/close.png
|
227
|
+
- assets/images/copy.svg
|
224
228
|
- assets/images/facebook-square.svg
|
225
229
|
- assets/images/facebook.svg
|
230
|
+
- assets/images/facebooks.svg
|
226
231
|
- assets/images/footer.png
|
227
232
|
- assets/images/footer2-bg.webp
|
228
233
|
- assets/images/header.svg
|
@@ -258,11 +263,14 @@ files:
|
|
258
263
|
- assets/images/twitter-square.svg
|
259
264
|
- assets/images/twitter.svg
|
260
265
|
- assets/images/twitter2.svg
|
266
|
+
- assets/images/twitters.svg
|
261
267
|
- assets/images/uo.svg
|
268
|
+
- assets/images/whatsapp.svg
|
262
269
|
- assets/images/window-close.png
|
263
270
|
- assets/images/window-close.svg
|
264
271
|
- assets/images/word-games-logo.svg
|
265
272
|
- assets/images/word-games-logo.webp
|
273
|
+
- assets/images/wordle.png
|
266
274
|
- assets/images/wordswithletters-logo.png
|
267
275
|
- assets/images/yellow_bg.png
|
268
276
|
- assets/js/TopScroll.js
|
@@ -272,10 +280,12 @@ files:
|
|
272
280
|
- assets/js/advancedFilter.js
|
273
281
|
- assets/js/advancedFilter2.js
|
274
282
|
- assets/js/advancedFilter3.js
|
283
|
+
- assets/js/confetti.js
|
284
|
+
- assets/js/createWordle.js
|
285
|
+
- assets/js/game.js
|
275
286
|
- assets/js/leftNav.js
|
276
287
|
- assets/js/other-lang-wordScrabble.js
|
277
288
|
- assets/js/scrabbleDictonary.js
|
278
|
-
- assets/js/wordGame.js
|
279
289
|
- assets/js/wordScrabble-test.js
|
280
290
|
- assets/js/wordScrabble.js
|
281
291
|
- assets/js/wordleSolver.js
|
data/assets/css/wordGame.css
DELETED
@@ -1,99 +0,0 @@
|
|
1
|
-
.active{
|
2
|
-
display: block;
|
3
|
-
}
|
4
|
-
.close{
|
5
|
-
background-color: transparent;
|
6
|
-
border:none;
|
7
|
-
outline: none;
|
8
|
-
}
|
9
|
-
.times-icon{
|
10
|
-
font-size: 25px;
|
11
|
-
}
|
12
|
-
.modal-header .close{
|
13
|
-
margin: -1rem 0rem -1rem auto !important
|
14
|
-
}
|
15
|
-
.modal-dialog {
|
16
|
-
max-width: 450px !important;
|
17
|
-
margin: 0rem auto !important;
|
18
|
-
top: 60px !important;
|
19
|
-
}
|
20
|
-
.custom-word{
|
21
|
-
width: 60%;
|
22
|
-
margin: 15px auto;
|
23
|
-
padding: 2rem 10px;
|
24
|
-
text-align: center;
|
25
|
-
font-size: 12px;
|
26
|
-
text-transform: uppercase;
|
27
|
-
|
28
|
-
}
|
29
|
-
::placeholder{
|
30
|
-
text-transform: capitalize ;
|
31
|
-
}
|
32
|
-
.generate-word-game-link,.copy-btn{
|
33
|
-
background-color: dodgerblue;
|
34
|
-
border: dodgerblue;
|
35
|
-
color: #fff;
|
36
|
-
padding: 10px;
|
37
|
-
width: 120px;
|
38
|
-
border-radius: 5px;
|
39
|
-
font-size: 12px;
|
40
|
-
}
|
41
|
-
.copy-btn{
|
42
|
-
display: none;
|
43
|
-
}
|
44
|
-
|
45
|
-
.generate-word-game-link:hover,.copy-btn:hover{
|
46
|
-
color:#fff !important
|
47
|
-
}
|
48
|
-
.word-game-rows,.Game-keyboard{
|
49
|
-
display: flex;
|
50
|
-
flex-direction: column;
|
51
|
-
width: 50%;
|
52
|
-
margin:0rem auto
|
53
|
-
}
|
54
|
-
.row{
|
55
|
-
justify-content: center;
|
56
|
-
align-items: center;
|
57
|
-
margin:0 !important
|
58
|
-
|
59
|
-
}
|
60
|
-
.row-letter{
|
61
|
-
text-align: center;
|
62
|
-
border:2px solid #d3d6da;
|
63
|
-
border-radius: 5px;
|
64
|
-
color: #363535;
|
65
|
-
flex: 1 1;
|
66
|
-
font-size: 28px;
|
67
|
-
font-weight: 700;
|
68
|
-
height: 64px;
|
69
|
-
margin: 3px;
|
70
|
-
max-width: 64px;
|
71
|
-
text-transform: uppercase;
|
72
|
-
}
|
73
|
-
.Game-keyboard-row{
|
74
|
-
display: flex;
|
75
|
-
flex-direction: row;
|
76
|
-
justify-content: center;
|
77
|
-
}
|
78
|
-
.Game-keyboard-button {
|
79
|
-
align-items: center;
|
80
|
-
background-color: #d3d6da;
|
81
|
-
border: 2px solid transparent;
|
82
|
-
border-radius: 4px;
|
83
|
-
color: inherit;
|
84
|
-
cursor: pointer;
|
85
|
-
display: flex;
|
86
|
-
font-size: 16px;
|
87
|
-
font-weight: 900;
|
88
|
-
justify-content: center;
|
89
|
-
margin: 3px;
|
90
|
-
min-height: 40px;
|
91
|
-
padding: 15px;
|
92
|
-
text-decoration: inherit;
|
93
|
-
}
|
94
|
-
|
95
|
-
.word-game-link{
|
96
|
-
display: none;
|
97
|
-
font-size: 14px;
|
98
|
-
padding: 14px;
|
99
|
-
}
|