From 52ea991dde54ab64a928a62f75b04dcba43f95cd Mon Sep 17 00:00:00 2001 From: Benson Cho Date: Wed, 24 Apr 2024 17:40:29 +0000 Subject: [PATCH] update version to v1.0.3 --- docs/index.html | 72 +------------------------------------------------ docs/index.js | 2 +- 2 files changed, 2 insertions(+), 72 deletions(-) diff --git a/docs/index.html b/docs/index.html index ad0a967..3129e82 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,71 +1 @@ -
分數: 0
Combo: 0
Next
Hold
旋轉:
移動:
hold/pause:
/ P
速降: space
\ No newline at end of file +
暫停
重新開始
分數: 0
Combo: 0
Next
Hold
旋轉:
移動:
hold/pause:
/ P
速降: space
Hold
\ No newline at end of file diff --git a/docs/index.js b/docs/index.js index 637de61..3539fe0 100644 --- a/docs/index.js +++ b/docs/index.js @@ -1 +1 @@ -(()=>{"use strict";({156:function(){var e,r,t,o,n,i,c,a,y,u,s,l,x,f,d,h,T,g,E,v,p,Y,b,w,P,m,k,S,C,F,O,A,B,_,I,U,j,M,W,D,N,R,L,X,z,G,J,H,Z,V,q,K,Q,ee,re,te,oe=this&&this.__spreadArray||function(e,r,t){if(t||2===arguments.length)for(var o,n=0,i=r.length;n0},O=function(){var e=F(),r=t.DOWN;e?_(r)?B(r):(A(),Q()):h=!0},A=function(){Object.keys(f).forEach((function(e){var r=f[e];r.canMove=!1,y[r.y][r.x]=r,delete f[e]}))},B=function(e,r){void 0===r&&(r=1),Object.keys(f).forEach((function(t){var o=M(f[t].x,f[t].y,e,r),n=o.x-f[t].x,i=o.y-f[t].y;f[t].x=o.x,f[t].y=o.y,f[t].groupX=f[t].groupX+n,f[t].groupY=f[t].groupY+i}))},_=function(e,r){void 0===r&&(r=1);var t=!0;return Object.keys(f).forEach((function(o){var n=M(f[o].x,f[o].y,e,r);I(n.x,n.y)||(t=!1)})),a.log("canMoveGroup type "+e+" canMove "+t+" index "+r),t},I=function(e,r){return!(e<0||e>=p.grid_cols||r<0||r>=p.grid_rows||y[r][e])},U=function(){var e=Object.keys(f),t=f[e[0]].groupX,o=f[e[0]].groupY,n=f[e[0]].groupId,i=function(e){switch(e){case r.TYPE1:return r.TYPE2;case r.TYPE2:return r.TYPE3;case r.TYPE3:return r.TYPE4;case r.TYPE4:return r.TYPE1}}(f[e[0]].rotation),c=f[e[0]].cubeType,y=b[c];if(N(t,o,y.bodyArray(i)))return a.log("can Rotation"),j(),y.bodyArray(i).forEach((function(e){R(t,o,t+e.x,o+e.y,n,y.color,c,i)})),!0;a.log("can not Rotation")},j=function(){Object.keys(f).forEach((function(e){delete f[e]}))},M=function(e,r,o,n){switch(o){case t.DOWN:r+=n;break;case t.LEFT:e-=n;break;case t.RIGHT:e+=n}return{x:e,y:r}},W=function(){var r=Object.values(e)[Math.floor(Object.keys(b).length*Math.random())];return{cubeType:r,cubeItem:b[r]}},D=function(e,t){var o=W(),n=o.cubeType,i=o.cubeItem;if(!s){var c=W();s=c.cubeItem,l=c.cubeType}var y="group"+(new Date).getTime();a.warn("cubeItem",s),N(e,s.startY,s.bodyArray(r.TYPE1))?(s.bodyArray(r.TYPE1).forEach((function(t){R(e,s.startY,e+t.x,s.startY+t.y,y,s.color,l,r.TYPE1)})),Z(i),s=i,l=n):T=!1},N=function(e,r,t){var o=!0;return t.forEach((function(t){I(e+t.x,r+t.y)||(o=!1)})),o},R=function(e,r,t,o,n,i,c,a){for(var y=JSON.parse(JSON.stringify(v)),u=(new Date).getTime()+Math.floor(100*Math.random());f[u];)u=(new Date).getTime()+Math.floor(100*Math.random());y.x=t,y.y=o,y.groupId=n,y.groupX=e,y.groupY=r,y.color=i,y.cellId=u,y.cubeType=c,y.rotation=a,f[u]=y},L=function(){return JSON.parse(JSON.stringify(u))},X=function(){f={},y=[],function(e){u=[];for(var r=0;re?r[t]:e}),0),i={d:p.grid_rows-n},c=0;c0&&u0&&_(t.DOWN,i.d-1)&&(B(t.DOWN,i.d-1),k())}():"Shift"==e.key?function(){var e,t,o=Object.keys(f),n=f[o[0]].groupX,i=f[o[0]].groupY,c=f[o[0]].groupId,a=f[o[0]].cubeType,y=b[a];if(d.cubeItem)e=d.cubeItem,t=d.cubeType;else{var u=W(),s=u.cubeItem,l=u.cubeType;e=s,t=l}if(N(n,i,e.bodyArray(r.TYPE1)))return d={cubeItem:y,cubeType:a},j(),t&&e.bodyArray(r.TYPE1).forEach((function(o){R(n,i,n+o.x,i+o.y,c,e.color,t,r.TYPE1)})),!0;console.error("can not Switch")}()&&(V(),k()):"p"===e.key&&(x?(h=!0,P()):(h=!1,m())))})),$("#pause").click((function(){h=!0,P()})),$("#continue").click((function(){x||(h=!1,m())})),$("#restart").click((function(){$("#game-over").hide(),P(),h=!1,T=!0,X(),g=0,m()}))},J=function(e,r,t){var o=e||n,i=r||p.grid_cols,c=t||p.grid_rows,a=o.getContext("2d");if(a&&o){var y=a.createLinearGradient(0,0,0,300);y.addColorStop(0,"#e0e0e0"),y.addColorStop(1,"#ffffff"),a.fillStyle=y,a.fillRect(0,0,o.width,o.height),a.lineWidth=p.lineWidth,a.strokeStyle=p.ctxStrokeStyle,a.beginPath();for(var u=0;u{"use strict";var e={715:(e,t,r)=>{r.d(t,{A:()=>c});var n=r(601),o=r.n(n),i=r(314),a=r.n(i)()(o());a.push([e.id,'html,body{height:100%;margin:0px}.container{padding:5px;position:relative;background-color:#fffff4}.container .main-view .canvas-wrapper{margin-right:10px;height:calc(100% - 40px)}.container .main-view .canvas-wrapper #canvas{height:100%;text-align:center;background:#fffff4}.container .main-view .canvas-wrapper #game-over{position:absolute;top:0px;left:0px;display:none;height:100%;width:100%}.container .main-view .game-group-btn{margin-top:3px}.container .score-board{vertical-align:top}.container .score-board .operation-intro{display:flex;flex-direction:column;border:1px solid #181804;border-radius:4px;padding:10px}.container .mobile-btns{margin-bottom:20px;width:80%}.container .mobile-btns .cube-control .down-arrow>div>div{transform:rotate(270deg)}.container .mobile-btns .cube-control .hold-btn{margin-right:10px}.container .mobile-btns .cube-control .hold-btn>div{padding:11px 19px;border-radius:30px !important}.container .mobile-btns .cube-control .rotation>div{padding:11px 19px;border-radius:30px !important}.container .mobile-btns .arrow-btn{width:100%}.container .mobile-btns .arrow-btn .right-arrow>div>div{transform:rotate(180deg)}.container .mobile-btns .space-wrapper{height:50px;width:100%}.container .mobile-btns .space-wrapper .space-btn{align-items:end;padding:10px 20px;height:40px;position:relative}.container .mobile-btns .space-wrapper .space-btn:hover{animation:changeHeight .2s ease-in-out forwards}.container .mobile-btns .space-wrapper .space-btn::after{content:" ";height:80px}.container .mobile-btns .space-wrapper .space-btn .shape-border{width:50%;height:100%;border:1px solid;border-radius:10px}.container .mobile-btns .space-wrapper .space-btn .space-left{border-right:0px;transform:skewX(-20deg);border-top-right-radius:0px;border-bottom-right-radius:0px;box-shadow:-5px 3px 4px rgba(0,0,0,.4)}.container .mobile-btns .space-wrapper .space-btn .space-right{margin-left:-30px;border-left:0px;transform:skewX(20deg);border-top-left-radius:0px;border-bottom-left-radius:0px;box-shadow:5px 3px 4px rgba(0,0,0,.4)}.square-btn{display:flex;flex-direction:row;align-items:end;height:40px}.square-btn>div{display:flex;width:100%;padding:2px 10px;box-shadow:0px 2px 6px rgba(0,0,0,.4);flex-direction:row;align-items:center;justify-content:center;flex:1;border:1px solid #000;border-radius:5px;font-size:20px}.square-btn>div:hover{animation:clickSquareBtn .1s ease-in-out forwards}.flex{flex:1}.flex-row{display:flex;flex-direction:row}.flex-column{display:flex;flex-direction:column}.align-center{align-items:center}.content-center{justify-content:center}.content-end{justify-content:end}.content-s-b{justify-content:space-between}.h-100{height:100%}.h-80{height:100%}.w-100{width:100%}.p-relative{position:relative}.ta-l{text-align:left}.ta-c{text-align:center}.fs-0{font-size:0px}.fs-16{font-size:16px}.fs-20{font-size:20px}.mt-10{margin-top:10px}.mr-2{margin-right:2px}.mr-5{margin-right:5px}@keyframes changeHeight{from{margin-top:0px;height:40px}to{margin-top:3px;height:37px}}@keyframes clickSquareBtn{from{margin-top:0px;height:28px}to{margin-top:3px;height:25px}}',""]);const c=a},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var c=0;c0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=i),r&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=r):l[2]=r),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),t.push(l))}},t}},601:e=>{e.exports=function(e){return e[1]}},2:(e,t,r)=>{r.r(t),r.d(t,{default:()=>b});var n=r(72),o=r.n(n),i=r(825),a=r.n(i),c=r(659),s=r.n(c),u=r(56),l=r.n(u),p=r(540),f=r.n(p),d=r(113),y=r.n(d),x=r(715),h={};h.styleTagTransform=y(),h.setAttributes=l(),h.insert=s().bind(null,"head"),h.domAPI=a(),h.insertStyleElement=f(),o()(x.A,h);const b=x.A&&x.A.locals?x.A.locals:void 0},72:e=>{var t=[];function r(e){for(var r=-1,n=0;n{var t={};e.exports=function(e,r){var n=function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},56:(e,t,r)=>{e.exports=function(e){var t=r.nc;t&&e.setAttribute("nonce",t)}},825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(r){!function(e,t,r){var n="";r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {"));var o=void 0!==r.layer;o&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,o&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var i=r.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,r)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},156:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0},I=function(){var e=j(),t=c.DOWN;e?N(t)?U(t):(B(),pe()):m=!0},B=function(){Object.keys(g).forEach((function(e){var t=g[e];t.canMove=!1,d[t.y][t.x]=t,delete g[e]}))},U=function(e,t){void 0===t&&(t=1),Object.keys(g).forEach((function(r){var n=L(g[r].x,g[r].y,e,t),o=n.x-g[r].x,i=n.y-g[r].y;g[r].x=n.x,g[r].y=n.y,g[r].groupX=g[r].groupX+o,g[r].groupY=g[r].groupY+i}))},N=function(e,t){void 0===t&&(t=1);var r=!0;return Object.keys(g).forEach((function(n){var o=L(g[n].x,g[n].y,e,t);D(o.x,o.y)||(r=!1)})),f.log("canMoveGroup type "+e+" canMove "+r+" index "+t),r},D=function(e,t){return!(e<0||e>=Y.grid_cols||t<0||t>=Y.grid_rows||d[t][e])},W=function(){var e=Object.keys(g),t=g[e[0]].groupX,r=g[e[0]].groupY,n=g[e[0]].groupId,o=function(e){switch(e){case a.TYPE1:return a.TYPE2;case a.TYPE2:return a.TYPE3;case a.TYPE3:return a.TYPE4;case a.TYPE4:return a.TYPE1}}(g[e[0]].rotation),i=g[e[0]].cubeType,c=S[i];if(H(t,r,c.bodyArray(o)))return f.log("can Rotation"),z(),c.bodyArray(o).forEach((function(e){J(t,r,t+e.x,r+e.y,n,c.color,i,o)})),!0;f.log("can not Rotation")},z=function(){Object.keys(g).forEach((function(e){delete g[e]}))},L=function(e,t,r,n){switch(r){case c.DOWN:t+=n;break;case c.LEFT:e-=n;break;case c.RIGHT:e+=n}return{x:e,y:t}},R=function(){var e=Object.values(i)[Math.floor(Object.keys(S).length*Math.random())];return{cubeType:e,cubeItem:S[e]}},X=function(e){var t=R(),r=t.cubeType,n=t.cubeItem;if(!x){var o=R();x=o.cubeItem,h=o.cubeType}var i="group"+(new Date).getTime();f.warn("cubeItem",x),H(e,x.startY,x.bodyArray(a.TYPE1))?(x.bodyArray(a.TYPE1).forEach((function(t){J(e,x.startY,e+t.x,x.startY+t.y,i,x.color,h,a.TYPE1)})),ce(n),x=n,h=r):w=!1},H=function(e,t,r){var n=!0;return r.forEach((function(r){D(e+r.x,t+r.y)||(n=!1)})),n},J=function(e,t,r,n,o,i,a,c){for(var s=JSON.parse(JSON.stringify(P)),u=(new Date).getTime()+Math.floor(100*Math.random());g[u];)u=(new Date).getTime()+Math.floor(100*Math.random());s.x=r,s.y=n,s.groupId=o,s.groupX=e,s.groupY=t,s.color=i,s.cellId=u,s.cubeType=a,s.rotation=c,g[u]=s},q=function(){return JSON.parse(JSON.stringify(y))},G=function(){g={},d=[],function(e){y=[];for(var t=0;te?t[r]:e}),0),o={d:Y.grid_rows-n},i=0;i0&&s0&&N(c.DOWN,o.d-1)&&(U(c.DOWN,o.d-1),M())}()},ne=function(){b?(m=!0,A()):(m=!1,C())},oe=function(){$(document).on("keydown",(function(e){var t=Object.keys(g);if(f.log("e.keyCode",e.key),0!==t.length)switch(e.key){case"ArrowLeft":K();break;case"ArrowRight":Q();break;case"ArrowDown":V();break;case"ArrowUp":ee();break;case" ":re();break;case"Shift":te();break;case"p":ne()}})),$("#pause").on("click",(function(){ne(),ye()})),$("#restart").on("click",(function(){$("#game-over").hide(),A(),m=!1,w=!0,G(),T=0,C()})),$(".hold-btn").on("click",te),$(".rotation").on("click",ee),$(".left-arrow").on("click",K),$(".right-arrow").on("click",Q),$(".down-arrow").on("click",V),$(".space-btn").on("click",re)},ie=function(e,t,r){var n=e||u,o=t||Y.grid_cols,i=r||Y.grid_rows,a=n.getContext("2d");if(a&&n){var c=a.createLinearGradient(0,0,0,300);c.addColorStop(0,"#e0e0e0"),c.addColorStop(1,"#ffffff"),a.fillStyle=c,a.fillRect(0,0,n.width,n.height),a.lineWidth=Y.lineWidth,a.strokeStyle=Y.ctxStrokeStyle,a.beginPath();for(var s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.isMobile=void 0,t.isMobile=function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nc=void 0,r(156)})(); \ No newline at end of file