-
Notifications
You must be signed in to change notification settings - Fork 479
/
DeviceComponent.coffee
1302 lines (1048 loc) · 35 KB
/
DeviceComponent.coffee
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Utils = require "../Utils"
{_} = require "../Underscore"
{BaseClass} = require "../BaseClass"
{Layer} = require "../Layer"
{Defaults} = require "../Defaults"
{Events} = require "../Events"
###
Device._setup()
Device._update()
Device._setupContext()
Device.fullScreen bool
Device.deviceType str
Device.padding int
Device.orientation(orientation:float)
Device.orientationName landscape|portrait|unknown
Device.rotateLeft()
Device.rotateRight()
Device.setDeviceScale(zoom:float, animate:bool)
Device.setContentScale(zoom:float, animate:bool)
Device.nextHand()
# Events
Events.DeviceTypeDidChange
Events.DeviceFullScreenDidChange
###
# _.extend Events,
# DeviceTypeDidChange: "change:deviceType"
# DeviceScaleDidChange: "change:deviceScale"
# DeviceContentScaleDidChange: "change:contentScale"
# DeviceFullScreenDidChange: ""
class exports.DeviceComponent extends BaseClass
@define "context", get: -> @_context
constructor: (options={}) ->
defaults = Defaults.getDefaults("DeviceComponent", options)
# If we have defaults for DeviceView, we are likely using an older version of
# Framer Studio. It's best to default to those then for now.
if Framer.Defaults.hasOwnProperty("DeviceView")
defaults = _.extend(defaults, Framer.Defaults.DeviceView)
@_setup()
@animationOptions = defaults.animationOptions
@deviceType = defaults.deviceType
_.extend(@, _.defaults(options, defaults))
@Type =
Tablet: "tablet"
Phone: "phone"
Computer: "computer"
_setup: ->
if @_setupDone
return
@_setupDone = true
@background = new Layer
@background.clip = true
@background.backgroundColor = "transparent"
@background.classList.add("DeviceBackground")
@hands = new Layer
@handsImageLayer = new Layer parent:@hands
@phone = new Layer parent:@hands
@screen = new Layer parent:@phone
@viewport = new Layer parent:@screen
@content = new Layer parent:@viewport
@hands.backgroundColor = "transparent"
@hands._alwaysUseImageCache = true
@handsImageLayer.backgroundColor = "transparent"
@phone.backgroundColor = "transparent"
@phone.classList.add("DevicePhone")
@screen.classList.add("DeviceScreen")
@screen.clip = true
@viewport.backgroundColor = "transparent"
@viewport.classList.add("DeviceComponentPort")
@content.backgroundColor = "transparent"
@content.classList.add("DeviceContent")
@content.originX = 0
@content.originY = 0
Framer.CurrentContext.domEventManager.wrap(window).addEventListener("resize", @_update) unless Utils.isMobile()
Framer.CurrentContext.domEventManager.wrap(window).addEventListener("resize", @_orientationChange) if Utils.isMobile()
# This avoids rubber banding on mobile
for layer in [@background, @phone, @viewport, @content, @screen]
layer.on "touchmove", (event) -> event.preventDefault()
@_context = new Framer.Context(parent:@content, name:"DeviceScreen")
@_context.perspective = 1200
@_context.device = @
_update: =>
# Todo: pixel align at zoom level 1, 0.5
contentScaleFactor = @contentScale
contentScaleFactor = 1 if contentScaleFactor > 1
if @_shouldRenderFullScreen()
width = window.innerWidth / contentScaleFactor
height = window.innerHeight / contentScaleFactor
for layer in [@background, @hands, @phone, @viewport, @content, @screen]
layer.x = layer.y = 0
layer.width = width
layer.height = height
layer.scale = 1
@content.scale = contentScaleFactor
else
backgroundOverlap = 100
@background.x = 0 - backgroundOverlap
@background.y = 0 - backgroundOverlap
@background.width = window.innerWidth + (2 * backgroundOverlap)
@background.height = window.innerHeight + (2 * backgroundOverlap)
@hands.scale = @_calculatePhoneScale()
@hands.center()
@phone.center()
[width, height] = @_getOrientationDimensions(
@_device.screenWidth / contentScaleFactor,
@_device.screenHeight / contentScaleFactor)
@screen.width = @viewport.width = @_device.screenWidth
@screen.height = @viewport.height = @_device.screenHeight
@content.width = width
@content.height = height
@screen.center()
@setHand(@selectedHand) if @selectedHand && @_orientation == 0
_shouldRenderFullScreen: ->
if not @_device
return true
if @fullScreen is true
return true
if @deviceType is "fullscreen"
return true
if Utils.deviceType() is "phone" and Utils.deviceType() is @_device.deviceType
return true
if Utils.deviceType() is "tablet" and Utils.deviceType() is @_device.deviceType
return true
if Utils.deviceType() is "phone" and @_device.deviceType is "tablet"
return true
return false
setupContext: ->
# Sets this device up as the default context so everything renders
# into the device screen
Framer.CurrentContext = @_context
###########################################################################
# FULLSCREEN
@define "fullScreen",
get: ->
@_fullScreen
set: (fullScreen) ->
@_setFullScreen(fullScreen)
_setFullScreen: (fullScreen) ->
if @_deviceType is "fullscreen"
return
if not _.isBoolean(fullScreen)
return
if fullScreen is @_fullScreen
return
@_fullScreen = fullScreen
if fullScreen is true
@phone.image = ""
@hands.image = ""
else
@_updateDeviceImage()
@_update()
@emit("change:fullScreen")
@define "screenSize",
get: ->
if @_shouldRenderFullScreen()
return Canvas.size
if @isLandscape
return size =
width: @_device.screenHeight
height: @_device.screenWidth
else
return size =
width: @_device.screenWidth
height: @_device.screenHeight
###########################################################################
# DEVICE TYPE
customize: (deviceProps) =>
Devices.custom = _.defaults deviceProps, Devices.custom
@deviceType = "custom"
@define "deviceType",
get: ->
@_deviceType
set: (deviceType) ->
if deviceType is @_deviceType and deviceType isnt "custom"
return
device = null
if _.isString(deviceType)
lDevicetype = deviceType.toLowerCase()
for key in _.keys(Devices)
lKey = key.toLowerCase()
device = Devices[key] if lDevicetype == lKey
if not device
throw Error "No device named #{deviceType}. Options are: #{_.keys Devices}"
if @_device is device
return
# If we switch from fullscreen to a device, we should zoom to fit
shouldZoomToFit = @_deviceType is "fullscreen"
@screen.backgroundColor = "black"
@screen.backgroundColor = device.backgroundColor if device.backgroundColor?
if device.deviceType is "computer"
Utils.domComplete ->
document.body.style.cursor = "auto"
@_device = _.clone(device)
@_deviceType = deviceType
@fullscreen = false
@_updateDeviceImage()
@_update()
@emit("change:deviceType")
@viewport.point = @_viewportOrientationOffset()
if shouldZoomToFit
@deviceScale = "fit"
_updateDeviceImage: =>
if /PhantomJS/.test(navigator.userAgent)
return
if @_shouldRenderFullScreen()
@phone.image = ""
@hands.image = ""
else if not @_deviceImageUrl(@_deviceImageName())
@phone.image = ""
else
@phone._alwaysUseImageCache = true
@phone.image = @_deviceImageUrl(@_deviceImageName())
@phone.width = @_device.deviceImageWidth
@phone.height = @_device.deviceImageHeight
@hands.width = @phone.width
@hands.height = @phone.height
_deviceImageName: ->
if @_device.hasOwnProperty("deviceImage")
return @_device.deviceImage
return "#{@_deviceType}.png"
_deviceImageUrl: (name) ->
return null unless name
# If the image is externally hosted, we'd like to use that
if _.startsWith(name, "http://") or _.startsWith(name, "https://")
return name
# If this device is added by the user we use the name as it is
if @_deviceType not in BuiltInDevices
return name
# We want to get these image from our public resources server
resourceUrl = "//resources.framerjs.com/static/DeviceResources"
# If we are running a local copy of Framer from the drive, get the resource online
if Utils.isFileUrl(window.location.href)
resourceUrl = "http://#{resourceUrl}"
# If we're running Framer Studio and have local files, we'd like to use those.
# For now we always use jp2 inside framer stusio
if Utils.isFramerStudio() and window.FramerStudioInfo
if @_device.minStudioVersion and Utils.framerStudioVersion() >= @_device.minStudioVersion or !@_device.minStudioVersion
if @_device.maxStudioVersion and Utils.framerStudioVersion() <= @_device.maxStudioVersion or !@_device.maxStudioVersion
resourceUrl = window.FramerStudioInfo.deviceImagesUrl
return "#{resourceUrl}/#{name.replace(".png", ".jp2")}"
# We'd like to use jp2/webp if possible, or check if we don't for this specific device
if @_device.deviceImageCompression is true
if Utils.isWebPSupported()
return "#{resourceUrl}/#{name.replace(".png", ".webp")}"
if Utils.isJP2Supported()
return "#{resourceUrl}/#{name.replace(".png", ".jp2")}"
return "#{resourceUrl}/#{name}"
###########################################################################
# DEVICE ZOOM
@define "deviceScale",
get: ->
if @_shouldRenderFullScreen()
return 1
return @_deviceScale or 1
set: (deviceScale) -> @setDeviceScale(deviceScale, false)
setDeviceScale: (deviceScale, animate=false) ->
if deviceScale == "fit" or deviceScale < 0
deviceScale = "fit"
else
deviceScale = parseFloat(deviceScale)
if deviceScale == @_deviceScale
return
@_deviceScale = deviceScale
if @_shouldRenderFullScreen()
return
if deviceScale == "fit"
phoneScale = @_calculatePhoneScale()
else
phoneScale = deviceScale
@hands.animateStop()
if animate
@hands.animate _.extend @animationOptions,
properties: {scale:phoneScale}
else
@hands.scale = phoneScale
@hands.center()
@emit("change:deviceScale")
_calculatePhoneScale: ->
# Calculates a phone scale that fits the screen unless a fixed value is set
[width, height] = @_getOrientationDimensions(@phone.width, @phone.height)
paddingOffset = @_device?.paddingOffset or 0
phoneScale = _.min([
(window.innerWidth - ((@padding + paddingOffset) * 2)) / width,
(window.innerHeight - ((@padding + paddingOffset) * 2)) / height
])
# Never scale the phone beyond 100%
phoneScale = 1 if phoneScale > 1
@emit("change:phoneScale", phoneScale)
if @_deviceScale and @_deviceScale isnt "fit"
return @_deviceScale
return phoneScale
###########################################################################
# CONTENT SCALE
@define "contentScale",
get: -> @_contentScale or 1
set: (contentScale) -> @setContentScale(contentScale, false)
setContentScale: (contentScale, animate=false) ->
contentScale = parseFloat(contentScale)
if contentScale <= 0
return
if contentScale is @_contentScale
return
@_contentScale = contentScale
if animate
@content.animate _.extend @animationOptions,
properties: {scale: @_contentScale}
else
@content.scale = @_contentScale
@_update()
@emit("change:contentScale")
###########################################################################
# PHONE ORIENTATION
@define "orientation",
get: ->
return window.orientation if Utils.isMobile()
return @_orientation or 0
set: (orientation) -> @setOrientation(orientation, false)
setOrientation: (orientation, animate=false) ->
orientation *= -1 if Utils.framerStudioVersion() == oldDeviceMaxVersion
if orientation == "portrait"
orientation = 0
if orientation == "landscape"
orientation = 90
if @_shouldRenderFullScreen()
return
orientation = parseInt(orientation)
if orientation not in [0, 90, -90]
return
if orientation is @_orientation
return
@_orientation = orientation
# Calculate properties for the phone
phoneProperties =
rotationZ: -@_orientation
scale: @_calculatePhoneScale()
contentProperties = @_viewportOrientationOffset()
@hands.animateStop()
@viewport.animateStop()
if animate
animation = @hands.animate _.extend @animationOptions,
properties: phoneProperties
@viewport.animate _.extend @animationOptions,
properties: contentProperties
animation.on Events.AnimationEnd, =>
@_update()
else
@hands.props = phoneProperties
@viewport.props = contentProperties
@_update()
@handsImageLayer.image = "" if @_orientation != 0
@emit("change:orientation", @_orientation)
_viewportOrientationOffset: =>
[width, height] = @_getOrientationDimensions(@_device.screenWidth, @_device.screenHeight)
@content.width = width
@content.height = height
offset = (@screen.width - width) / 2
offset *= -1 if @_orientation == -90
[x, y] = [0, 0]
if @isLandscape
x = offset
y = offset
return contentProperties =
rotationZ: @_orientation
x: x
y: y
_orientationChange: =>
@_orientation = window.orientation
@_update()
@emit("change:orientation", window.orientation)
@define "isPortrait", get: -> Math.abs(@orientation) % 180 is 0
@define "isLandscape", get: -> !@isPortrait
@define "orientationName",
get: ->
return "portrait" if @isPortrait
return "landscape" if @isLandscape
set: (orientationName) -> @setOrientation(orientationName, false)
rotateLeft: (animate=true) ->
return if @orientation is 90
@setOrientation(@orientation + 90, animate)
rotateRight: (animate=true) ->
return if @orientation is -90
@setOrientation(@orientation - 90, animate)
_getOrientationDimensions: (width, height) ->
if @isLandscape then [height, width] else [width, height]
###########################################################################
# HANDS
handSwitchingSupported: ->
return @_device.hands isnt undefined
nextHand: ->
return if @hands.rotationZ isnt 0
if @handSwitchingSupported()
hands = _.keys(@_device.hands)
if hands.length > 0
nextHandIndex = hands.indexOf(@selectedHand) + 1
nextHand = ""
nextHand = hands[nextHandIndex] if nextHandIndex < hands.length
hand = @setHand(nextHand)
@_update()
return hand
return false
setHand: (hand) ->
@selectedHand = hand
return @handsImageLayer.image = "" if !hand or !@handSwitchingSupported()
handData = @_device.hands[hand]
if handData
@hands.width = handData.width
@hands.height = handData.height
@hands.center()
@phone.center()
@handsImageLayer.size = @hands.size
@handsImageLayer.y = 0
@handsImageLayer.y = handData.offset if handData.offset
@handsImageLayer.image = @handImageUrl(hand)
return hand
handImageUrl: (hand) ->
# We want to get these image from our public resources server
resourceUrl = "//resources.framerjs.com/static/DeviceResources"
# If we are running a local copy of Framer from the drive, get the resource online
if Utils.isFileUrl(window.location.href)
resourceUrl = "http://#{resourceUrl}"
# If we're running Framer Studio and have local files, we'd like to use those
if Utils.isFramerStudio() and window.FramerStudioInfo and Utils.framerStudioVersion() >= newDeviceMinVersion
resourceUrl = window.FramerStudioInfo.deviceImagesUrl
return "#{resourceUrl}/#{hand}.png"
if Utils.isWebPSupported()
return "#{resourceUrl}/#{hand}.webp"
if Utils.isJP2Supported()
return "#{resourceUrl}/#{hand}.jp2"
return "#{resourceUrl}/#{hand}.png"
toInspect: ->
return "<Device '#{@deviceType}' #{@screenSize.width}x#{@screenSize.height}>"
###########################################################################
# DEVICE CONFIGURATIONS
newDeviceMinVersion = 53
oldDeviceMaxVersion = 52
iPadAir2BaseDevice =
deviceImageWidth: 1856
deviceImageHeight: 2608
deviceImageCompression: true
screenWidth: 1536
screenHeight: 2048
deviceType: "tablet"
minStudioVersion: newDeviceMinVersion
iPadMini4BaseDevice =
deviceImageWidth: 1936
deviceImageHeight: 2688
deviceImageCompression: true
screenWidth: 1536
screenHeight: 2048
deviceType: "tablet"
minStudioVersion: newDeviceMinVersion
iPadProBaseDevice =
deviceImageWidth: 2448
deviceImageHeight: 3432
deviceImageCompression: true
screenWidth: 2048
screenHeight: 2732
deviceType: "tablet"
minStudioVersion: newDeviceMinVersion
iPhone6BaseDevice =
deviceImageWidth: 874
deviceImageHeight: 1792
deviceImageCompression: true
screenWidth: 750
screenHeight: 1334
deviceType: "phone"
minStudioVersion: newDeviceMinVersion
hands:
"iphone-hands-2":
width: 2400
height: 3740
"iphone-hands-1":
width: 2400
height: 3740
iPhone6PlusBaseDevice =
deviceImageWidth: 1452
deviceImageHeight: 2968
deviceImageCompression: true
screenWidth: 1242
screenHeight: 2208
deviceType: "phone"
minStudioVersion: newDeviceMinVersion
hands:
"iphone-hands-2":
width: 3987
height: 6212
"iphone-hands-1":
width: 3987
height: 6212
iPhone5BaseDevice =
deviceImageWidth: 768
deviceImageHeight: 1612
deviceImageCompression: true
screenWidth: 640
screenHeight: 1136
deviceType: "phone"
minStudioVersion: newDeviceMinVersion
hands:
"iphone-hands-2":
width: 2098
height: 3269
offset: 19
"iphone-hands-1":
width: 2098
height: 3269
offset: 19
iPhone5CBaseDevice =
deviceImageWidth: 776
deviceImageHeight: 1620
deviceImageCompression: true
screenWidth: 640
screenHeight: 1136
deviceType: "phone"
minStudioVersion: newDeviceMinVersion
hands:
"iphone-hands-2":
width: 2098
height: 3269
offset: 28
"iphone-hands-1":
width: 2098
height: 3269
offset: 28
Nexus4BaseDevice =
deviceImageWidth: 860
deviceImageHeight: 1668
deviceImageCompression: true
screenWidth: 768
screenHeight: 1280
deviceType: "phone"
minStudioVersion: newDeviceMinVersion
hands:
"iphone-hands-2":
width: 2362
height: 3681
offset: -52
"iphone-hands-1":
width: 2362
height: 3681
offset: -52
Nexus5BaseDevice =
deviceImageWidth: 1204
deviceImageHeight: 2432
deviceImageCompression: true
screenWidth: 1080
screenHeight: 1920
deviceType: "phone"
minStudioVersion: newDeviceMinVersion
hands:
"iphone-hands-2":
width: 3292
height: 5130
offset: 8
"iphone-hands-1":
width: 3292
height: 5130
offset: 8
Nexus6BaseDevice =
deviceImageWidth: 1576
deviceImageHeight: 3220
deviceImageCompression: true
screenWidth: 1440
screenHeight: 2560
deviceType: "phone"
minStudioVersion: newDeviceMinVersion
hands:
"iphone-hands-2":
width: 4304
height: 6707
offset: 8
"iphone-hands-1":
width: 4304
height: 6707
offset: 8
Nexus9BaseDevice =
deviceImageWidth: 1896
deviceImageHeight: 2648
deviceImageCompression: true
screenWidth: 1536
screenHeight: 2048
deviceType: "tablet"
minStudioVersion: newDeviceMinVersion
HTCa9BaseDevice =
deviceImageWidth: 1252
deviceImageHeight: 2592
deviceImageCompression: true
screenWidth: 1080
screenHeight: 1920
deviceType: "phone"
minStudioVersion: newDeviceMinVersion
hands:
"iphone-hands-2":
width: 3436
height: 5354
offset: 36
"iphone-hands-1":
width: 3436
height: 5354
offset: 36
HTCm8BaseDevice =
deviceImageWidth: 1232
deviceImageHeight: 2572
deviceImageCompression: true
screenWidth: 1080
screenHeight: 1920
deviceType: "phone"
minStudioVersion: newDeviceMinVersion
hands:
"iphone-hands-2":
width: 3436
height: 5354
offset: 12
"iphone-hands-1":
width: 3436
height: 5354
offset: 12
MSFTLumia950BaseDevice =
deviceImageWidth: 1660
deviceImageHeight: 3292
deviceImageCompression: true
screenWidth: 1440
screenHeight: 2560
deviceType: "phone"
minStudioVersion: newDeviceMinVersion
hands:
"iphone-hands-2":
width: 4494
height: 7003
offset: -84
"iphone-hands-1":
width: 4494
height: 7003
offset: -84
SamsungGalaxyNote5BaseDevice =
deviceImageWidth: 1572
deviceImageHeight: 3140
deviceImageCompression: true
screenWidth: 1440
screenHeight: 2560
deviceType: "phone"
minStudioVersion: newDeviceMinVersion
hands:
"iphone-hands-2":
width: 4279
height: 6668
offset: -24
"iphone-hands-1":
width: 4279
height: 6668
offset: -84
AppleWatch42Device =
deviceImageWidth: 512
deviceImageHeight: 990
deviceImageCompression: true
screenWidth: 312
screenHeight: 390
minStudioVersion: newDeviceMinVersion
AppleWatch38Device =
deviceImageWidth: 472
deviceImageHeight: 772
deviceImageCompression: true
screenWidth: 272
screenHeight: 340
minStudioVersion: newDeviceMinVersion
AppleWatch38BlackLeatherDevice =
deviceImageWidth: 472
deviceImageHeight: 796
deviceImageCompression: true
screenWidth: 272
screenHeight: 340
minStudioVersion: newDeviceMinVersion
AppleMacBook =
deviceImageWidth: 3084
deviceImageHeight: 1860
deviceImageCompression: true
screenWidth: 2304
screenHeight: 1440
deviceType: "computer"
minStudioVersion: newDeviceMinVersion
AppleMacBookAir =
deviceImageWidth: 2000
deviceImageHeight: 1220
deviceImageCompression: true
screenWidth: 1440
screenHeight: 900
deviceType: "computer"
minStudioVersion: newDeviceMinVersion
AppleMacBookPro =
deviceImageWidth: 3820
deviceImageHeight: 2320
deviceImageCompression: true
screenWidth: 2880
screenHeight: 1800
deviceType: "computer"
minStudioVersion: newDeviceMinVersion
AppleIMac =
deviceImageWidth: 2800
deviceImageHeight: 2940
deviceImageCompression: true
screenWidth: 2560
screenHeight: 1440
deviceType: "computer"
minStudioVersion: newDeviceMinVersion
DellXPS =
deviceImageWidth: 5200
deviceImageHeight: 3040
deviceImageCompression: true
screenWidth: 3840
screenHeight: 2160
deviceType: "computer"
minStudioVersion: newDeviceMinVersion
SonyW85OC =
deviceImageWidth: 1320
deviceImageHeight: 860
deviceImageCompression: true
screenWidth: 1280
screenHeight: 720
minStudioVersion: newDeviceMinVersion
###########################################################################
# OLD DEVICE CONFIGURATIONS
old_iPhone6BaseDevice =
deviceImageWidth: 870
deviceImageHeight: 1738
deviceImageCompression: true
screenWidth: 750
screenHeight: 1334
deviceType: "phone"
maxStudioVersion: oldDeviceMaxVersion
old_iPhone6BaseDeviceHand = _.extend {}, old_iPhone6BaseDevice,
deviceImageWidth: 1988
deviceImageHeight: 2368
deviceImageCompression: true
paddingOffset: -150
maxStudioVersion: oldDeviceMaxVersion
old_iPhone6PlusBaseDevice =
deviceImageWidth: 1460
deviceImageHeight: 2900
deviceImageCompression: true
screenWidth: 1242
screenHeight: 2208
deviceType: "phone"
maxStudioVersion: oldDeviceMaxVersion
old_iPhone6PlusBaseDeviceHand = _.extend {}, old_iPhone6PlusBaseDevice,
deviceImageWidth: 3128
deviceImageHeight: 3487
deviceImageCompression: true
paddingOffset: -150
maxStudioVersion: oldDeviceMaxVersion
old_iPhone5BaseDevice =
deviceImageWidth: 780
deviceImageHeight: 1608
deviceImageCompression: true
screenWidth: 640
screenHeight: 1136
deviceType: "phone"
maxStudioVersion: oldDeviceMaxVersion
old_iPhone5BaseDeviceHand = _.extend {}, old_iPhone5BaseDevice,
deviceImageWidth: 1884
deviceImageHeight: 2234
deviceImageCompression: true
paddingOffset: -200
maxStudioVersion: oldDeviceMaxVersion
old_iPhone5CBaseDevice =
deviceImageWidth: 776
deviceImageHeight: 1612
deviceImageCompression: true
screenWidth: 640
screenHeight: 1136
deviceType: "phone"
maxStudioVersion: oldDeviceMaxVersion
old_iPhone5CBaseDeviceHand = _.extend {}, old_iPhone5CBaseDevice,
deviceImageWidth: 1894
deviceImageHeight: 2244
deviceImageCompression: true
paddingOffset: -200
maxStudioVersion: oldDeviceMaxVersion
old_iPadMiniBaseDevice =
deviceImageWidth: 872
deviceImageHeight: 1292
deviceImageCompression: true
screenWidth: 768
screenHeight: 1024
deviceType: "tablet"
maxStudioVersion: oldDeviceMaxVersion
old_iPadMiniBaseDeviceHand = _.extend {}, old_iPadMiniBaseDevice,
deviceImageWidth: 1380
deviceImageHeight: 2072
deviceImageCompression: true
paddingOffset: -120
maxStudioVersion: oldDeviceMaxVersion