36 |
39 | element.ElasticProgress({
40 | buttonSize: 60,
41 | fontFamily: "Montserrat",
42 | colorBg: "#adeca8",
43 | colorFg: "#7cc576",
44 | onClick: function(event) {
45 | console.log("onClick");
46 | $(this).ElasticProgress("open");
47 | },
48 | onOpen: function(event) {
49 | fakeLoading($(this));
50 | },
51 | onFail: function(event) {
52 | $(this).ElasticProgress("open");
53 | },
54 | onCancel: function(event) {
55 | $(this).ElasticProgress("open");
56 | }
57 | });
58 |
59 | 64 |
67 | element.ElasticProgress({
68 | align: "center",
69 | fontFamily: "Roboto",
70 | colorFg: "#77c2ff",
71 | colorBg: "#4e80dd",
72 | bleedTop: 110,
73 | bleedBottom: 40,
74 | buttonSize: 100,
75 | labelTilt: 70,
76 | arrowDirection: "up",
77 | onClick: function() {
78 | $(this).ElasticProgress("open");
79 | },
80 | onOpen: function() {
81 | fakeLoading($(this))
82 | },
83 | onCancel: function() {
84 | $(this).ElasticProgress("close");
85 | },
86 | onComplete: function() {
87 | var $obj = $(this)
88 | $obj.ElasticProgress("close");
89 | }
90 | });
91 |
92 | 97 |
100 | element.ElasticProgress({
101 | align: "center",
102 | colorFg: "#686e85",
103 | colorBg: "#b4bad2",
104 | highlightColor: "#ffab91",
105 | width: Math.min($(window).width()/2 - 100, 600),
106 | barHeight: 10,
107 | labelHeight: 50,
108 | labelWobbliness: 0,
109 | bleedTop: 120,
110 | bleedRight: 100,
111 | buttonSize: 60,
112 | fontFamily: "Arvo",
113 | barStretch: 0,
114 | barInset: 4,
115 | barElasticOvershoot: 1,
116 | barElasticPeriod: 0.6,
117 | textFail: "Download Failed",
118 | textComplete: "Download Complete",
119 | arrowHangOnFail: false,
120 | onClick: function() {
121 | $(this).ElasticProgress("open");
122 | },
123 | onOpen: function() {
124 | fakeLoading($(this))
125 | },
126 | onComplete: function() {
127 | var $obj = $(this)
128 |
129 | TweenMax.delayedCall(1.5, function() {
130 | $obj.ElasticProgress("close");
131 | })
132 | }
133 | });
134 |
135 |
143 | var e = new ElasticProgress(document.querySelectorAll('.Download')[3], {
144 | colorFg: "#ed7499",
145 | colorBg: "#635c73",
146 | highlightColor: "#ed7499",
147 | barHeight: 14,
148 | barInset: 10,
149 | fontFamily: "Indie Flower"
150 | });
151 | e.onClick(function() {
152 | e.open();
153 | })
154 | e.onOpen(function() {
155 | fakeLoading(e, 2, 0.5);
156 | });
157 | e.onFail(function() {
158 | e.close();
159 | })
160 |
161 |