Compare commits
8 Commits
c5ec92d148
...
master
Author | SHA1 | Date | |
---|---|---|---|
2438d6864b | |||
2511d558f8 | |||
3db8f07621 | |||
0546ebd09c | |||
aa11bcb13d | |||
a0493c4733 | |||
f94369256d | |||
ac1a8a37e3 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
Binary file not shown.
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
assets/speaker.png
Normal file
BIN
assets/speaker.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 421 B |
68
index.css
68
index.css
@@ -51,17 +51,22 @@ body {
|
|||||||
.status {
|
.status {
|
||||||
width: 128px;
|
width: 128px;
|
||||||
height: 128px;
|
height: 128px;
|
||||||
opacity: 0;
|
display: none;
|
||||||
background-image: url("assets/fail.png");
|
background-image: url("assets/fail.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
th,
|
th,
|
||||||
td {
|
td {
|
||||||
padding: 16px;
|
padding: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#actiontable{
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.itemcont {
|
.itemcont {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
}
|
}
|
||||||
@@ -70,15 +75,15 @@ td {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin: 10px;
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
margin: auto;
|
|
||||||
padding: auto;
|
padding: auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.itemstor>div {
|
.itemstor>div {
|
||||||
margin: 16px;
|
margin: 8px;
|
||||||
}
|
}
|
||||||
.itemstor>div>p {
|
.itemstor>div>p {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
@@ -88,13 +93,14 @@ td {
|
|||||||
bottom: 4%;
|
bottom: 4%;
|
||||||
left: 4%;
|
left: 4%;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
object-fit: contain;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#vzoritemtd{
|
#vzoritemtd{
|
||||||
width: 50%;
|
width: unset;
|
||||||
height: 50%;
|
height: unset;
|
||||||
overflow: unset;
|
overflow: unset;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.itemholderak{
|
.itemholderak{
|
||||||
@@ -118,7 +124,45 @@ td {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#currentvzor{
|
#currentvzor{
|
||||||
object-fit: contain;
|
width: unset;
|
||||||
width: 50%;
|
height: unset;
|
||||||
height: 50%;
|
}
|
||||||
}
|
|
||||||
|
/* The switch - the box around the slider */
|
||||||
|
.switch {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 128px;
|
||||||
|
height: 128px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide default HTML checkbox */
|
||||||
|
.switch input {
|
||||||
|
opacity: 0;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The slider */
|
||||||
|
.slider {
|
||||||
|
position: absolute;
|
||||||
|
cursor: pointer;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 128px;
|
||||||
|
height: 128px;
|
||||||
|
background-color: red;
|
||||||
|
background-image: url("assets/speaker.png");
|
||||||
|
-webkit-transition: .4s;
|
||||||
|
transition: .4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider {
|
||||||
|
background-color: #00FF00 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:focus + .slider {
|
||||||
|
box-shadow: 0 0 1px #00FF00 !important;
|
||||||
|
}
|
68
index.html
68
index.html
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Sluchová hra</title>
|
<title>Sluchová hra</title>
|
||||||
<link rel="stylesheet" href="index.css" type="text/css"/>
|
<link rel="stylesheet" href="index.css" type="text/css"/>
|
||||||
<script data-website-id="11366cfe-e3d4-4b98-a19f-7ed471a37f71" src="https://umami.brn.systems/umami.js"></script>
|
<script data-website-id="11366cfe-e3d4-4b98-a19f-7ed471a37f71" src="https://umami.brn.systems/script.js"></script>
|
||||||
<script src="jquery.min.js"></script>
|
<script src="jquery.min.js"></script>
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
</head>
|
</head>
|
||||||
@@ -15,53 +15,28 @@
|
|||||||
<audio id="failaudio">
|
<audio id="failaudio">
|
||||||
<source src="assets/fail.ogg" type="audio/ogg">
|
<source src="assets/fail.ogg" type="audio/ogg">
|
||||||
</audio>
|
</audio>
|
||||||
<div id="lettercontainer" class="itemcont">
|
|
||||||
<div id="letterholder" class="itemstor">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="imagecontainer" class="itemcont">
|
|
||||||
<div id="imageholder" class="itemstor">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="activeholder">
|
<div id="activeholder">
|
||||||
<div class="activepart">
|
<div class="activepart">
|
||||||
<table class="activepart">
|
<table class="activepart">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr id="vzoritemtr" align="center">
|
||||||
<td id="vzoritemtd">
|
<td id="vzoritemtd">
|
||||||
<div id="vzoritem">
|
<div id="vzoritem">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr align="center">
|
||||||
<td>
|
<td>
|
||||||
<div id="lettersky" class="activepart">
|
<div id="lettersky" class="activepart">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr align="center">
|
||||||
<td>
|
<td>
|
||||||
<div id="imagesky" class="activepart">
|
<div id="imagesky" class="activepart">
|
||||||
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<div id="verify" class="activepart fixbgimage">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div id="trashcan" class="fixbgimage activepart" ondrop="droptrash(event)" ondragover="allowDrop(event)">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div id="refresh" class="fixbgimage activepart">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -69,5 +44,40 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="lettercontainer" class="itemcont">
|
||||||
|
<div id="letterholder" class="itemstor">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="imagecontainer" class="itemcont">
|
||||||
|
<div id="imageholder" class="itemstor">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="actiontable">
|
||||||
|
<tbody>
|
||||||
|
<tr align="center">
|
||||||
|
<td>
|
||||||
|
<div id="verify" class="activepart fixbgimage">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div id="trashcan" class="fixbgimage activepart" ondrop="droptrash(event)" ondragover="allowDrop(event)">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div id="refresh" class="fixbgimage activepart">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<label class="switch" id="switchcontaineraudio">
|
||||||
|
<input type="checkbox" id="audiocheckbox" checked>
|
||||||
|
<span class="slider fixbgimage" id="visualcheckbox"></span>
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
67
index.js
67
index.js
@@ -4,7 +4,7 @@ var cntdrag = 1;
|
|||||||
//missing Q, CH, DZ, DŽ, Ä, W, X
|
//missing Q, CH, DZ, DŽ, Ä, W, X
|
||||||
let data_tabl = ["A", "Á", "B", "C", "Č", "D", "Ď", "E", "É", "F", "G", "H", "I", "Í", "J", "K", "L", "Ĺ", "Ľ", "M", "N", "Ň", "O", "Ó", "Ô", "P", "R", "Ŕ", "S", "Š", "T", "Ť", "U", "Ú", "V", "Y", "Ý", "Z", "Ž"];
|
let data_tabl = ["A", "Á", "B", "C", "Č", "D", "Ď", "E", "É", "F", "G", "H", "I", "Í", "J", "K", "L", "Ĺ", "Ľ", "M", "N", "Ň", "O", "Ó", "Ô", "P", "R", "Ŕ", "S", "Š", "T", "Ť", "U", "Ú", "V", "Y", "Ý", "Z", "Ž"];
|
||||||
|
|
||||||
let tocount = 7;
|
let tocount = 6;
|
||||||
|
|
||||||
let words = [
|
let words = [
|
||||||
"DOM",
|
"DOM",
|
||||||
@@ -39,8 +39,8 @@ function makeSpaceWord(word){
|
|||||||
imagesky = imagesky + ('<td><div ondrop="drop(event)" id="letterko' + ranid +'" finalplaceindex="' + i +'" ondragover="allowDrop(event)" class="imageplace finalplace finalimageplace place"></td>');
|
imagesky = imagesky + ('<td><div ondrop="drop(event)" id="letterko' + ranid +'" finalplaceindex="' + i +'" ondragover="allowDrop(event)" class="imageplace finalplace finalimageplace place"></td>');
|
||||||
ranid++;
|
ranid++;
|
||||||
}
|
}
|
||||||
lettersky = lettersky + ('<td><div id="letterstatus" class="status fixbgimage"></div></td>');
|
lettersky = lettersky + ('<td id="letterstatus" class="status fixbgimage"></td>');
|
||||||
imagesky = imagesky + ('<td><div id="imagestatus" class="status fixbgimage"></div></td>');
|
imagesky = imagesky + ('<td id="imagestatus" class="status fixbgimage"></td>');
|
||||||
$("#lettersky").html(lettersky);
|
$("#lettersky").html(lettersky);
|
||||||
$("#imagesky").html(imagesky);
|
$("#imagesky").html(imagesky);
|
||||||
}
|
}
|
||||||
@@ -72,9 +72,9 @@ function checkAnswers() {
|
|||||||
let fail = "background-image: url(\"assets/fail.png\");";
|
let fail = "background-image: url(\"assets/fail.png\");";
|
||||||
|
|
||||||
// $('#letterstatus').attr('style', good);
|
// $('#letterstatus').attr('style', good);
|
||||||
// $('#letterstatus').animate({opacity:1}, "slow");
|
// $('#letterstatus').fadeIn();
|
||||||
// setTimeout(function (){
|
// setTimeout(function (){
|
||||||
// $('#letterstatus').animate({opacity:0}, "slow");
|
// $('#letterstatus').fadeOut();
|
||||||
// });
|
// });
|
||||||
var imagecodes = "";
|
var imagecodes = "";
|
||||||
var lettercodes = "";
|
var lettercodes = "";
|
||||||
@@ -92,32 +92,32 @@ function checkAnswers() {
|
|||||||
if (vzorcodes == imagecodes)
|
if (vzorcodes == imagecodes)
|
||||||
{
|
{
|
||||||
$('#imagestatus').attr('style', good);
|
$('#imagestatus').attr('style', good);
|
||||||
$('#imagestatus').animate({opacity:1}, "slow");
|
$('#imagestatus').fadeIn();
|
||||||
setTimeout(function (){
|
setTimeout(function (){
|
||||||
$('#imagestatus').animate({opacity:0}, "slow");
|
$('#imagestatus').fadeOut();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$('#imagestatus').attr('style', fail);
|
$('#imagestatus').attr('style', fail);
|
||||||
$('#imagestatus').animate({opacity:1}, "slow");
|
$('#imagestatus').fadeIn();
|
||||||
setTimeout(function (){
|
setTimeout(function (){
|
||||||
$('#imagestatus').animate({opacity:0}, "slow");
|
$('#imagestatus').fadeOut();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vzorcodes == lettercodes)
|
if (vzorcodes == lettercodes)
|
||||||
{
|
{
|
||||||
$('#letterstatus').attr('style', good);
|
$('#letterstatus').attr('style', good);
|
||||||
$('#letterstatus').animate({opacity:1}, "slow");
|
$('#letterstatus').fadeIn();
|
||||||
setTimeout(function (){
|
setTimeout(function (){
|
||||||
$('#letterstatus').animate({opacity:0}, "slow");
|
$('#letterstatus').fadeOut();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$('#letterstatus').attr('style', fail);
|
$('#letterstatus').attr('style', fail);
|
||||||
$('#letterstatus').animate({opacity:1}, "slow");
|
$('#letterstatus').fadeIn();
|
||||||
setTimeout(function (){
|
setTimeout(function (){
|
||||||
$('#letterstatus').animate({opacity:0}, "slow");
|
$('#letterstatus').fadeOut();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,8 +203,24 @@ function showImages(word) {
|
|||||||
|
|
||||||
var now_count = tmp_tabl.length;
|
var now_count = tmp_tabl.length;
|
||||||
|
|
||||||
|
var tmp2_tabl = [];
|
||||||
|
tmp_tabl.forEach((element) => {
|
||||||
|
if (!tmp2_tabl.includes(element)) {
|
||||||
|
tmp2_tabl.push(element);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tmp_tabl = tmp2_tabl;
|
||||||
|
|
||||||
|
|
||||||
while (now_count < tocount){
|
while (now_count < tocount){
|
||||||
tmp_tabl.push(getRandomElement(data_tabl));
|
var hasORiginal = false;
|
||||||
|
while(!hasORiginal){
|
||||||
|
var newthing = getRandomElement(data_tabl);
|
||||||
|
if (!tmp_tabl.includes(newthing)){
|
||||||
|
tmp_tabl.push(newthing);
|
||||||
|
hasORiginal = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
now_count++;
|
now_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,7 +294,9 @@ function showImages(word) {
|
|||||||
$(".imageholderak, .letterholderak").each(function(){
|
$(".imageholderak, .letterholderak").each(function(){
|
||||||
$(this).on("click", function (e){
|
$(this).on("click", function (e){
|
||||||
let datacode = $(this).attr("datacode");
|
let datacode = $(this).attr("datacode");
|
||||||
document.getElementById("audplay"+ datacode).play();
|
if ($("#audiocheckbox").prop('checked')){
|
||||||
|
document.getElementById("audplay"+ datacode).play();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -320,11 +338,12 @@ function generateItem(word){
|
|||||||
|
|
||||||
$(".itemholderak").each(function(){
|
$(".itemholderak").each(function(){
|
||||||
$(this).on("click", function (e){
|
$(this).on("click", function (e){
|
||||||
let datacode = $(this).attr("datacode");
|
let datacode = $(this).attr("datacode");
|
||||||
try{
|
try{
|
||||||
umami.trackEvent('Listened to image', { type: 'listenimage', datacode: $(this).attr("datacode") });
|
umami.trackEvent('Listened to image', { type: 'listenimage', datacode: $(this).attr("datacode") });
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
document.getElementById("audplayitem"+ datacode).play();
|
|
||||||
|
document.getElementById("audplayitem"+ datacode).play();
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -344,10 +363,6 @@ function generatePair(){
|
|||||||
$(function() {
|
$(function() {
|
||||||
generatePair();
|
generatePair();
|
||||||
|
|
||||||
$("#audiopart").on("click", function (){
|
|
||||||
document.getElementById("audplay").play();
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#verify").on("click", checkAnswers);
|
$("#verify").on("click", checkAnswers);
|
||||||
|
|
||||||
$("#trashcan").on("click", cleanup);
|
$("#trashcan").on("click", cleanup);
|
||||||
@@ -369,7 +384,9 @@ function drag(ev) {
|
|||||||
ev.dataTransfer.setData("datacode", ev.target.getAttribute("datacode"));
|
ev.dataTransfer.setData("datacode", ev.target.getAttribute("datacode"));
|
||||||
ev.dataTransfer.setData("classy", ev.target.classList);
|
ev.dataTransfer.setData("classy", ev.target.classList);
|
||||||
let datacode = $(ev.target).attr("datacode");
|
let datacode = $(ev.target).attr("datacode");
|
||||||
document.getElementById("audplay"+ datacode).play();
|
if ($("#audiocheckbox").prop('checked')){
|
||||||
|
document.getElementById("audplay"+ datacode).play();
|
||||||
|
}
|
||||||
if (ev.target.parentElement.classList.contains("originalplace")){
|
if (ev.target.parentElement.classList.contains("originalplace")){
|
||||||
ev.dataTransfer.setData("dragfromoriginal", "YES");
|
ev.dataTransfer.setData("dragfromoriginal", "YES");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user