amotify 0.0.62 → 0.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amotify",
3
- "version": "0.0.62",
3
+ "version": "0.0.63",
4
4
  "description": "UI Component for React",
5
5
  "main": "dist/launch.js",
6
6
  "types": "dist/@types.d.ts",
@@ -39,7 +39,7 @@ class CroppImage {
39
39
  val_file: File
40
40
  develops: amotify.fn.Cropper.DevelopParams[]
41
41
 
42
- use: 'profile' | 'header'
42
+ use: amotify.fn.Cropper.UseTypes
43
43
  componentID: string
44
44
  Canvas: {
45
45
  elm: HTMLCanvasElement
@@ -97,7 +97,7 @@ class CroppImage {
97
97
  tone: number
98
98
  rotate: number
99
99
  }
100
- use: 'profile' | 'header'
100
+ use: amotify.fn.Cropper.UseTypes
101
101
  componentID: string
102
102
  canvas: HTMLCanvasElement
103
103
  } ) {
@@ -134,13 +134,17 @@ class CroppImage {
134
134
  }
135
135
 
136
136
  let frameW = 0,frameH = 0
137
- if ( this.use == 'profile' ) {
137
+ if ( this.use == 'square' ) {
138
138
  frameW = Canvas.width / 3 * 2
139
139
  frameH = Canvas.height / 3 * 2
140
- } else if ( this.use == 'header' ) {
140
+ } else if ( this.use == 'wallpaper.horizontal' ) {
141
141
  frameW = Canvas.width * ( 7 / 9 )
142
142
  frameH = frameW / 3
143
+ } else if ( this.use == 'wallpaper.vertical' ) {
144
+ frameH = Canvas.height * ( 7 / 9 )
145
+ frameW = frameH / 2
143
146
  }
147
+
144
148
  let frameX = ( Canvas.width - frameW ) / 2
145
149
  let frameY = ( Canvas.height - frameH ) / 2
146
150
  let frameAsp = frameW / frameH
@@ -452,14 +456,16 @@ class CroppImage {
452
456
  }
453
457
 
454
458
  {
455
- if ( use == 'profile' ) {
459
+ if ( use == 'square' ) {
456
460
  ctx.fillStyle = 'rgba( 20,24,20,.3 )'
457
461
  ctx.beginPath()
458
462
  ctx.arc( this.Canvas.elm.width / 2,this.Canvas.elm.height / 2,this.Canvas.elm.width,0,Math.PI * 2,true )
459
463
  ctx.arc( this.Canvas.elm.width / 2,this.Canvas.elm.height / 2,this.Canvas.elm.width / 3 * 2 / 2,0,Math.PI * 2,false )
460
464
  ctx.closePath()
461
465
  ctx.fill()
462
- } else if ( use == 'header' ) {
466
+ } else if ( use == 'wallpaper.horizontal' ) {
467
+ ctx.fillStyle = 'rgba( 20,24,20,.3 )'
468
+ } else if ( use == 'wallpaper.vertical' ) {
463
469
  ctx.fillStyle = 'rgba( 20,24,20,.3 )'
464
470
  }
465
471
 
@@ -525,7 +531,12 @@ class CroppImage {
525
531
  L: 1152
526
532
  }[ size ]
527
533
 
528
- let height = this.use == 'profile' ? width : width / 3
534
+ let height = width;
535
+ if ( this.use == 'wallpaper.horizontal' ) {
536
+ height = width / 3 * 2
537
+ } else if ( this.use == 'wallpaper.vertical' ) {
538
+ height = width * 2
539
+ }
529
540
 
530
541
  let Preview = document.createElement( 'canvas' )
531
542
  Preview.width = width
@@ -797,7 +808,11 @@ const Comps: {
797
808
  >
798
809
  <canvas
799
810
  width={ '2400' }
800
- height={ use == 'profile' ? '2400' : '1800' }
811
+ height={
812
+ use == 'wallpaper.horizontal' ? '1800'
813
+ : use == 'wallpaper.vertical' ? '3200'
814
+ : '2400'
815
+ }
801
816
  className={ style.Canvas }
802
817
  id={ 'Canvas-' + val_componentID }
803
818
  />
@@ -919,7 +934,7 @@ const Comps: {
919
934
  flexChilds='even'
920
935
  paddingLeft={ 2 }
921
936
  >
922
- <Buttons.Button.Border.R
937
+ <Buttons.Button.Border.S
923
938
  onClick={ () => {
924
939
  let next = params.val_rotate - 90
925
940
  if ( next < 0 ) next += 360
@@ -927,14 +942,14 @@ const Comps: {
927
942
  } }
928
943
  >
929
944
  <FAI icon={ faRotateLeft } /> 左に回転
930
- </Buttons.Button.Border.R>
931
- <Buttons.Button.Border.R
945
+ </Buttons.Button.Border.S>
946
+ <Buttons.Button.Border.S
932
947
  onClick={ () => {
933
948
  params.set_rotate( ( params.val_rotate + 90 ) % 360 )
934
949
  } }
935
950
  >
936
951
  右に回転 <FAI icon={ faRotateRight } />
937
- </Buttons.Button.Border.R>
952
+ </Buttons.Button.Border.S>
938
953
  </Row.Separate>
939
954
  </Column>
940
955
  <Column gap={ '1/3' } >
@@ -952,7 +967,10 @@ const Comps: {
952
967
  max={ params.DefaultOptions.scale.max - 100 }
953
968
  step={ 25 }
954
969
  onUpdateValidValue={ ( { eventType,value } ) => {
955
- params.set_scale( value + 100 )
970
+ $.interval.clear( 'Cropper.UpdateScale' )
971
+ $.interval.standBy( 'Cropper.UpdateScale',400,() => {
972
+ params.set_scale( value + 100 )
973
+ } )
956
974
  } }
957
975
  legends={ {
958
976
  enable: true,
@@ -977,9 +995,12 @@ const Comps: {
977
995
  value={ params.val_grayScale }
978
996
  min={ 0 }
979
997
  max={ 100 }
980
- step={ 25 }
998
+ step={ 10 }
981
999
  onUpdateValidValue={ ( { value } ) => {
982
- params.set_grayScale( value )
1000
+ $.interval.clear( 'Cropper.GrayScale' )
1001
+ $.interval.standBy( 'Cropper.GrayScale',400,() => {
1002
+ params.set_grayScale( value )
1003
+ } )
983
1004
  } }
984
1005
  legends={ {
985
1006
  enable: true,
@@ -1042,7 +1063,7 @@ export const Cropper: amotify.fn.Cropper.Methods = {
1042
1063
  type: 'normal.middleCenter',
1043
1064
  size: '3L',
1044
1065
  freeCSS: {
1045
- width: params.use == 'header' ? 12 * 100 : 12 * 80
1066
+ width: params.use == 'wallpaper.horizontal' ? 12 * 100 : 12 * 80
1046
1067
  },
1047
1068
  content: <Comps.Core
1048
1069
  val_file={ Image[ 0 ] as any }
@@ -15,6 +15,7 @@
15
15
  cursor: move;
16
16
  overflow: hidden;
17
17
  // user-select: none !important;
18
+ vertical-align: middle;
18
19
  }
19
20
  .Preview {
20
21
  display: none;
@@ -6,6 +6,9 @@ import {
6
6
  Box,
7
7
  Flex,
8
8
  } from '@atoms'
9
+ import {
10
+ Column
11
+ } from '@mols'
9
12
  import {
10
13
  Input,
11
14
  Buttons
@@ -146,7 +149,8 @@ export const SliderInput: React.FC<amotify.fn.Input.Slider.PlainParams> = ( para
146
149
  data-input-type={ 'slider' }
147
150
  { ...others }
148
151
  />
149
- <Box
152
+ <Column
153
+ gap={ '1/2' }
150
154
  flexSizing={ 'auto' }
151
155
  className={ [
152
156
  style.Wrap,
@@ -169,7 +173,7 @@ export const SliderInput: React.FC<amotify.fn.Input.Slider.PlainParams> = ( para
169
173
  step={ step }
170
174
  customLegends={ customLegends }
171
175
  /> : null }
172
- </Box>
176
+ </Column>
173
177
  </BoxWrapper>
174
178
  }
175
179
 
@@ -206,8 +210,8 @@ const Comps = {
206
210
  display={ index == minStep || index == maxStep ? 'flex' : 'none' }
207
211
  position='absolute'
208
212
  top={ 0 }
209
- height={ 1 }
210
- unitWidth={ 2 }
213
+ unitHeight={ 1 }
214
+ unitWidth={ 1.5 }
211
215
  transition='middle'
212
216
  fontColor={ '1.clear' }
213
217
  freeCSS={ {
@@ -256,7 +260,7 @@ const Comps = {
256
260
  className={ style.Labels }
257
261
  verticalAlign='center'
258
262
  horizontalAlign='between'
259
- unitHeight={ 2 }
263
+ backgroundColor='posi'
260
264
  fontSize={ '0.xs' }
261
265
  position='relative'
262
266
  id={ 'Labels-' + componentID }
@@ -265,8 +269,10 @@ const Comps = {
265
269
  position='absolute'
266
270
  top={ 0 }
267
271
  left={ 0 }
268
- right={ 2 }
269
272
  bottom={ 0 }
273
+ freeCSS={ {
274
+ right: 12 * 1.5
275
+ } }
270
276
  children={ Labels }
271
277
  />
272
278
  </Flex>
@@ -294,7 +300,7 @@ const Comps = {
294
300
  className={ style.Rail }
295
301
  position='relative'
296
302
  paddingLeft={ '1/2' }
297
- unitHeight={ 2 }
303
+ unitHeight={ 1.5 }
298
304
  verticalAlign='center'
299
305
  freeCSS={ {
300
306
  minWidth: '10rem',
@@ -351,8 +357,10 @@ const Comps = {
351
357
  position='absolute'
352
358
  top={ 0 }
353
359
  left={ 0 }
354
- right={ 2 }
355
360
  bottom={ 0 }
361
+ freeCSS={ {
362
+ right: 12 * 1.5
363
+ } }
356
364
  >
357
365
  <Buttons.Button.Plain
358
366
  className={ style.Ball }
@@ -360,7 +368,7 @@ const Comps = {
360
368
  backgroundColor={ props.color }
361
369
  top={ 0 }
362
370
  left={ 0 }
363
- ssSphere={ 2 }
371
+ ssSphere={ 1.5 }
364
372
  freeCSS={ {
365
373
  zIndex: 2,
366
374
  left: DotData.positionLeft
@@ -4,8 +4,8 @@
4
4
  &:before {
5
5
  content: "";
6
6
  position: absolute;
7
- top: calc(-1 * $unit1 / 6);
8
- height: calc($unit1 / 2);
7
+ top: calc(-1 * $unit1-5 / 2);
8
+ height: calc($unit1-5 / 2);
9
9
  left: 50%;
10
10
  width: 1px;
11
11
  transform: translateX(-50%);