{"id":1071,"date":"2021-08-19T10:03:48","date_gmt":"2021-08-19T08:03:48","guid":{"rendered":"https:\/\/ertha.cz\/?p=1071"},"modified":"2021-08-19T12:24:40","modified_gmt":"2021-08-19T10:24:40","slug":"slozte-si-cover-art","status":"publish","type":"post","link":"https:\/\/ertha.cz\/gb\/novinky\/slozte-si-cover-art\/","title":{"rendered":"Slo\u017ete si cover art!"},"content":{"rendered":"\n<p>Cht\u011bli jsme v\u00e1m uk\u00e1zat cover art k tomu albu, co na n\u011bm piln\u011b d\u011bl\u00e1me. \u017del, rozsypal se na kous\u00ed\u010dky a pak se je\u0161t\u011b zam\u00edchal. <strong>K tomu, abyste jej vid\u011bli cel\u00fd, tedy mus\u00edte slo\u017eit posouva\u010dkov\u00e9 puzzle.<\/strong> Obr\u00e1zek pak na v\u00e1s s\u00e1m vysko\u010d\u00ed v nov\u00e9m okn\u011b nebo tabu.<\/p>\n\n\n\n<script>\nfunction swapTiles(cell1,cell2) {\n  var temp = document.getElementById(cell1).className;\n  document.getElementById(cell1).className = document.getElementById(cell2).className;\n  document.getElementById(cell2).className = temp;\n}\n\nfunction shuffle() {\n\/\/Use nested loops to access each cell of the 3x3 grid\nfor (var row=1;row<=3;row++) { \/\/For each row of the 3x3 grid\n   for (var column=1;column<=3;column++) { \/\/For each column in this row\n  \n    var row2=Math.floor(Math.random()*3 + 1); \/\/Pick a random row from 1 to 3\n    var column2=Math.floor(Math.random()*3 + 1); \/\/Pick a random column from 1 to 3\n     \n    swapTiles(\"cell\"+row+column,\"cell\"+row2+column2); \/\/Swap the look &#038; feel of both cells\n  } \n} \n}\n\nfunction win() {\n  window.open(\"https:\/\/ertha.cz\/wp-content\/uploads\/2021\/08\/cover_front_small.jpg\");\n}\n\nfunction winCond() {\n  if(document.getElementById(\"cell11\").className != \"tile1\") return;\n  if(document.getElementById(\"cell12\").className != \"tile2\") return;\n  if(document.getElementById(\"cell13\").className != \"tile3\") return;\n  if(document.getElementById(\"cell21\").className != \"tile4\") return;\n  if(document.getElementById(\"cell22\").className != \"tile5\") return;\n  if(document.getElementById(\"cell23\").className != \"tile6\") return;\n  if(document.getElementById(\"cell31\").className != \"tile7\") return;\n  if(document.getElementById(\"cell32\").className != \"tile8\") return;\n  if(document.getElementById(\"cell33\").className != \"tile9\") return;\n\n  win();\n}\n\n\nfunction clickTile(row,column) {\n  var cell = document.getElementById(\"cell\"+row+column);\n  var tile = cell.className;\n  if (tile!=\"tile9\") { \n       \/\/Checking if white tile on the right\n       if (column<3) {\n         if ( document.getElementById(\"cell\"+row+(column+1)).className==\"tile9\") {\n           swapTiles(\"cell\"+row+column,\"cell\"+row+(column+1));\n           winCond();\n           return;\n         }\n       }\n       \/\/Checking if white tile on the left\n       if (column>1) {\n         if ( document.getElementById(\"cell\"+row+(column-1)).className==\"tile9\") {\n           swapTiles(\"cell\"+row+column,\"cell\"+row+(column-1));\n           winCond();\n           return;\n         }\n       }\n         \/\/Checking if white tile is above\n       if (row>1) {\n         if ( document.getElementById(\"cell\"+(row-1)+column).className==\"tile9\") {\n           swapTiles(\"cell\"+row+column,\"cell\"+(row-1)+column);\n           winCond();\n           return;\n         }\n       }\n       \/\/Checking if white tile is below\n       if (row<3) {\n         if ( document.getElementById(\"cell\"+(row+1)+column).className==\"tile9\") {\n           swapTiles(\"cell\"+row+column,\"cell\"+(row+1)+column);\n           winCond();\n           return;\n         }\n       } \n  }\n  \n}\n<\/script>\n<style>\nBODY { \nbackground: #AAAAAA;\n}\n\n.tile1, .tile2, .tile3, .tile4, .tile5, .tile6, .tile7, .tile8, .tile9 {\n  display: table-cell;\n  width: 200px;\n  height: 200px;\n  border: 1px solid white;\n  background: url(\"https:\/\/ertha.cz\/wp-content\/uploads\/2021\/08\/cover_front_small.jpg\");\nbackground-size: 600px 600px; \n  cursor: pointer;\n}\n\n.tile1 {background-position: left top;}\n.tile2 {background-position: center top;}\n.tile3 {background-position: right top;}\n.tile4 {background-position: left center;}\n.tile5 {background-position: center center;}\n.tile6 {background-position: right center;}\n.tile7 {background-position: left bottom;}\n.tile8 {background-position: center bottom;}\n.tile9 {background: white; cursor: default;}\n<\/style>\n\n<center><div id=\"table\" style=\"display: table;\">\n   <div id=\"row1\" style=\"display: table-row;\">\n      <div id=\"cell11\" class=\"tile1\" onClick=\"clickTile(1,1);\"><\/div>\n      <div id=\"cell12\" class=\"tile2\" onClick=\"clickTile(1,2);\"><\/div>\n      <div id=\"cell13\" class=\"tile3\" onClick=\"clickTile(1,3);\"><\/div>\n   <\/div>\n   <div id=\"row2\" style=\"display: table-row;\">\n      <div id=\"cell21\" class=\"tile4\" onClick=\"clickTile(2,1);\"><\/div>\n      <div id=\"cell22\" class=\"tile5\" onClick=\"clickTile(2,2);\"><\/div>\n      <div id=\"cell23\" class=\"tile6\" onClick=\"clickTile(2,3);\"><\/div>\n   <\/div>\n   <div id=\"row3\" style=\"display: table-row;\">\n      <div id=\"cell31\" class=\"tile7\" onClick=\"clickTile(3,1);\"><\/div>\n      <div id=\"cell32\" class=\"tile8\" onClick=\"clickTile(3,2);\"><\/div>\n      <div id=\"cell33\" class=\"tile9\" onClick=\"clickTile(3,3);\"><\/div>\n   <\/div>\n<\/div>\n  <button onClick=\"shuffle();\">znovu?<\/button>\n<\/center>\n<script>\nshuffle();\n<\/script>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Cht\u011bli jsme v\u00e1m uk\u00e1zat cover art k tomu albu, co na n\u011bm piln\u011b d\u011bl\u00e1me. \u017del, rozsypal se na kous\u00ed\u010dky a pak se je\u0161t\u011b zam\u00edchal. K <a class=\"mh-excerpt-more\" href=\"https:\/\/ertha.cz\/gb\/novinky\/slozte-si-cover-art\/\" title=\"Slo\u017ete si cover art!\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"translation":{"provider":"WPGlobus","version":"2.12.2","language":"gb","enabled_languages":["cz","gb"],"languages":{"cz":{"title":true,"content":true,"excerpt":false},"gb":{"title":false,"content":false,"excerpt":false}}},"_links":{"self":[{"href":"https:\/\/ertha.cz\/gb\/wp-json\/wp\/v2\/posts\/1071"}],"collection":[{"href":"https:\/\/ertha.cz\/gb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ertha.cz\/gb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ertha.cz\/gb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ertha.cz\/gb\/wp-json\/wp\/v2\/comments?post=1071"}],"version-history":[{"count":3,"href":"https:\/\/ertha.cz\/gb\/wp-json\/wp\/v2\/posts\/1071\/revisions"}],"predecessor-version":[{"id":1074,"href":"https:\/\/ertha.cz\/gb\/wp-json\/wp\/v2\/posts\/1071\/revisions\/1074"}],"wp:attachment":[{"href":"https:\/\/ertha.cz\/gb\/wp-json\/wp\/v2\/media?parent=1071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ertha.cz\/gb\/wp-json\/wp\/v2\/categories?post=1071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ertha.cz\/gb\/wp-json\/wp\/v2\/tags?post=1071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}