29 karma · joined September 19, 2010
In fact, extrapolating further, perhaps in 10 years, the entire keyboard (and touchpad) will eventually become one giant touch screen, with location specific haptic feedback. By then, the younger generation of programmers who grew up in the age of touch screen phones and ipads will not miss the real keyboards (like we don't miss the blackberries). And that one giant touchscreen will be infinitely more customizable.
var OVERLAP = 2500;
var RECENTLY_PLAYED_NODES_LENGTH = 21;
var recentlyPlayedNodes = [];
var audioDurationFix = function(audio) {
if ($(audio).attr('id') === 'ive-13') {
return 3.0;
}
return audio.duration;
}
var randomNode = function() {
var newNode = $('#ive-'+(1+Math.floor(Math.random()*$('audio').length)))[0];
if (recentlyPlayedNodes.indexOf(newNode) === -1) {
recentlyPlayedNodes.push(newNode);
if (recentlyPlayedNodes.length > RECENTLY_PLAYED_NODES_LENGTH) {
recentlyPlayedNodes.shift();
}
return newNode;
} else {
return randomNode();
}
}
var playNext = function() {
var audioNode = randomNode();
$(audioNode).on('timeupdate', function() {
if (audioNode.currentTime * 1000 > audioDurationFix(audioNode) * 1000 - OVERLAP) {
$(audioNode).off('timeupdate');
playNext();
}
});
audioNode.play();
}
playNext();I see when you activate a file, the animation first shrinks the file a bit and then expands it out. Is it possible to remove the shrinking? It makes the app "feel" a bit jerky. I think the reason is when you shrink the activating file, all other files expand by a bit. This causes the whole screen shifting a bit, leading to a somewhat jarring experience for a split second.
But anyway, the whole thing seems pretty cool.