diff --git a/deploy.sh b/deploy.sh deleted file mode 100644 index 061a49d..0000000 --- a/deploy.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env sh - -set -e - -npm run build - -cd dist - -echo > .nojekyll - -git init -git checkout -B main -git add -A -git commit -m 'deploy' -git push -f git@github.com:kirilldyachkovskiy/vanilla-tag-game.git main:gh-pages - -cd - diff --git a/dist/assets/index.2be18d96.css b/dist/assets/index.2be18d96.css new file mode 100644 index 0000000..e963ee8 --- /dev/null +++ b/dist/assets/index.2be18d96.css @@ -0,0 +1 @@ +:root{font-family:Inter,Avenir,Helvetica,Arial,sans-serif;font-size:16px;line-height:24px;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}body{text-align:center;margin:0}button{border:0;outline:none;padding:0}.field{margin-inline:auto;width:400px;height:400px;position:relative;border:2px solid chocolate}.field[data-solved=true]{border-color:#daa520}.field[data-solved=true] .field__item{background-color:#daa520}.field__item{border:2px solid brown;font-size:2rem;position:absolute;width:25%;height:25%;top:0;left:0;background-color:#d2691e;color:#fff;transition:.2s}.field__item_empty{opacity:0}.shuffle{font-size:1.5rem;margin-top:2rem;background-color:#d2691e;color:#fff;padding:1rem 2rem;transition:.2s}.shuffle:active{scale:.9}.shuffle:hover,.shuffle:focus-visible{background-color:#daa520} diff --git a/dist/assets/index.3ac3ed75.js b/dist/assets/index.3ac3ed75.js new file mode 100644 index 0000000..2ec6a4c --- /dev/null +++ b/dist/assets/index.3ac3ed75.js @@ -0,0 +1 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function e(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerpolicy&&(s.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?s.credentials="include":n.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(n){if(n.ep)return;n.ep=!0;const s=e(n);fetch(n.href,s)}})();const p=(o,t)=>{const e=[];for(let r=0;r{o.style.transform=`translate3D(${t*100}%, ${e*100}%, 0)`},I=(o,t)=>{for(let e=0;eI(o,(e,{row:r,col:n})=>{k(t[e-1],r,n)}),b=(o,t)=>{for(let e=0;e{var n;const e=[[-1,0],[1,0],[0,-1],[0,1]],r=[];for(let s=0;s{[o[t.row][t.col],o[e.row][e.col]]=[o[e.row][e.col],o[t.row][t.col]]},L=o=>o.flat(),P=o=>L(o).every((t,e,r)=>t>r[e-1]||e===0),w=o=>o[Math.floor(Math.random()*o.length)],a=document.querySelector(".field"),d=Array.from(document.querySelectorAll(".field__item")),h=document.querySelector(".shuffle"),M=100;function N(){if(d.length!==16)throw Error("\u0414\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C 16 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432");const o=d.map(c=>Number(c.innerHTML)),t=p(o,4);m(t,d);let e=b(t,16);const r=c=>{E(t,e,c),m(t,d),e=c,a&&(a.dataset.solved=String(P(t)))};a==null||a.addEventListener("click",c=>{const l=c.target.closest("button"),i=Number(l==null?void 0:l.innerHTML),f=g(t,e).find(([v])=>v===i);if(!f)return;const y=f[1];r(y)}),window.addEventListener("keydown",c=>{var i;const l={...e};switch(c.key){case"ArrowUp":l.col++;break;case"ArrowDown":l.col--;break;case"ArrowLeft":l.row++;break;case"ArrowRight":l.row--;break}((i=t[l.row])==null?void 0:i[l.col])!==void 0&&r(l)});let n=0,s;h==null||h.addEventListener("click",()=>{n=0,clearInterval(s);let c={col:-1,row:-1};s=setInterval(()=>{const l=g(t,e),i=w(l);let u=i[1];u.row===c.row&&u.col===c.col&&(u=w(l.filter(f=>f!==i))[1]),c=e,r(u),n++,n>M&&clearInterval(s)},60)})}N(); diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000..2fe5064 --- /dev/null +++ b/dist/index.html @@ -0,0 +1,33 @@ + + + + + + Tag-game + + + + +

Tag-game

+
+ + + + + + + + + + + + + + + + +
+ + + + diff --git a/dist/tag-game.jpg b/dist/tag-game.jpg new file mode 100644 index 0000000..b57c8bf Binary files /dev/null and b/dist/tag-game.jpg differ