Skip to content

Commit a30481c

Browse files
committed
mojs-player: move from rems to px
1 parent 9c58c90 commit a30481c

18 files changed

+168
-134
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
<img src="https://github.com/legomushroom/mojs-player/blob/master/mockups/mojs-player@x4.png?raw=true" alt="mojs-player" />
44

5-
Player controls for [mojs](mojs.io). Intended to help you to craft `mojs` animation sequences. To be clear, this player is not needed to play `mojs` animations.
6-
7-
It is just a helper tool that gives you the ability to:
5+
Player controls for [mojs](mojs.io). Intended to help you to craft `mojs` animation sequences. To be clear, this player is not needed to play `mojs` animations. It is just a helper tool that gives you the ability to:
86
- control your sequences with `GUI` while working on them
97
- it saves the current progress of your animation thus you don't loose the `focus`
108
- it gives you `bounds` to constrain `focus point` of your animation
@@ -44,8 +42,7 @@ import MojsPlayer from 'mojs-player';
4442

4543
If you installed it with script link - you should have `MojsPlayer` global.
4644

47-
48-
## API
45+
## Usage
4946

5047
Construct `MojsPlayer` and pass your main `Tween/Timeline` as the `add` option:
5148

build/mojs-player.js

Lines changed: 67 additions & 57 deletions
Large diffs are not rendered by default.

css/assets/globals.postcss.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
@import './colors.postcss.css';
33

4-
$PX: 1/16rem;
4+
/*$PX: 1/16rem;*/
5+
$PX: 1px;
56
$GS: calc( 10 * $PX );
67
$BRADIUS: calc( 3 * $PX );

css/blocks/handle.postcss.css

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ $handleHeight: 13;
55
.handle {
66
width: calc( $handleHeight * $PX );
77
height: calc( $handleHeight * $PX );
8-
8+
99
cursor: pointer;
1010
transform: translateX(0);
11-
/*backface-visibility: hidden;*/
12-
11+
backface-visibility: hidden;
12+
1313
&__inner,
1414
&__shadow {
1515
position: absolute;
1616
left: 0;
1717
top: 0;
1818
z-index: 1;
19-
19+
2020
width: 100%;
2121
height: 100%;
2222
border-radius: 50%;
2323
cursor: pointer;
2424
/*transform: translateZ(0);*/
25-
backface-visibility: hidden;
25+
/*backface-visibility: hidden;*/
2626
}
27-
27+
2828
&__inner {
2929
background: #FFF;
3030
}
@@ -48,7 +48,7 @@ $handleHeight: 13;
4848
opacity: .85;
4949
transform: scale(1);
5050
}
51-
51+
5252
$width: 9;
5353
$height: 20;
5454
&.is-bound {
@@ -96,4 +96,3 @@ $handleHeight: 13;
9696
}
9797
}
9898
}
99-

css/blocks/handle.postcss.css.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"handle":"_handle_q1som_5","handle__inner":"_handle__inner_q1som_1","handle__shadow":"_handle__shadow_q1som_1","is-bound":"_is-bound_q1som_54","is-inversed":"_is-inversed_q1som_82"}
1+
{"handle":"_handle_8vrrs_5","handle__inner":"_handle__inner_8vrrs_1","handle__shadow":"_handle__shadow_8vrrs_1","is-bound":"_is-bound_8vrrs_54","is-inversed":"_is-inversed_8vrrs_82"}

css/blocks/mojs-player.postcss.css

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
height: calc( 40 * $PX );
1010
background: rgba( 58, 8, 57, .85 );
1111
z-index: 100;
12-
12+
13+
* {
14+
box-sizing: border-box;
15+
}
16+
1317
$btnWidth: 35;
1418
$btnCount: 5;
1519
$leftWidth: calc( $btnCount * $btnWidth * $PX );
@@ -22,7 +26,7 @@
2226
&__mid {
2327
position: absolute;
2428
left: $leftWidth;
25-
right: calc( $btnWidth * $PX );
29+
right: calc( $btnWidth/2 * $PX );
2630
overflow: hidden;
2731
padding: 0 calc( 20 * $PX );
2832
}
@@ -38,11 +42,16 @@
3842
bottom: 100%;
3943
}
4044

45+
&__mojs-logo {
46+
[data-component="icon"] {
47+
fill: $c-orange;
48+
}
49+
}
50+
4151
&.is-hidden {
4252
transform: translateY(100%);
4353
}
4454
&.is-transition {
4555
transition: all .15s ease-out;
4656
}
4757
}
48-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"mojs-player":"_mojs-player_tes6w_4","mojs-player__left":"_mojs-player__left_tes6w_1","mojs-player__mid":"_mojs-player__mid_tes6w_1","mojs-player__right":"_mojs-player__right_tes6w_1","mojs-player__hide-button":"_mojs-player__hide-button_tes6w_1","is-hidden":"_is-hidden_tes6w_41","is-transition":"_is-transition_tes6w_44"}
1+
{"mojs-player":"_mojs-player_12g93_4","mojs-player__left":"_mojs-player__left_12g93_1","mojs-player__mid":"_mojs-player__mid_12g93_1","mojs-player__right":"_mojs-player__right_12g93_1","mojs-player__hide-button":"_mojs-player__hide-button_12g93_1","mojs-player__mojs-logo":"_mojs-player__mojs-logo_12g93_1","is-hidden":"_is-hidden_12g93_51","is-transition":"_is-transition_12g93_54"}

css/blocks/speed-control.postcss.css

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,26 @@
55
position: relative;
66
display: inline-block;
77
height: calc( 40 * $PX );
8-
9-
$pad: 2;
8+
9+
$pad: 20;
1010
&__slider {
1111
position: absolute;
1212
bottom: 100%;
1313
left: calc( 3 * $PX );
1414
width: calc( 30 * $PX );
15-
height: calc( 80 * $PX );
16-
padding-top: calc( $pad * $GS );
17-
padding-bottom: calc( $pad * $GS );
18-
15+
height: calc( (80 + 2*$pad) * $PX );
16+
padding-top: calc( $pad * $PX );
17+
padding-bottom: calc( $pad * $PX );
18+
1919
border-top-right-radius: $BRADIUS;
2020
border-top-left-radius: $BRADIUS;
21-
21+
2222
background: $c-purple;
23-
23+
2424
$translateSize : calc( -99999999 * $PX );
2525
transform: translate($translateSize, $translateSize);
2626
backface-visibility: hidden;
27+
2728
&:before,
2829
&:after {
2930
content: '';
@@ -50,4 +51,3 @@
5051

5152
}
5253
}
53-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"speed-control":"_speed-control_1svrw_4","speed-control__slider":"_speed-control__slider_1svrw_1","speed-control__button":"_speed-control__button_1svrw_1","is-on":"_is-on_1svrw_48"}
1+
{"speed-control":"_speed-control_1mxm4_4","speed-control__slider":"_speed-control__slider_1mxm4_1","speed-control__button":"_speed-control__button_1mxm4_1","is-on":"_is-on_1mxm4_49"}

css/blocks/track.postcss.css

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ $height: 40;
55
.track {
66
position: relative;
77
height: 100%;
8-
8+
99
&__track {
1010
position: absolute;
1111
top: 50%;
1212
left: 0;
13-
13+
1414
width: 100%;
1515
height: calc( $PX );
16-
16+
1717
background: #FFF;
1818
box-shadow: calc( $PX ) calc( $PX ) calc( $PX ) rgba(0,0,0,.5);
19-
19+
2020
&:after {
2121
content: '';
2222
position: absolute;
@@ -35,20 +35,20 @@ $height: 40;
3535
top: 50%;
3636
margin-top: calc( -1 * $PX );
3737
height: calc( 3*$PX );
38-
width: 1px;
38+
width: 0.0625em;
3939
/*background: $c-orange;*/
4040
background: $c-white;
4141
z-index: 1;
4242
transform-origin: left center;
4343
&:after {
44-
content: '';
44+
/*content: '';*/
4545
position: absolute;
4646
left: 0;
4747
top: calc( - $height/2 * $PX );
4848
width: 100%;
4949
height: calc( $height * $PX );
5050
cursor: pointer;
51-
/*background-color: yellow;*/
51+
backface-visibility: hidden;
5252
}
5353
}
5454

@@ -59,7 +59,8 @@ $height: 40;
5959
right: 0;
6060
bottom: 0;
6161
overflow: hidden;
62-
z-index: 1;
62+
/*background: black;*/
63+
/*z-index: 1;*/
6364
}
6465

6566
&.is-inversed {
@@ -78,13 +79,12 @@ $height: 40;
7879
&.is-y &__track {
7980
top: 0;
8081
left: 50%;
81-
82+
8283
height: 100%;
8384
width: calc( $PX );
84-
85+
8586
/*box-shadow: calc( $PX ) calc( $PX ) calc( $PX ) rgba(0,0,0,.5); */
8687
}
8788

8889

8990
}
90-

0 commit comments

Comments
 (0)