diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-03-25 13:13:57 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-03-25 13:13:57 +0100 |
| commit | d25ff2bddd44b9dac1ceb248424109d1782dd211 (patch) | |
| tree | 34fcfd824a1a72e7b4d431b688adcea532b62180 /minionlivesmatter/templates/assets/tether/examples/dolls | |
| parent | a2cbdd1b88ac723e5e441c0a3c22636f0a8c4dfd (diff) | |
| download | meta-d25ff2bddd44b9dac1ceb248424109d1782dd211.tar.gz meta-d25ff2bddd44b9dac1ceb248424109d1782dd211.zip | |
add minionlivesmatter as submodule
Diffstat (limited to 'minionlivesmatter/templates/assets/tether/examples/dolls')
3 files changed, 0 insertions, 108 deletions
diff --git a/minionlivesmatter/templates/assets/tether/examples/dolls/dolls.css b/minionlivesmatter/templates/assets/tether/examples/dolls/dolls.css deleted file mode 100644 index 931c0de..0000000 --- a/minionlivesmatter/templates/assets/tether/examples/dolls/dolls.css +++ /dev/null @@ -1,18 +0,0 @@ -.tether-element, .tether-target { - width: 200px; - height: 50px; - background-color: #4cc; - position: absolute; -} -body { - width: 100%; - height: 100%; - overflow: scroll; -} -.scroll { - width: 400%; - height: 400%; -} -.tether-target:not(.tether-element) { - cursor: move; -} diff --git a/minionlivesmatter/templates/assets/tether/examples/dolls/dolls.js b/minionlivesmatter/templates/assets/tether/examples/dolls/dolls.js deleted file mode 100644 index 5d0b06b..0000000 --- a/minionlivesmatter/templates/assets/tether/examples/dolls/dolls.js +++ /dev/null @@ -1,83 +0,0 @@ -var tethers = []; - -document.addEventListener('DOMContentLoaded', function(){ - dragging = null; - - document.body.addEventListener('mouseup', function(){ - dragging = null; - }); - - document.body.addEventListener('mousemove', function(e){ - if (dragging){ - dragging.style.top = e.clientY + 'px'; - dragging.style.left = e.clientX + 'px'; - - Tether.position() - } - }); - - document.body.addEventListener('mousedown', function(e){ - if (e.target.getAttribute('data-index')) - dragging = e.target; - }) - - var count = 60; - var parent = null; - var dir = 'left'; - var first = null; - - while (count--){ - var el = document.createElement('div'); - el.setAttribute('data-index', count); - document.querySelector('.scroll').appendChild(el); - - if (!first) - first = el; - - if (count % 10 === 0) - dir = dir == 'right' ? 'left' : 'right'; - - if (parent){ - tethers.push(new Tether({ - element: el, - target: parent, - attachment: 'middle ' + dir, - targetOffset: (dir == 'left' ? '10px 10px' : '10px -10px') - })); - - } - - parent = el; - } - - initAnim(first); -}); - -function initAnim(el){ - var start = performance.now() - var last = 0; - var lastTop = 0; - var tick = function(){ - var diff = performance.now() - last; - - if (!last || diff > 50){ - last = performance.now(); - - var nextTop = 50 * Math.sin((last - start) / 1000); - - var curTop = parseFloat(el.style.top || 0); - var topChange = nextTop - lastTop; - lastTop = nextTop; - - var top = curTop + topChange; - - el.style.top = top + 'px'; - - Tether.position(); - } - - requestAnimationFrame(tick); - }; - - tick(); -} diff --git a/minionlivesmatter/templates/assets/tether/examples/dolls/index.html b/minionlivesmatter/templates/assets/tether/examples/dolls/index.html deleted file mode 100644 index 8f0167f..0000000 --- a/minionlivesmatter/templates/assets/tether/examples/dolls/index.html +++ /dev/null @@ -1,7 +0,0 @@ -<link rel="stylesheet" href="./dolls.css" /> -<script src="//github.hubspot.com/tether/dist/js/tether.js"></script> -<script src="./dolls.js"></script> -<body> - <div class="scroll"> - </div> -</body> |
