|
10 | 10 | <script src="../dist/tracker/color/color.min.js"></script> |
11 | 11 |
|
12 | 12 | <style> |
13 | | - * { |
14 | | - margin: 0; |
15 | | - padding: 0; |
16 | | - } |
17 | | - canvas { |
18 | | - -moz-transform: scale(-1, 1); |
19 | | - -o-transform: scale(-1, 1); |
20 | | - -webkit-transform: scale(-1, 1); |
21 | | - filter: FlipH; |
22 | | - transform: scale(-1, 1); |
23 | | - top: 0; |
24 | | - left: 0; |
25 | | - width: 100%; |
26 | | - height: 100%; |
27 | | - position: absolute; |
28 | | - } |
29 | | - .hue { |
30 | | - -webkit-filter: hue-rotate(328deg); |
31 | | - -webkit-animation: hue 3s infinite; |
32 | | - -moz-animation: hue 3s infinite; |
33 | | - -o-animation: hue 3s infinite; |
34 | | - animation: hue 3s infinite; |
35 | | - } |
36 | | - @-webkit-keyframes hue { |
37 | | - 0% { -webkit-filter: hue-rotate(1deg); } |
38 | | - 100% { -webkit-filter: hue-rotate(359deg); } |
39 | | - } |
40 | | - @-moz-keyframes hue { |
41 | | - 0% { -webkit-filter: hue-rotate(1deg); } |
42 | | - 100% { -webkit-filter: hue-rotate(359deg); } |
43 | | - } |
44 | | - @-o-keyframes hue { |
45 | | - 0% { -webkit-filter: hue-rotate(1deg); } |
46 | | - 100% { -webkit-filter: hue-rotate(359deg); } |
47 | | - } |
48 | | - @keyframes hue { |
49 | | - 0% { -webkit-filter: hue-rotate(1deg); } |
50 | | - 100% { -webkit-filter: hue-rotate(359deg); } |
51 | | - } |
52 | | - .invert{ |
53 | | - -webkit-filter: invert(1); |
54 | | - -webkit-animation: invert 3s infinite; |
55 | | - -moz-animation: invert 3s infinite; |
56 | | - -o-animation: invert 3s infinite; |
57 | | - animation: invert 3s infinite; |
58 | | - } |
59 | | - @-webkit-keyframes invert { |
60 | | - 0% , 100% { -webkit-filter: invert(0); } |
61 | | - 50% { -webkit-filter: invert(1); } |
62 | | - } |
63 | | - @-moz-keyframes hue { |
64 | | - 0%, 100% { -webkit-filter: invert(0); } |
65 | | - 50% { -webkit-filter: invert(1); } |
66 | | - } |
67 | | - @-o-keyframes hue { |
68 | | - 0% , 100% { -webkit-filter: invert(0); } |
69 | | - 50% { -webkit-filter: invert(1); } |
70 | | - } |
71 | | - @keyframes hue { |
72 | | - 0% , 100% { -webkit-filter: invert(0); } |
73 | | - 50% { -webkit-filter: invert(1); } |
74 | | - } |
| 13 | + * { |
| 14 | + margin: 0; |
| 15 | + padding: 0; |
| 16 | + } |
| 17 | + canvas { |
| 18 | + -moz-transform: scale(-1, 1); |
| 19 | + -o-transform: scale(-1, 1); |
| 20 | + -webkit-transform: scale(-1, 1); |
| 21 | + filter: FlipH; |
| 22 | + transform: scale(-1, 1); |
| 23 | + top: 0; |
| 24 | + left: 0; |
| 25 | + width: 100%; |
| 26 | + height: 100%; |
| 27 | + position: absolute; |
| 28 | + } |
| 29 | + .hue { |
| 30 | + -webkit-filter: hue-rotate(328deg); |
| 31 | + -webkit-animation: hue 3s infinite; |
| 32 | + -moz-animation: hue 3s infinite; |
| 33 | + -o-animation: hue 3s infinite; |
| 34 | + animation: hue 3s infinite; |
| 35 | + } |
| 36 | + @-webkit-keyframes hue { |
| 37 | + 0% { -webkit-filter: hue-rotate(1deg); } |
| 38 | + 100% { -webkit-filter: hue-rotate(359deg); } |
| 39 | + } |
| 40 | + @-moz-keyframes hue { |
| 41 | + 0% { -webkit-filter: hue-rotate(1deg); } |
| 42 | + 100% { -webkit-filter: hue-rotate(359deg); } |
| 43 | + } |
| 44 | + @-o-keyframes hue { |
| 45 | + 0% { -webkit-filter: hue-rotate(1deg); } |
| 46 | + 100% { -webkit-filter: hue-rotate(359deg); } |
| 47 | + } |
| 48 | + @keyframes hue { |
| 49 | + 0% { -webkit-filter: hue-rotate(1deg); } |
| 50 | + 100% { -webkit-filter: hue-rotate(359deg); } |
| 51 | + } |
| 52 | + .invert{ |
| 53 | + -webkit-filter: invert(1); |
| 54 | + -webkit-animation: invert 3s infinite; |
| 55 | + -moz-animation: invert 3s infinite; |
| 56 | + -o-animation: invert 3s infinite; |
| 57 | + animation: invert 3s infinite; |
| 58 | + } |
| 59 | + @-webkit-keyframes invert { |
| 60 | + 0% , 100% { -webkit-filter: invert(0); } |
| 61 | + 50% { -webkit-filter: invert(1); } |
| 62 | + } |
| 63 | + @-moz-keyframes hue { |
| 64 | + 0%, 100% { -webkit-filter: invert(0); } |
| 65 | + 50% { -webkit-filter: invert(1); } |
| 66 | + } |
| 67 | + @-o-keyframes hue { |
| 68 | + 0% , 100% { -webkit-filter: invert(0); } |
| 69 | + 50% { -webkit-filter: invert(1); } |
| 70 | + } |
| 71 | + @keyframes hue { |
| 72 | + 0% , 100% { -webkit-filter: invert(0); } |
| 73 | + 50% { -webkit-filter: invert(1); } |
| 74 | + } |
75 | 75 | </style> |
76 | 76 |
|
77 | 77 | </head> |
78 | 78 | <body> |
79 | 79 |
|
80 | 80 | <script> |
81 | | - var videoCamera = new tracking.VideoCamera().hide().render().renderVideoCanvas(), |
82 | | - canvasClassList = document.querySelector('canvas').classList; |
| 81 | + var videoCamera = new tracking.VideoCamera().hide().render().renderVideoCanvas(), |
| 82 | + canvasClassList = document.querySelector('canvas').classList; |
83 | 83 |
|
84 | | - videoCamera.track({ |
85 | | - type: 'color', |
86 | | - color: 'magenta', |
87 | | - onFound: function(track) { |
88 | | - canvasClassList.add('hue'); |
89 | | - }, |
90 | | - onNotFound: function() { |
91 | | - canvasClassList.remove('hue'); |
92 | | - } |
93 | | - }); |
| 84 | + videoCamera.track({ |
| 85 | + type: 'color', |
| 86 | + color: 'magenta', |
| 87 | + onFound: function(track) { |
| 88 | + canvasClassList.add('hue'); |
| 89 | + }, |
| 90 | + onNotFound: function() { |
| 91 | + canvasClassList.remove('hue'); |
| 92 | + } |
| 93 | + }); |
94 | 94 |
|
95 | | - videoCamera.track({ |
96 | | - type: 'color', |
97 | | - color: 'cyan', |
98 | | - onFound: function(track) { |
99 | | - canvasClassList.add('invert'); |
100 | | - }, |
101 | | - onNotFound: function() { |
102 | | - canvasClassList.remove('invert'); |
103 | | - } |
104 | | - }); |
| 95 | + videoCamera.track({ |
| 96 | + type: 'color', |
| 97 | + color: 'cyan', |
| 98 | + onFound: function(track) { |
| 99 | + canvasClassList.add('invert'); |
| 100 | + }, |
| 101 | + onNotFound: function() { |
| 102 | + canvasClassList.remove('invert'); |
| 103 | + } |
| 104 | + }); |
105 | 105 | </script> |
106 | 106 |
|
107 | 107 | </body> |
|
0 commit comments