File tree Expand file tree Collapse file tree 3 files changed +63
-0
lines changed Expand file tree Collapse file tree 3 files changed +63
-0
lines changed Original file line number Diff line number Diff line change
1
+ <script >
2
+ import { LEFT_RIGHT_COLORING_LIGHT } from ' $lib/constants' ;
3
+ import { DanceWrapper } from ' $lib/instructor/bouncy_instructor' ;
4
+ import Svg from ' ./avatar/Svg.svelte' ;
5
+ import SvgAvatar from ' ./avatar/SvgAvatar.svelte' ;
6
+
7
+ /** @type {DanceWrapper} */
8
+ export let dance;
9
+
10
+ let innerWidth = 300 ;
11
+
12
+ $: beats = dance .beats ;
13
+ $: poseWidth = innerWidth / 8 ;
14
+
15
+ function count (beat ) {
16
+ if (beat % 2 === 1 ) {
17
+ return ' +' ;
18
+ } else {
19
+ return (beat % 8 ) / 2 + 1 ;
20
+ }
21
+ }
22
+ </script >
23
+
24
+ <div class ="poses" bind:clientWidth ={innerWidth }>
25
+ {#each { length : beats } as _ , beat }
26
+ <!-- <Pose /> -->
27
+ <div class ="avatar" style ="width: {poseWidth }px" >
28
+ <div class =" count" >
29
+ {count (beat )}
30
+ </div >
31
+ <Svg width ={200 } height ={200 } orderByZ >
32
+ <SvgAvatar
33
+ skeleton ={dance .skeleton (beat )}
34
+ width ={200 }
35
+ height ={200 }
36
+ style ={LEFT_RIGHT_COLORING_LIGHT }
37
+ ></SvgAvatar >
38
+ </Svg >
39
+ </div >
40
+ {/each }
41
+ </div >
42
+
43
+ <style >
44
+ .poses {
45
+ display : grid ;
46
+ grid-template-columns : repeat (8 , 1fr );
47
+ }
48
+ .avatar {
49
+ position : relative ;
50
+ width : 100px ;
51
+ margin-bottom : 30px ;
52
+ }
53
+ .count {
54
+ text-align : center ;
55
+ margin : 0 0 -10px ;
56
+ }
57
+ </style >
Original file line number Diff line number Diff line change 230
230
"left-out" : " Links nach aussen"
231
231
}
232
232
},
233
+ "dance" : {
234
+ "counts" : " Zur Musik gezählt"
235
+ },
233
236
"common" : {
234
237
"hint-popup-title" : " Hinweis"
235
238
}
Original file line number Diff line number Diff line change 230
230
"left-out" : " Left leg outwards"
231
231
}
232
232
},
233
+ "dance" : {
234
+ "counts" : " Music counts"
235
+ },
233
236
"common" : {
234
237
"hint-popup-title" : " Hint"
235
238
}
You can’t perform that action at this time.
0 commit comments