CSS


html, body {
	height: 100%;
	margin: 0;
}
#spire {
	position: relative;
	display: block;
	margin-left: -100px;
}
.clip {
    position: absolute;
    width: 100px;
    height: 100px;
    text-align: center;
    font: 16px/100px Arial, Verdana, sans-serif;
	color: #dedede;
	text-shadow: 0 1px #777;
}

JS


var mtChallange1 = new Object({
    'spiral': document.getElementById('spire'),
    'elements': new Array(),

    'makeSpiral': function(x, y) {
        this.spiral.innerHTML = '';
        var dimensions = 100;
        var count = x * y,
            dxi = 0,
            dx = x - dxi,
            dyi = 1,
            dy = y - dyi;
        var dirs = [
            ['left', 1],
            ['top', 1],
            ['left', -1],
            ['top', -1]
            ];
        var di = 0;
        var d = dirs[di];
        
        var top = 0,
            left = 0,
            side = '',
            modifier = 0;
        var bgStart = 240,
            bgStep = 128 / count,
            bgHex, bgColor;
        var i = 0,
            e = null;
        for (i; i < count; i++) {
            side = d[0], modifier = d[1];
            if (side == 'left') {
                left += modifier * dimensions;
                dx--;
                if (dx == 0) {
                    di++;
                    dxi++;
                    dx = x - dxi;
                }
            }
            if (side == 'top') {
                top += modifier * dimensions;
                dy--;
                if (dy == 0) {
                    di++;
                    dyi++;
                    dy = y - dyi;
                }
            }
            d = dirs[di % 4];
            bgHex = Math.round(bgStart - i * bgStep);
            bgHex = bgHex.toString(16);
            bgColor = '#' + bgHex + bgHex + bgHex;

            e = document.createElement('div');
            e.className = 'clip';
            e.style.top = top + 'px';
            e.style.left = left + 'px';
            e.style.backgroundColor = bgColor;
            e.innerHTML = i;
            this.elements.push(e);
        }
    },

    'counter': 0,
    'delay': 10,

    'addElement': function() {
        if (this.counter < this.elements.length) {
            this.spiral.appendChild(this.elements[this.counter]);
            this.counter++;
            setTimeout("mtChallange1.addElement()", mtChallange1.delay);
        }
    },

    'showSpiral': function(cols, rows, delay) {
        this.delay = delay || 20;
        this.makeSpiral(cols, rows);
        this.addElement();
    }
});
mtChallange1.showSpiral(12, 8);



CodePlay Playground as you play with the keyboard:

Console

The CodePlay Code Box Editors Playground is very simple to use, anyone can directly interact with a minimum of knowledge of HTML experience, live an idea or a project. We believe that only 5% of the developers has the full capacity and knowledge of each key on the keyboard. Therefore we decided to put together a single command from the Key [Esc] == 27.
For every need and every situation the keyboard [Esc] key fixes and puts in place the Original Initial Code Box Editors.
All this without losing the contents of each Box Editors .
!Enjoy your CodePlay.


CodePlay Playground is a project based on WordPress entirely revised to have a clean and dynamic HTML output.

Editor:

- [Esc] To reset the Box Editors and the closure of any open window overlay, including the Output (FULL) Preview.

New! - Double Click to Expand /Open & Close All Box Editors

New! - Ctrl + Up/Down to Show /Hide the Footer Bar. This allows hide footer bar when you want, + ESC to Back.

New! - Preview in Full page is now also possible via dblClick on the Vertical Drag-bar. Each keyboard action can be Reset via the ESC button.


Ex.
- Close this? [Esc], or a Click outside.


Front End User - New /Save Post is Now Open, Register *required.
New Play Now