This repository was archived by the owner on Sep 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 21
21
22
22
$ . keyframe . define ( [ ss ] ) ;
23
23
24
- $ ( '.spriteContainer' ) . playSpriteSheet ( 'gem' , '10s ' ) ;
24
+ $ ( '.spriteContainer' ) . playSpriteSheet ( 'gem' , '8s ' ) ;
25
25
} ) ;
26
26
</ script >
27
27
< style >
28
28
.spriteContainer {
29
- width : 32 px ;
30
- height : 32 px ;
29
+ width : 30 px ;
30
+ height : 30 px ;
31
31
background-image : url (emeraldspinning.png);
32
32
}
33
33
</ style >
Original file line number Diff line number Diff line change 17
17
width : 0 ,
18
18
offsetX : 0 ,
19
19
offsetY : 0 ,
20
- count : ( opts . rows * opts . cols ) ,
20
+ count : ( opts . rows - 1 * opts . cols - 1 ) ,
21
21
spriteWidth : ( opts . width / opts . cols ) ,
22
22
spriteHeight : ( opts . height / opts . rows ) ,
23
23
loop : true
29
29
30
30
spriteStep = 100 / opts . count ;
31
31
spriteFrames = { } ;
32
- var x = opts . offsetX - opts . spriteWidth ;
33
- var y = opts . offsetY - opts . spriteHeight ;
32
+ var x = opts . offsetX ;
33
+ var y = opts . offsetY ;
34
34
for ( var i = 0 ; i < opts . count ; i ++ ) {
35
35
spriteFrames [ Math . round ( spriteStep * i ) + '%' ] = {
36
36
'background-position' : '-' + ( opts . spriteWidth + x ) + 'px -' + ( opts . spriteHeight + y ) + 'px'
37
37
}
38
- if ( x >= ( opts . cols * opts . spriteWidth ) ) {
38
+ if ( x >= opts . width - opts . spriteWidth ) {
39
39
y += opts . spriteHeight ;
40
40
x = 0 ;
41
41
} else {
65
65
loops = 'infinite' ;
66
66
}
67
67
68
- var animate = name + ' ' + time + ' steps(' + opts . count + ' ) ' + loops ;
68
+ var animate = name + ' ' + time + ' steps(1 ) ' + loops ;
69
69
var existingAnimation = this . css ( 'animation' ) ;
70
70
if ( existingAnimation . split ( ' ' ) [ 0 ] != "none" ) {
71
71
animate = existingAnimation + ', ' + animate ;
You can’t perform that action at this time.
0 commit comments