HTML, CSS, JS

No description

fork
loading
Files
  • index.html
  • animations
  • lottie.js
  • script.js
  • style.css

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.5517865908500799","path":"index.html","file":{"path":"index.html","content":{"asEncoding":{"base64":"PGh0bWwgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiPgo8bWV0YSBjaGFyc2V0PSJVVEYtOCI+CjxoZWFkPgogICAgPHN0eWxlPgogICAgICAgIGJvZHl7CiAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6I2ZmZjsKICAgICAgICAgICAgbWFyZ2luOiAwcHg7CiAgICAgICAgICAgIGhlaWdodDogMTAwJTsKICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjsKCQkJZm9udC1mYW1pbHk6IlNlZ29lIFVJIjsKICAgICAgICB9CiAgICAgICAgI2xvdHRpZXsKICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjp0cmFuc3BhcmVudDsKICAgICAgICAgICAgd2lkdGg6NDAlOwogICAgICAgICAgICBoZWlnaHQ6NTAlOwogICAgICAgICAgICBkaXNwbGF5OmJsb2NrOwogICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuOwogICAgICAgICAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZTNkKDAsMCwrMSk7CiAgICAgICAgICAgIHRleHQtYWxpZ246IGNlbnRlcjsKCQkJei1pbmRleDotMTsKICAgICAgICAgICAgb3BhY2l0eTogMTsKICAgICAgICB9CgkJQG1lZGlhIG9ubHkgc2NyZWVuIGFuZCAobWF4LXdpZHRoOiA2MDBweCkgewogICAgI2xvdHRpZSB7CiAgICAgICAgd2hpdGUtc3BhY2U6IG5vd3JhcDsKICAgICAgICB3aWR0aDogODUlOwogICAgfQp9ICAKCgkJLmJ1dHRvbiB7CgkJb3BhY2l0eTogMTsKCQl0cmFuc2l0aW9uOiBvcGFjaXR5IDFzOyAKCQlwb3NpdGlvbjpyZWxhdGl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HRleHQgLSBMYXN0IHRleHQgY2lyY2xlcyBpbiBzcGluIGFuaW1hdGlvbgoJdGV4dEFFKDAsd2luRGF0YSsiJSIsbWlkSlNPTik7Cgl0ZXh0QUUoNix3aW5EYXRhKyIlIixtaWRKU09OKTsKCXRleHRBRSgxMix3aW5EYXRhKyIlIixtaWRKU09OKTsKCS8vdGV4dCB0aGF0IGlzIG5vdCByYW5kb21pc2VkIGZvciBlYWNoIGZpbGUuIFdpbiB0ZXh0IC0gTGFzdCB0ZXh0IGNpcmNsZXMgaW4gZW5kIGFuaW1hdGlvbgkKCXRleHRBRSgwLHdpbkRhdGErIiUiLGVuZEpTT04pOwoJdGV4dEFFKDYsd2luRGF0YSsiJSIsZW5kSlNPTik7Cgl0ZXh0QUUoMTIsd2luRGF0YSsiJSIsZW5kSlNPTik7CgoJfQoKPC9zY3JpcHQ+CjwvYm9keT4KPC9odG1sPgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoK"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<html xmlns="http://www.w3.org/1999/xhtml">
<meta charset="UTF-8">
<head>
    <style>
        body{
            background-color:#fff;
            margin: 0px;
            height: 100%;
            overflow: hidden;
			font-family:"Segoe UI";
        }
        #lottie{
            background-color:transparent;
            width:40%;
            height:50%;
            display:block;
            overflow: hidden;
            transform: translate3d(0,0,+1);
            text-align: center;
			z-index:-1;
            opacity: 1;
        }
		@media only screen and (max-width: 600px) {
    #lottie {
        white-space: nowrap;
        width: 85%;
    }
}  

		.button {
		opacity: 1;
		transition: opacity 1s; 
		position:relative; 
		margin-top:-5%;
		height:50px;
		width:120px;
		display: inline-block;
		font-size: 16px;
		cursor: pointer;
		z-index:1;
		text-align: center;
	    font-weight: bold;
		text-decoration: none;
		outline: none;
		color: #fff;
		background-color: #F523B1;
		border: none;
		border-radius: 15px;
		box-shadow: 0 9px #C41C8E;
		}

		.button:hover {background-color: #EA69C0}
		
		.button:active {
		background-color: #F523B1;
		box-shadow: 0 5px #C41C8E;
		transform: translateY(4px);
		}





    </style>
</head>
<body>	
<!--lottie player/library -->	
<script type="text/javascript" src="lottie.js"></script>
	
<!-- animation is stored in a variable from this file -->	
<script type="text/javascript" src="animations/all.json"></script>
<script type="text/javascript" src="animations/startSpinAnimation.json"></script>
<script type="text/javascript" src="animations/spinAnimation.json"></script>
<script type="text/javascript" src="animations/endAnimation.json"></script>
<p></p>
<center>
	
<!-- lottie container for the animation-->	
<div id="lottie"  style="margin-top:-5">

</div>

	
<div>

<button class="button" id="playbtn" onclick="animatingGame()">PLAY GAME</button>
<p></p>
win : <input type="text" id="win_data" value="12" size="1">
</div>
<center>


<script>

	var winData;
	// pool of hardcoded values - if you want to add or remove - pass the length of the array as a argument in slotsTxt
	var hardValues = [12,23,66,3,45,6,19,59,7,49,87];
	var startValues =[23,45,77];

	var buttonPlay = document.getElementById("playbtn");

	//lottie settings
   var params = {
        container: document.getElementById('lottie'),
        renderer: 'svg',
        loop: false,
        autoplay: false,
        animationData: startJSON //this value stores the json data from the json file. it is defined in the json file.
    };

	
	//init the animation
        var anim = lottie.loadAnimation(params);
	
	/* reset animation with randomise starting values from the pool of hardcoded values 
	   if the json file is preloaded - this destruction can be avoided */
	slotTxt();
	anim.destroy();
	
	params.animationData = startJSON; 
	anim = lottie.loadAnimation(params);
	
	
	function animatingGame(){
  //button styles
	buttonPlay.disabled=true;
  buttonPlay.style="background-color:lightgray;box-shadow:0 5px gray";

	//get wining data from database or in this case from the input
	winData = document.getElementById("win_data").value;
	/*
	set winning data to the last text layers from after effects
	first param is the index of the text layer in after effects 
	second param is the new text 
	*/

	anim.destroy();
	
     slotTxt();

	//pass the new animation with the winning data and play it
	params.animationData = startJSON; 
  anim = lottie.loadAnimation(params);
	anim.play();
	
	
	//reset animation after finish
	anim.addEventListener('complete', function(){
	
	anim.destroy();

	//pass the new animation with the winning data and play it
	params.animationData = midJSON; 
	params.loop=true;
  anim = lottie.loadAnimation(params);
	anim.play();
	
	
	//set new random values to slots for a new game;
	
    slotTxt();
	
	//how long will it loop - animations is 466.66 ms long and by multiplying with 5 means it will loop 6 times
	//(loops 5 and then sets loop to false and plays again with event on complete to triger last animation smoothly)
	var loopLen = 5;
	setTimeout(function(){
	 
	params.loop=false;
	 anim = lottie.loadAnimation(params);
	 anim.play();
	 anim.addEventListener('complete', function(){
	 anim.destroy();
	params.animationData = endJSON; 
  anim = lottie.loadAnimation(params);
	anim.play();
	})
	
	},466.666*loopLen);
	clearTimeout();
	
	
	})
	
	
	}

	/*
	
	
	function for manipulating text values of after effects layers
	first argument is the layer number in after effects
	second argument is the value  */

	function textAE(n,val,file){
	//the path to the text prop in the json file - it represents the layer tree in after effects
	return file.assets[0].layers[n].t.d.k[0].s.t = val;
	}

	//picks a random value for the other text values from the pool of hardcoded values
	function slotTxt(n=8){
//set random values to the text layers in after effects
	for(var t = 40; t>=14; t-=2){
	textAE(t,hardValues[Math.floor((Math.random() * n))] + "%",midJSON);
		
		}	
		
	//text that is not randomised for each file. these are the First text circles in start animation
	textAE(30,startValues[0]+"%",startJSON);
	textAE(32,startValues[1]+"%",startJSON);
	textAE(34,startValues[2]+"%",startJSON);
	
	//text that is not randomised for each file. these are the First text circles in spin animation
	textAE(30,startValues[0]+"%",midJSON);
	textAE(32,startValues[1]+"%",midJSON);
	textAE(34,startValues[2]+"%",midJSON);
	//text that is not randomised for each file. Win text - Last text circles in spin animation
	textAE(0,winData+"%",midJSON);
	textAE(6,winData+"%",midJSON);
	textAE(12,winData+"%",midJSON);
	//text that is not randomised for each file. Win text - Last text circles in end animation	
	textAE(0,winData+"%",endJSON);
	textAE(6,winData+"%",endJSON);
	textAE(12,winData+"%",endJSON);

	}

</script>
</body>
</html>

























result
console