<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html><html lang='en' class=''>
<head><script src='//production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/og2t/pen/AqlLn?limit=all&page=10&q=app" />
<style class="cp-pen-styles">*,
*:before,
*:after {
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
body {
margin: 0;
padding: 0;
background: #000;
overflow: hidden;
}
.icons-list {
position: absolute;
background: url("https://www.dropbox.com/s/v6plr4aagpfp0nu/iphone5s.png?raw=1") no-repeat;
background-size: 510px 883px;
width: 510px;
height: 883px;
margin: -403px 0 0 -249px;
left: 50%;
top: 50%;
}
.icons-list ul {
position: absolute;
padding: 26px 16px;
background: url("https://www.dropbox.com/s/guzcdl7itxkoecl/bgrd.png?raw=1");
background-size: 320px 568px;
width: 320px;
height: 568px;
left: 89px;
top: 103px;
overflow: hidden;
}
.icons-list ul.shaking .dragging div {
-webkit-animation: none;
animation: none;
}
.icons-list ul.shaking div {
-webkit-animation: shake 0.25s 0s ease-in-out infinite;
animation: shake 0.25s 0s ease-in-out infinite;
}
.icons-list li {
-webkit-transition: opacity, -webkit-transform 0.25s ease-in-out;
transition: opacity, -webkit-transform 0.25s ease-in-out;
transition: opacity, transform 0.25s ease-in-out;
transition: opacity, transform 0.25s ease-in-out, -webkit-transform 0.25s ease-in-out;
cursor: pointer;
list-style: none;
position: absolute;
text-align: center;
font-size: 11px;
color: #000;
font-family: Helvetica, Arial, sans-serif;
}
.icons-list li span {
width: 100%;
display: block;
position: absolute;
text-align: center;
top: 64px;
}
.icons-list li.placeholder {
cursor: auto;
}
.icons-list li.placeholder div {
background: none;
}
.icons-list li.placeholder span {
display: none;
}
.icons-list li.dragging {
-webkit-transition: none;
transition: none;
opacity: 0.75;
}
.icons-list li.dragging div {
-webkit-transform: scale(1.25);
transform: scale(1.25);
}
.icons-list li.dragging div:after {
opacity: 0.75;
}
.icons-list li div {
background: #fff url("https://www.dropbox.com/s/dx2rln3r2cni89c/icons.jpg?raw=1") no-repeat;
background-size: 1440px 60px;
width: 100%;
height: 100%;
border-radius: 12px;
-webkit-transition: -webkit-transform 0.25s ease-out;
transition: -webkit-transform 0.25s ease-out;
transition: transform 0.25s ease-out;
transition: transform 0.25s ease-out, -webkit-transform 0.25s ease-out;
}
.icons-list li div:after {
content: '';
left: 0;
top: 0;
background: #000;
position: absolute;
z-index: 1;
width: 100%;
height: 100%;
border-radius: 12px;
opacity: 0;
}
.icons-list li div.appstore {
background-position: 0px 0px;
}
.icons-list li div.calculator {
background-position: -60px 0px;
}
.icons-list li div.calendar {
background-position: -120px 0px;
}
.icons-list li div.camera {
background-position: -180px 0px;
}
.icons-list li div.clock {
background-position: -240px 0px;
}
.icons-list li div.compass {
background-position: -300px 0px;
}
.icons-list li div.facetime {
background-position: -360px 0px;
}
.icons-list li div.itunesstore {
background-position: -420px 0px;
}
.icons-list li div.mail {
background-position: -480px 0px;
}
.icons-list li div.maps {
background-position: -540px 0px;
}
.icons-list li div.messages {
background-position: -600px 0px;
}
.icons-list li div.music {
background-position: -660px 0px;
}
.icons-list li div.passbook {
background-position: -720px 0px;
}
.icons-list li div.phone {
background-position: -780px 0px;
}
.icons-list li div.photos {
background-position: -840px 0px;
}
.icons-list li div.reminders {
background-position: -900px 0px;
}
.icons-list li div.safari {
background-position: -960px 0px;
}
.icons-list li div.settings {
background-position: -1020px 0px;
}
.icons-list li div.stocks {
background-position: -1080px 0px;
}
.icons-list li div.twitter {
background-position: -1140px 0px;
}
.icons-list li div.weather {
background-position: -1200px 0px;
}
.icons-list li div.newsstand {
background-position: -1260px 0px;
}
.icons-list li div.videos {
background-position: -1320px 0px;
}
.icons-list li div.notes {
background-position: -1380px 0px;
}
.info {
width: 320px;
font-family: Arial, sans-serif;
position: absolute;
z-index: 1000;
left: -300px;
top: 350px;
}
.info h4 {
color: #fff;
margin-bottom: 10px;
}
.info p {
color: #fff;
font-size: 14px;
}
@-webkit-keyframes shake {
0% {
-webkit-transform: rotateZ(-2deg);
transform: rotateZ(-2deg);
}
33.3% {
-webkit-transform: rotateZ(0deg);
transform: rotateZ(0deg);
}
66.6% {
-webkit-transform: rotateZ(2deg);
transform: rotateZ(2deg);
}
100% {
-webkit-transform: rotateZ(0deg);
transform: rotateZ(0deg);
}
}
@keyframes shake {
0% {
-webkit-transform: rotateZ(-2deg);
transform: rotateZ(-2deg);
}
33.3% {
-webkit-transform: rotateZ(0deg);
transform: rotateZ(0deg);
}
66.6% {
-webkit-transform: rotateZ(2deg);
transform: rotateZ(2deg);
}
100% {
-webkit-transform: rotateZ(0deg);
transform: rotateZ(0deg);
}
}
</style></head><body>
<div class="icons-list">
<ul>
<li>
<div class="appstore"><span>App Store</span></div>
</li>
<li>
<div class="calculator"><span>Calculator</span></div>
</li>
<li>
<div class="calendar"><span>Calendar</span></div>
</li>
<li>
<div class="camera"><span>Camera</span></div>
</li>
<li>
<div class="compass"><span>Compass</span></div>
</li>
<li>
<div class="itunesstore"><span>iTunes</span></div>
</li>
<li>
<div class="mail"><span>Mail</span></div>
</li>
<li>
<div class="maps"><span>Maps</span></div>
</li>
<li>
<div class="music"><span>Music</span></div>
</li>
<li>
<div class="passbook"><span>Passbook</span></div>
</li>
<li>
<div class="photos"><span>Photos</span></div>
</li>
<li>
<div class="reminders"><span>Reminders</span></div>
</li>
<li>
<div class="safari"><span>Safari</span></div>
</li>
<li>
<div class="stocks"><span>Stocks</span></div>
</li>
<li>
<div class="weather"><span>Weather</span></div>
</li>
<li>
<div class="facetime"><span>FaceTime</span></div>
</li>
<li>
<div class="newsstand"><span>Newsstand</span></div>
</li>
<li>
<div class="videos"><span>Videos</span></div>
</li>
<li>
<div class="notes"><span>Notes</span></div>
</li>
<li class="placeholder">
<div class="twitter"><span>Twitter</span></div>
</li>
<li>
<div class="phone"><span>Phone</span></div>
</li>
<li>
<div class="messages"><span>Messages</span></div>
</li>
<li>
<div class="clock"><span>Clock</span></div>
</li>
<li>
<div class="settings"><span>Settings</span></div>
</li>
</ul>
<div class="info">
<h4>iOS apps reordering done right :)</h4>
<p>Use mouse to drag and drop (Webkit only)</p>
</div>
</div>
<script src='//production-assets.codepen.io/assets/common/stopExecutionOnTimeout-b2a7b3fe212eaa732349046d8416e00a9dec26eb7fd347590fbced3ab38af52e.js'></script>
<script >(function() {
// Polyfills
var ShuffleGrid, addClass, grid, hasClass, iconsList, removeClass;
addClass = function(el, className) {
if (hasClass(el, className)) {
return;
}
if (el.classList) {
el.classList.add(className);
} else {
el.className += ' ' + className;
}
};
removeClass = function(el, className) {
if (el.classList) {
el.classList.remove(className);
} else {
el.className = el.className.replace(new RegExp("(^|\\b)" + className.split(" ").join("|") + "(\\b|$)", "gi"), " ");
}
};
hasClass = function(el, className) {
if (el.classList) {
return el.classList.contains(className);
} else {
return new RegExp("(^| )" + className + "( |$)", "gi").test(el.className);
}
};
ShuffleGrid = (function() {
var VENDORS;
// Here we go...
class ShuffleGrid {
constructor(context, cols, rows, colSize, rowSize, paddingX = 0, paddingY = 0) {
this.initIndex = this.initIndex.bind(this);
this.addItem = this.addItem.bind(this);
this.shuffleItems = this.shuffleItems.bind(this);
this.snapToGrid = this.snapToGrid.bind(this);
this.positionItem = this.positionItem.bind(this);
this.getPosition = this.getPosition.bind(this);
this.getCell = this.getCell.bind(this);
this.onMousePress = this.onMousePress.bind(this);
this.onMouseMove = this.onMouseMove.bind(this);
this.onMouseRelease = this.onMouseRelease.bind(this);
this.numCells = this.numCells.bind(this);
this.startDrag = this.startDrag.bind(this);
this.stopDrag = this.stopDrag.bind(this);
this.context = context;
this.cols = cols;
this.rows = rows;
this.colSize = colSize;
this.rowSize = rowSize;
this.paddingX = paddingX;
this.paddingY = paddingY;
this.numItems = 0;
this.initIndex();
this.items = [].slice.call(this.context.children);
this.items.forEach((item, id) => {
return this.addItem(item);
});
return;
}
initIndex() {
var i;
this.itemVOs = [];
this.index = new Array(this.rows);
i = 0;
while (i < this.rows) {if (window.CP.shouldStopExecution(1)){break;}if (window.CP.shouldStopExecution(1)){break;}
this.index[i++] = new Array(this.cols);
}
window.CP.exitedLoop(1);
window.CP.exitedLoop(1);
}
addItem(item) {
var col, id, itemVO, position, row;
col = this.numItems % this.cols;
row = Math.floor(this.numItems / this.cols);
position = this.getPosition(row, col);
id = this.numItems;
this.numItems++;
itemVO = {
row: row,
col: col,
item: item,
id: id
};
item.style.width = `${this.colSize}px`;
item.style.height = `${this.rowSize}px`;
item.setAttribute('id', id);
this.positionItem(item, position.x, position.y);
this.index[row][col] = itemVO;
this.itemVOs[id] = itemVO;
if (hasClass(item, 'placeholder')) {
return;
}
item.children[0].style.webkitAnimationDelay = Math.random() * 0.5 + 's';
item.children[0].style.MozAnimationDelay = Math.random() * 0.5 + 's';
item.addEventListener('mousedown', this.onMousePress, false);
return item;
}
shuffleItems() {
var cell, col, hMove, i, item, itemVO, move, row, vMove;
itemVO = this.itemVOs[this.currentItem.getAttribute('id')];
cell = this.getCell(parseInt(this.currentItem.getAttribute('x')), parseInt(this.currentItem.getAttribute('y')));
col = cell.x;
row = cell.y;
if (col === itemVO.col && row === itemVO.row) {
return;
}
hMove = col - itemVO.col;
vMove = row - itemVO.row;
move = [];
if (hMove < 0) {
i = itemVO.col - 1;
while (i >= itemVO.col + hMove) {if (window.CP.shouldStopExecution(2)){break;}if (window.CP.shouldStopExecution(2)){break;}
if (this.index[itemVO.row][i]) {
item = this.index[itemVO.row][i];
item.col++;
this.index[item.row][item.col] = item;
move.push(item);
}
i--;
}
window.CP.exitedLoop(2);
window.CP.exitedLoop(2);
} else {
i = itemVO.col + 1;
while (i <= itemVO.col + hMove) {if (window.CP.shouldStopExecution(3)){break;}if (window.CP.shouldStopExecution(3)){break;}
if (this.index[itemVO.row][i]) {
item = this.index[itemVO.row][i];
item.col--;
this.index[item.row][item.col] = item;
move.push(item);
}
i++;
}
window.CP.exitedLoop(3);
window.CP.exitedLoop(3);
}
if (vMove < 0) {
i = itemVO.row - 1;
while (i >= itemVO.row + vMove) {if (window.CP.shouldStopExecution(4)){break;}if (window.CP.shouldStopExecution(4)){break;}
if (this.index[i][itemVO.col + hMove]) {
item = this.index[i][itemVO.col + hMove];
item.row++;
this.index[item.row][item.col] = item;
move.push(item);
}
i--;
}
window.CP.exitedLoop(4);
window.CP.exitedLoop(4);
} else {
i = itemVO.row + 1;
while (i <= itemVO.row + vMove) {if (window.CP.shouldStopExecution(5)){break;}if (window.CP.shouldStopExecution(5)){break;}
if (this.index[i][itemVO.col + hMove]) {
item = this.index[i][itemVO.col + hMove];
item.row--;
this.index[item.row][item.col] = item;
move.push(item);
}
i++;
}
window.CP.exitedLoop(5);
window.CP.exitedLoop(5);
}
i = 0;
while (i < move.length) {if (window.CP.shouldStopExecution(6)){break;}if (window.CP.shouldStopExecution(6)){break;}
this.snapToGrid(move[i++]);
}
window.CP.exitedLoop(6);
window.CP.exitedLoop(6);
itemVO.row = row;
itemVO.col = col;
this.index[row][col] = itemVO;
}
snapToGrid(itemVO) {
var position;
position = this.getPosition(itemVO.row, itemVO.col);
this.positionItem(itemVO.item, position.x, position.y);
}
positionItem(item, x, y) {
var j, len, vendor;
for (j = 0, len = VENDORS.length; j < len; j++) {if (window.CP.shouldStopExecution(7)){break;}if (window.CP.shouldStopExecution(7)){break;}
vendor = VENDORS[j];
item.style[`${vendor}Transform`] = `translateX(${x}px) translateY(${y}px)`;
}
window.CP.exitedLoop(7);
window.CP.exitedLoop(7);
}
getPosition(row, col) {
var offsetY, position;
// Only used for the iOS demo
if (row > 4) {
offsetY = 20;
} else {
offsetY = 0;
}
position = {
x: col * (this.colSize + this.paddingX),
y: row * (this.rowSize + this.paddingY) + offsetY
};
return position;
}
getCell(x, y) {
var cell;
cell = {
x: Math.max(0, Math.min(this.cols - 1, Math.round(x / (this.colSize + this.paddingX)))),
y: Math.max(0, Math.min(this.rows - 1, Math.round(y / (this.rowSize + this.paddingY))))
};
return cell;
}
onMousePress(event) {
var contextOffset;
this.currentItem = event.currentTarget;
contextOffset = this.context.getBoundingClientRect();
this.originOffset = {
x: event.offsetX + contextOffset.left + 16,
y: event.offsetY + contextOffset.top + 26
};
this.startDrag(this.currentItem);
this.onMouseMove(event);
this.context.addEventListener('mouseup', this.onMouseRelease, false);
this.context.addEventListener('mousemove', this.onMouseMove, false);
this.context.addEventListener('mouseleave', this.onMouseRelease, false);
}
onMouseMove(event) {
var x, y;
x = event.clientX - this.originOffset.x;
y = event.clientY - this.originOffset.y;
this.currentItem.setAttribute('x', x);
this.currentItem.setAttribute('y', y);
this.positionItem(this.currentItem, x, y);
this.shuffleItems();
}
onMouseRelease(event) {
this.currentItem.removeEventListener('mouseout', this.onMouseRelease);
this.stopDrag(this.currentItem);
this.context.removeEventListener('mousemove', this.onMouseMove);
this.snapToGrid(this.itemVOs[this.currentItem.getAttribute('id')]);
}
numCells() {
return this.rows * this.cols;
}
startDrag(item) {
this.zIndex++;
item.style.zIndex = this.zIndex;
addClass(item, 'dragging');
addClass(this.context, 'shaking');
}
stopDrag(item) {
removeClass(item, 'dragging');
removeClass(this.context, 'shaking');
}
};
VENDORS = ['webkit', 'Moz'];
ShuffleGrid.prototype.zIndex = 100;
return ShuffleGrid;
})();
// Time to launch
iconsList = document.querySelector('.icons-list ul');
grid = new ShuffleGrid(iconsList, 4, 6, 60, 60, 16, 28);
}).call(this);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiPGFub255bW91cz4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFBQTtBQUFBLE1BQUEsV0FBQSxFQUFBLFFBQUEsRUFBQSxJQUFBLEVBQUEsUUFBQSxFQUFBLFNBQUEsRUFBQTs7RUFFQSxRQUFBLEdBQVcsUUFBQSxDQUFDLEVBQUQsRUFBSyxTQUFMLENBQUE7SUFDVCxJQUFHLFFBQUEsQ0FBUyxFQUFULEVBQWEsU0FBYixDQUFIO0FBQStCLGFBQS9COztJQUNBLElBQUcsRUFBRSxDQUFDLFNBQU47TUFDRSxFQUFFLENBQUMsU0FBUyxDQUFDLEdBQWIsQ0FBaUIsU0FBakIsRUFERjtLQUFBLE1BQUE7TUFHRSxFQUFFLENBQUMsU0FBSCxJQUFnQixHQUFBLEdBQU0sVUFIeEI7O0VBRlM7O0VBUVgsV0FBQSxHQUFjLFFBQUEsQ0FBQyxFQUFELEVBQUssU0FBTCxDQUFBO0lBQ1osSUFBRyxFQUFFLENBQUMsU0FBTjtNQUNFLEVBQUUsQ0FBQyxTQUFTLENBQUMsTUFBYixDQUFvQixTQUFwQixFQURGO0tBQUEsTUFBQTtNQUdFLEVBQUUsQ0FBQyxTQUFILEdBQWUsRUFBRSxDQUFDLFNBQVMsQ0FBQyxPQUFiLENBQXFCLElBQUksTUFBSixDQUFXLFNBQUEsR0FBWSxTQUFTLENBQUMsS0FBVixDQUFnQ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