|
27 | 27 |
|
28 | 28 | })(); |
29 | 29 |
|
30 | | - var $ = function(s) { return document.querySelector(s) }; |
| 30 | + var $ = function(s) { |
| 31 | + return document.querySelector(s); |
| 32 | + }; |
31 | 33 |
|
32 | 34 | var $$ = function(selector){ |
33 | 35 | return [].slice.call(document.querySelectorAll(selector)); |
34 | | - } |
| 36 | + }; |
| 37 | + |
| 38 | + var impress = document.getElementById("impress"); |
35 | 39 |
|
36 | 40 | var canvas = document.getElementById("canvas"); |
37 | 41 | canvas.rotate = canvas.querySelector(".rotate"); |
38 | 42 |
|
| 43 | + document.documentElement.style.height = "100%"; |
| 44 | + |
| 45 | + document.body.style.height = "100%"; |
| 46 | + document.body.style.overflow = "hidden"; |
| 47 | + |
| 48 | + impress.style.position = "absolute"; |
| 49 | + impress.style.top = "50%"; |
| 50 | + impress.style.left = "50%"; |
| 51 | + |
| 52 | + canvas.style["position"] = canvas.rotate.style["position"] = "absolute"; |
| 53 | + canvas.style[_pfx("transformOrigin")] = canvas.rotate.style[_pfx("transformOrigin")] = "top left"; |
| 54 | + canvas.style[_pfx("transition")] = canvas.rotate.style[_pfx("transition")] = "all 1s ease-in-out"; |
| 55 | + |
39 | 56 | canvas.dataset["x"] = "0"; |
40 | 57 | canvas.dataset["y"] = "0"; |
41 | 58 | canvas.dataset["rotate"] = "0"; |
|
57 | 74 | step.rotate = step.rotate || 0; |
58 | 75 | step.scale = step.scale || 1; |
59 | 76 |
|
| 77 | + el.style["position"] = "absolute"; |
60 | 78 | el.style[_pfx("transform")] = "translate(-50%,-50%)" + |
61 | 79 | translate(step.x, step.y) + |
62 | 80 | rotate(step.rotate) + |
63 | | - scale(step.scale) |
| 81 | + scale(step.scale); |
64 | 82 |
|
65 | 83 | }); |
66 | 84 |
|
|
72 | 90 | } |
73 | 91 | el.classList.add("active"); |
74 | 92 |
|
75 | | - document.getElementById("impress").className = "step-" + el.id; |
| 93 | + impress.className = "step-" + el.id; |
76 | 94 |
|
77 | 95 | var target = { |
78 | 96 | rotate: -parseInt(step.rotate, 10), |
|
0 commit comments