Skip to content

Commit

Permalink
add decomposed gif
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpvar committed Oct 19, 2012
1 parent 12c604a commit 617cf14
Show file tree
Hide file tree
Showing 147 changed files with 51 additions and 5 deletions.
Binary file added demos/drumpad/img/image-001.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-002.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-003.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-004.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-005.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-006.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-007.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-008.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-009.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-010.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-011.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-012.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-013.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-014.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-015.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-016.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-017.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-018.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-019.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-020.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-021.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-022.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-023.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-024.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-025.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/drumpad/img/image-026.jpeg
Binary file added demos/drumpad/img/image-027.jpeg
Binary file added demos/drumpad/img/image-028.jpeg
Binary file added demos/drumpad/img/image-029.jpeg
Binary file added demos/drumpad/img/image-030.jpeg
Binary file added demos/drumpad/img/image-031.jpeg
Binary file added demos/drumpad/img/image-032.jpeg
Binary file added demos/drumpad/img/image-033.jpeg
Binary file added demos/drumpad/img/image-034.jpeg
Binary file added demos/drumpad/img/image-035.jpeg
Binary file added demos/drumpad/img/image-036.jpeg
Binary file added demos/drumpad/img/image-037.jpeg
Binary file added demos/drumpad/img/image-038.jpeg
Binary file added demos/drumpad/img/image-039.jpeg
Binary file added demos/drumpad/img/image-040.jpeg
Binary file added demos/drumpad/img/image-041.jpeg
Binary file added demos/drumpad/img/image-042.jpeg
Binary file added demos/drumpad/img/image-043.jpeg
Binary file added demos/drumpad/img/image-044.jpeg
Binary file added demos/drumpad/img/image-045.jpeg
Binary file added demos/drumpad/img/image-046.jpeg
Binary file added demos/drumpad/img/image-047.jpeg
Binary file added demos/drumpad/img/image-048.jpeg
Binary file added demos/drumpad/img/image-049.jpeg
Binary file added demos/drumpad/img/image-050.jpeg
Binary file added demos/drumpad/img/image-051.jpeg
Binary file added demos/drumpad/img/image-052.jpeg
Binary file added demos/drumpad/img/image-053.jpeg
Binary file added demos/drumpad/img/image-054.jpeg
Binary file added demos/drumpad/img/image-055.jpeg
Binary file added demos/drumpad/img/image-056.jpeg
Binary file added demos/drumpad/img/image-057.jpeg
Binary file added demos/drumpad/img/image-058.jpeg
Binary file added demos/drumpad/img/image-059.jpeg
Binary file added demos/drumpad/img/image-060.jpeg
Binary file added demos/drumpad/img/image-061.jpeg
Binary file added demos/drumpad/img/image-062.jpeg
Binary file added demos/drumpad/img/image-063.jpeg
Binary file added demos/drumpad/img/image-064.jpeg
Binary file added demos/drumpad/img/image-065.jpeg
Binary file added demos/drumpad/img/image-066.jpeg
Binary file added demos/drumpad/img/image-067.jpeg
Binary file added demos/drumpad/img/image-068.jpeg
Binary file added demos/drumpad/img/image-069.jpeg
Binary file added demos/drumpad/img/image-070.jpeg
Binary file added demos/drumpad/img/image-071.jpeg
Binary file added demos/drumpad/img/image-072.jpeg
Binary file added demos/drumpad/img/image-073.jpeg
Binary file added demos/drumpad/img/image-074.jpeg
Binary file added demos/drumpad/img/image-075.jpeg
Binary file added demos/drumpad/img/image-076.jpeg
Binary file added demos/drumpad/img/image-077.jpeg
Binary file added demos/drumpad/img/image-078.jpeg
Binary file added demos/drumpad/img/image-079.jpeg
Binary file added demos/drumpad/img/image-080.jpeg
Binary file added demos/drumpad/img/image-081.jpeg
Binary file added demos/drumpad/img/image-082.jpeg
Binary file added demos/drumpad/img/image-083.jpeg
Binary file added demos/drumpad/img/image-084.jpeg
Binary file added demos/drumpad/img/image-085.jpeg
Binary file added demos/drumpad/img/image-086.jpeg
Binary file added demos/drumpad/img/image-087.jpeg
Binary file added demos/drumpad/img/image-088.jpeg
Binary file added demos/drumpad/img/image-089.jpeg
Binary file added demos/drumpad/img/image-090.jpeg
Binary file added demos/drumpad/img/image-091.jpeg
Binary file added demos/drumpad/img/image-092.jpeg
Binary file added demos/drumpad/img/image-093.jpeg
Binary file added demos/drumpad/img/image-094.jpeg
Binary file added demos/drumpad/img/image-095.jpeg
Binary file added demos/drumpad/img/image-096.jpeg
Binary file added demos/drumpad/img/image-097.jpeg
Binary file added demos/drumpad/img/image-098.jpeg
Binary file added demos/drumpad/img/image-099.jpeg
Binary file added demos/drumpad/img/image-100.jpeg
Binary file added demos/drumpad/img/image-101.jpeg
Binary file added demos/drumpad/img/image-102.jpeg
Binary file added demos/drumpad/img/image-103.jpeg
Binary file added demos/drumpad/img/image-104.jpeg
Binary file added demos/drumpad/img/image-105.jpeg
Binary file added demos/drumpad/img/image-106.jpeg
Binary file added demos/drumpad/img/image-107.jpeg
Binary file added demos/drumpad/img/image-108.jpeg
Binary file added demos/drumpad/img/image-109.jpeg
Binary file added demos/drumpad/img/image-110.jpeg
Binary file added demos/drumpad/img/image-111.jpeg
Binary file added demos/drumpad/img/image-112.jpeg
Binary file added demos/drumpad/img/image-113.jpeg
Binary file added demos/drumpad/img/image-114.jpeg
Binary file added demos/drumpad/img/image-115.jpeg
Binary file added demos/drumpad/img/image-116.jpeg
Binary file added demos/drumpad/img/image-117.jpeg
Binary file added demos/drumpad/img/image-118.jpeg
Binary file added demos/drumpad/img/image-119.jpeg
Binary file added demos/drumpad/img/image-120.jpeg
Binary file added demos/drumpad/img/image-121.jpeg
Binary file added demos/drumpad/img/image-122.jpeg
Binary file added demos/drumpad/img/image-123.jpeg
Binary file added demos/drumpad/img/image-124.jpeg
Binary file added demos/drumpad/img/image-125.jpeg
Binary file added demos/drumpad/img/image-126.jpeg
Binary file added demos/drumpad/img/image-127.jpeg
Binary file added demos/drumpad/img/image-128.jpeg
Binary file added demos/drumpad/img/image-129.jpeg
Binary file added demos/drumpad/img/image-130.jpeg
Binary file added demos/drumpad/img/image-131.jpeg
Binary file added demos/drumpad/img/image-132.jpeg
Binary file added demos/drumpad/img/image-133.jpeg
Binary file added demos/drumpad/img/image-134.jpeg
Binary file added demos/drumpad/img/image-135.jpeg
Binary file added demos/drumpad/img/image-136.jpeg
Binary file added demos/drumpad/img/image-137.jpeg
Binary file added demos/drumpad/img/image-138.jpeg
Binary file added demos/drumpad/img/image-139.jpeg
Binary file added demos/drumpad/img/image-140.jpeg
Binary file added demos/drumpad/img/image-141.jpeg
Binary file added demos/drumpad/img/image-142.jpeg
Binary file added demos/drumpad/img/image-143.jpeg
Binary file added demos/drumpad/img/image-144.jpeg
Binary file added demos/drumpad/img/image-145.jpeg
6 changes: 5 additions & 1 deletion demos/drumpad/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
<meta name="viewport" content="width=device-width">

</head>
<body>
<body>
<div style="margin: 0 auto; border: 1px solid #000; width: 600px; height: 337px" id="image">
<img width="600" src="https://twimg0-a.akamaihd.net/profile_images/2558188794/ko6lqflywk079x0mn5gn.png" />
</div>

<audio id="kick" src="kick.wav"></audio>
<audio id="ding" src="ding.wav"></audio>
<audio id="catmeow" src="catmeow.wav"></audio>
Expand Down
50 changes: 46 additions & 4 deletions demos/drumpad/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,51 @@ var sounds = {
3: document.querySelector('#meow')
}

var images = window.images = [];
for (var i = 1; i<144; i++) {
var seq = i + "";
while(seq.length < 3) {
seq = "0" + seq;
}
var img = new Image();
img.src = "/img/image-" + seq + '.jpeg';
img.width = 600;
images.push(img)
}

var animations = [
{ start : 11, end : 38, fps : 60 },
{ start : 1, end : 10 },
{ start : 50, end : 70 },
{ start : 105, end : 120, fps : 6 }
];

var bouncy = {};

var imageHolder = document.getElementById('image');
var timer, idx = 1;
socket.on('hit', function(hit) {
console.log(+new Date())
var element = sounds[hit.pad]
element.currentTime = 0
element.play()
var element = sounds[hit.pad];
var now = Date.now();
if (!bouncy[hit.pad] || now - bouncy[hit.pad] > 150) {
bouncy[hit.pad] = now;
} else { return; }

var animation = animations[hit.pad];

element.currentTime = 0;
idx = animation.start;
clearInterval(timer);
timer = setInterval(function() {
imageHolder.innerHTML = "";
imageHolder.appendChild(images[idx++]);
if (idx >= animation.end) {
if (animation.loop) {
idx = animation.start;
} else {
clearInterval(timer);
}
}
}, 1000/(animation.fps || 30));
element.play();
})

0 comments on commit 617cf14

Please sign in to comment.