thread safe(lol :)) light ui

This commit is contained in:
garrettdreyfus 2014-05-24 12:48:46 -04:00
parent 01ac3a9553
commit 71eda56c77
2 changed files with 10 additions and 9 deletions

View file

@ -15,7 +15,7 @@
body {
color: #ecf0f1;
font-family: 'Roboto', sans-serif;
background-color:#2c3e50;
background-color:#ecf0f1;
}
#clickToExit {
@ -27,13 +27,14 @@
left: calc(50% - 80vmin / 2);
height: 80vmin;
width: 80vmin;
background: -webkit-radial-gradient(#2980b9 35%, rgba(44,62,80,50) 68%);
background-color:#ecf0f1;
z-index:3;
}
#title {
z-index:99999;
margin-top:20px;
color:#2c3e50;
}
</style>
</head>
@ -58,4 +59,4 @@
<script type = 'text/javascript' src="js/main.js"></script>
<script type = 'text/javascript' src="js/analytics.js"></script>
</body>
</html>
</html>

View file

@ -1,4 +1,3 @@
var deleting;
function search(twoD,oneD){
for(var i=0;i<twoD.length;i++){
if(twoD[i][0] == oneD[0] && twoD[i][1] == oneD[1]) {
@ -7,9 +6,9 @@ function search(twoD,oneD){
}
return false;
}
function floodFill(clock,side,index) {
function floodFill(clock,side,index,deleting) {
if(clock.blocks[side] === undefined || clock.blocks[side][index] === undefined){return;}
var color = clock.blocks[side][index].color;
var color = clock.blocks[side][index].color;
for(var x =-1;x<2;x++){
for(var y =-1;y<2;y++){
if(Math.abs(x)==Math.abs(y)){continue;}
@ -17,7 +16,7 @@ function floodFill(clock,side,index) {
if(clock.blocks[(side+x+clock.sides)%clock.sides][index+y] !== undefined){
if(clock.blocks[(side+x+clock.sides)%clock.sides][index+y].color == color && search(deleting,[(side+x+clock.sides)%clock.sides,index+y]) === false) {
deleting.push([(side+x+clock.sides)%clock.sides,index+y]);
floodFill(clock,(side+x+clock.sides)%clock.sides,index+y);
floodFill(clock,(side+x+clock.sides)%clock.sides,index+y,deleting);
}
}
}
@ -25,9 +24,10 @@ function floodFill(clock,side,index) {
}
function consolidateBlocks(clock,side,index){
var sidesChanged =[];
deleting=[];
var deleting=[];
deleting.push([side,index]);
floodFill(clock,side,index);
floodFill(clock,side,index,deleting);
var deleteList= deleting;
if(deleteList.length<3){return;}
var i;