summaryrefslogtreecommitdiff
path: root/minionlivesmatter/templates/assets/tether/examples/dolls
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-03-25 13:13:57 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-03-25 13:13:57 +0100
commitd25ff2bddd44b9dac1ceb248424109d1782dd211 (patch)
tree34fcfd824a1a72e7b4d431b688adcea532b62180 /minionlivesmatter/templates/assets/tether/examples/dolls
parenta2cbdd1b88ac723e5e441c0a3c22636f0a8c4dfd (diff)
downloadmeta-d25ff2bddd44b9dac1ceb248424109d1782dd211.tar.gz
meta-d25ff2bddd44b9dac1ceb248424109d1782dd211.zip
add minionlivesmatter as submodule
Diffstat (limited to 'minionlivesmatter/templates/assets/tether/examples/dolls')
-rw-r--r--minionlivesmatter/templates/assets/tether/examples/dolls/dolls.css18
-rw-r--r--minionlivesmatter/templates/assets/tether/examples/dolls/dolls.js83
-rw-r--r--minionlivesmatter/templates/assets/tether/examples/dolls/index.html7
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>