On this site, on the music part you can listen a track maintaining your click on it. Below some snippets to play with this opportunity. :-)
edit : actually it may not be intended, it works with Safari.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2015 Thomas Gérard <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
On this site, on the music part you can listen a track maintaining your click on it. Below some snippets to play with this opportunity. :-)
edit : actually it may not be intended, it works with Safari.
(function () { | |
let ratios = []; | |
let resizeIframes = function (iframes, ratio) { | |
let winW = window.innerWidth; | |
iframes.forEach( (iframe,i) => { | |
let [w, h] = [iframe.clientWidth, iframe.clientHeight], | |
_ratio = ratio && ratio[i] || h/w; | |
// set iframe size | |
iframe.style.height = winW*_ratio+'px'; |
let debounce = function (eventName, time, fn) { | |
// locker | |
let locker = function () { | |
let isLocked = false; | |
let unlock = function (boolLock, fn) { | |
setTimeout(function () { | |
isLocked = false; | |
fn(); | |
},time); | |
}; |
(function () { | |
[].slice.call(document.querySelectorAll('span.read-more')) | |
.forEach(function (el, i) { | |
el.onclick = function (e) { | |
if (e.target.classList.contains('read-less')) { return; } | |
var content = this.querySelector('span.read-more-content'); | |
var text = this.childNodes[0]; | |
text.textContent = ''; |
class Vector { | |
constructor(x,y) { | |
this.x = x; | |
this.y = y; | |
} | |
static add (v1,v2) { | |
return new Vector(v1.xv2.x,v1.y+v2.y); | |
} | |
let setSize = function (w,h=w) { | |
this.width = w; | |
this.height = h; | |
}; | |
let createCanvas = (w,h) => { | |
let canvas = document.createElement('canvas'); | |
if (w) { | |
setSize.call(canvas,w,h); | |
} |
Array.prototype.findHalf = function () { | |
return Math.floor(this.length/2); | |
}; | |
Array.prototype.isEmpty = function () { | |
return this.length === 0; | |
}; | |
Array.prototype.first = function () { | |
return this[0]; |
(defn my-last [a] | |
"P01 - find the last box of a list" | |
((fn my-last-recur [b c] | |
(if (empty? c) | |
b | |
(my-last-recur (first c) (rest c)) | |
)) | |
(first a) | |
(rest a)) | |
) |
Array.prototype.pickRand = function () { | |
return this[Math.floor(Math.random()*this.length)]; | |
}; | |
// grammar from Daniel Howe | |
// http://rednoise.org/rita/examples/p5js/HaikuGrammar/#source2 | |
let grammar = { | |
"start": "<5L> <7L> <5L>", | |
"<5L>": "<1> <4>|<1> <3> <1>|<1> <1> <3>|<1> <2> <2>|<1> <2> <1> <1>|<1> <1> <2> <1>|<1> <1> <1> <2>|<1> <1> <1> <1> <1>|<2> <3>|<2> <2> <1>|<2> <1> <2>|<2> <1> <1> <1>|<3> <2>|<3> <1> <1>|<4> <1>|<5>", |