Skip to content
This repository
Browse code

fix key typo

  • Loading branch information...
commit 350ae52ae1f0182a3abc850774ffce23552c8c43 1 parent ef35170
Alex Sexton SlexAxton authored

Showing 1 changed file with 17 additions and 17 deletions. Show diff stats Hide diff stats

  1. +17 17 src/gfx.cube.coffee
34 src/gfx.cube.coffee
@@ -2,24 +2,24 @@ $ = jQuery
2 2
3 3 sides =
4 4 front: {rotateY: '0deg', rotateX: '0deg'}
5   - back: {rotateX: '-180deg', rotateX: '0deg'}
  5 + back: {rotateY: '-180deg', rotateX: '0deg'}
6 6 right: {rotateY: '-90deg', rotateX: '0deg'}
7 7 left: {rotateY: '90deg', rotateX: '0deg'}
8 8 top: {rotateY: '0deg', rotateX: '-90deg'}
9 9 bottom: {rotateY: '0deg', rotateX: '90deg'}
10 10
11   -defaults =
  11 +defaults =
12 12 width: 300
13 13 height: 300
14 14
15 15 $.fn.gfxCube = (options) ->
16 16 opts = $.extend({}, defaults, options)
17   -
  17 +
18 18 element = $(@)
19   -
  19 +
20 20 tZ = opts.translateZ or opts.width / 2
21 21 tZ += 'px' if typeof tZ is 'number'
22   -
  22 +
23 23 element.transform
24 24 position: 'relative'
25 25 width: opts.width
@@ -28,7 +28,7 @@ $.fn.gfxCube = (options) ->
28 28 '-moz-perspective': '3000'
29 29 '-webkit-perspective-origin': '50% 50%'
30 30 '-moz-perspective-origin': '50% 50%'
31   -
  31 +
32 32 wrapper = $('<div />')
33 33 wrapper.addClass('gfxCubeWrapper')
34 34 wrapper.transform
@@ -43,9 +43,9 @@ $.fn.gfxCube = (options) ->
43 43 translateZ: "-#{tZ}"
44 44 '-webkit-transform-style': 'preserve-3d'
45 45 '-moz-transform-style': 'preserve-3d'
46   - '-webkit-transform-origin': '50% 50%'
47   - '-moz-transform-origin': '50% 50%'
48   -
  46 + '-webkit-transform-origin': '50% 50%'
  47 + '-moz-transform-origin': '50% 50%'
  48 +
49 49 element.children().wrapAll(wrapper).css
50 50 display: 'block'
51 51 position: 'absolute'
@@ -54,25 +54,25 @@ $.fn.gfxCube = (options) ->
54 54 left: 0
55 55 top: 0
56 56 overflow: 'hidden'
57   -
  57 +
58 58 front = element.find('.front')
59 59 back = element.find('.back')
60 60 right = element.find('.right')
61 61 left = element.find('.left')
62 62 top = element.find('.top')
63 63 bottom = element.find('.bottom')
64   -
  64 +
65 65 front.transform rotateY: '0deg', translateZ: tZ
66 66 back.transform rotateY: '180deg', translateZ: tZ
67 67 right.transform rotateY: '90deg', translateZ: tZ
68 68 left.transform rotateY: '-90deg', translateZ: tZ
69 69 top.transform rotateX: '90deg', translateZ: tZ
70 70 bottom.transform rotateX: '-90deg', translateZ: tZ
71   -
  71 +
72 72 $(@).bind 'cube', (e, type) ->
73 73 wrapper = element.find('.gfxCubeWrapper')
74 74 wrapper.gfx($.extend({}, {translateZ: "-#{tZ}"}, sides[type]))
75   -
  75 +
76 76 # Disable cubes in Firefox / Chrome < 12
77 77 chromeRegex = /(Chrome)[\/]([\w.]+)/
78 78 chromeMatch = chromeRegex.exec( navigator.userAgent ) or []
@@ -81,14 +81,14 @@ chrome11 = chromeRegex[1] and chromeRegex[2].test(/^12\./)
81 81 if not $.browser.webkit or chrome11
82 82 $.fn.gfxCube = (options) ->
83 83 opts = $.extend({}, defaults, options)
84   -
  84 +
85 85 element = $(@)
86   -
  86 +
87 87 element.css
88 88 position: 'relative'
89 89 width: opts.width
90 90 height: opts.height
91   -
  91 +
92 92 wrapper = $('<div />')
93 93 wrapper.addClass('gfxCubeWrapper')
94 94 wrapper.transform
@@ -109,7 +109,7 @@ if not $.browser.webkit or chrome11
109 109 overflow: 'hidden'
110 110
111 111 wrapper = element.find('.gfxCubeWrapper')
112   -
  112 +
113 113 wrapper.children('*:not(.front)').hide()
114 114 element.bind 'cube', (e, type) ->
115 115 wrapper.children().hide()

0 comments on commit 350ae52

Please sign in to comment.
Something went wrong with that request. Please try again.