/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
body {
background:#222 none repeat scroll 0 0;
color:#666;
font-family:Helvetica;
font-size:72%;
line-height:1.5em;
margin:0;
border-top:1px solid #393939;
}
#container:after {
content:'';
position:relative;
clear:both;
height:0;
font-size:0%;
float:none;
}
.wrapper {
width:310px;
margin:0 auto;
padding-top:50px;
max-width: 98%;
}
h1 {
text-align:center;
font-size:1.2em;
font-family:Arial;
color:#333;
margin-bottom:10px;
}
h4, h4 a {
font-family:Arial, Helvetica, sans-serif;
text-align:center;
font-size:.8em;
text-decoration:none;
}
h4 a {
color:#479937;
}
p {
text-align:center;
margin:auto;
margin-bottom:20px;
font-family:Arial;
font-size:12px;
line-height:18px;
color:#666;
}
#container {
background:#eee;
border:1px solid #ddd;
width:460px;
/* height: 230%; */
margin:auto;
max-width: 100%;
overflow: hidden;
padding-bottom: 2.5%;
}
.tile_box {
display:block;
float:left;
width: 17%;
height: 28%;
background:#ddd;
margin-left: 2.5%;
...
JavaScript
/*
Ext.application({
name: 'Concentrate',
launch: function() {
var panel = Ext.create('Ext.Panel', {
layout: 'box',
items: [
{
xtype: 'panel',
flex: 3,
html: ['<div class="wrapper"><h1>Social Concentration Game</h1>',
'<p>This is a simple concentration game made by Opensource code. In the boxes you will find same social media icons repeatedly!</p>',
'<div id="container"></div>',
'<h4>Created by <a href="">Seetpal singh</a></h4><center> <h4 id="results"></h4><h4 id="debug"></h4></center></div>'
].join('')
}
]
});
Ext.Viewport.add(panel);
}
});
*/
//tile object
function tile_box() {
this.tile_type;
this.addToScene = function (id) {
document.getElementById('container').innerHTML += '<span href="#" id="' + id + '" data-type="' + this.tile_type + '" class="tile_box"><i class="fa fa-question"></i></span>';
}
}
//variables
var number_of_tiles = 20;
var tiles_per_row = 5;
var openings = 0;
var tries = 0;
var tiles = new Array();
var tile = new tile_box();
var picked_tiles = new Array();
var can_pick = true;
var pictures = ['<i class="fa fa-dribbble"></i></span>',
'<i class="fa fa-dropbox"></i></span>',
'<i class="fa fa-twitter"></i></span>',
'<i class="fa fa-facebook"></i></span>',
'<i class="fa fa-github"></i></span>',
'<i class="fa fa-linkedin"></i></span>',
'<i class="fa fa-youtube"></i></span>',
'<i class="fa fa-flickr"></i></span>',
'<i class="fa fa-skype"></i></span>',
'<i class="fa fa-foursquare"></i></span>', ];
function givePic(i) {
return pictures[i];
}
//tiles creation loop
for (var i = 0; i < number_of_tiles; i++) {
tiles.push(Math.floor(i / 2));
}
//shuffling loop
var swap, tmp;
for (var i = number_of_tiles - 1; i > 0; i--) {
swap = Math.floor(Math.random() * i);
tmp = tiles[i];
tiles[i] = tiles[swap];
tiles[swap] = tmp;
}
//tile placing loop
for (var i = 0; i <...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.