index.html
<body>
<div>
<img src='images/1.jpg'>
</div>
styles.css
#grid {
display:grid;
width:960px;
height:720px;
grid-template-rows: repeat(5,144px);
grid-template-columns: repeat(6,160px);
}
pieces.js
function pieces() {
var s1="<div class='piece' id='";
var s2="' style='background: url(images/1.jpg) -";
...
var ver=0;
for (var r=0;r<5;r++) {
var hor=0;
for (var c=0;c<6;c++) {
document.write(s1+id+s2+hor+s3+ver+s4);
id++;
hor+=160;
}
ver+=144;
}
}
scramble.js
function scramble() {
var arr=[];
for (var i=0;i<30;i++) arr[i]=i;
Shuffle(arr);
var i=0;
for (var r=1;r<6;r++) {
for (var c=1;c<7;c++) {
...
finished.js
function finished() {
var id=0;
for (var r=1;r<6;r++) {
for (var c=1;c<7;c++) {
...