gumby2-rails 0.0.1

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.
Files changed (72) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +29 -0
  5. data/Rakefile +1 -0
  6. data/gumby2-rails.gemspec +19 -0
  7. data/lib/gumby2-rails/version.rb +5 -0
  8. data/lib/gumby2-rails.rb +9 -0
  9. data/vendor/assets/.DS_Store +0 -0
  10. data/vendor/assets/fonts/icons/entypo.eot +0 -0
  11. data/vendor/assets/fonts/icons/entypo.ttf +0 -0
  12. data/vendor/assets/fonts/icons/entypo.woff +0 -0
  13. data/vendor/assets/js/libs/gumby.init.js +27 -0
  14. data/vendor/assets/js/libs/gumby.js +150 -0
  15. data/vendor/assets/js/libs/gumby.min.js +1 -0
  16. data/vendor/assets/js/libs/jquery-1.10.1.min.js +6 -0
  17. data/vendor/assets/js/libs/jquery-2.0.2.min.js +6 -0
  18. data/vendor/assets/js/libs/jquery.mobile.custom.min.js +3 -0
  19. data/vendor/assets/js/libs/modernizr-2.6.2.min.js +4 -0
  20. data/vendor/assets/js/libs/ui/gumby.checkbox.js +90 -0
  21. data/vendor/assets/js/libs/ui/gumby.fittext.js +107 -0
  22. data/vendor/assets/js/libs/ui/gumby.fixed.js +206 -0
  23. data/vendor/assets/js/libs/ui/gumby.navbar.js +115 -0
  24. data/vendor/assets/js/libs/ui/gumby.radiobtn.js +79 -0
  25. data/vendor/assets/js/libs/ui/gumby.retina.js +74 -0
  26. data/vendor/assets/js/libs/ui/gumby.skiplink.js +145 -0
  27. data/vendor/assets/js/libs/ui/gumby.tabs.js +71 -0
  28. data/vendor/assets/js/libs/ui/gumby.toggleswitch.js +203 -0
  29. data/vendor/assets/js/libs/ui/jquery.validation.js +138 -0
  30. data/vendor/assets/js/main.js +25 -0
  31. data/vendor/assets/js/plugins.js +8 -0
  32. data/vendor/assets/stylesheets/.DS_Store +0 -0
  33. data/vendor/assets/stylesheets/gumby.css +1876 -0
  34. data/vendor/assets/stylesheets/sass/_base.scss +71 -0
  35. data/vendor/assets/stylesheets/sass/_custom.scss +1 -0
  36. data/vendor/assets/stylesheets/sass/_fonts.scss +28 -0
  37. data/vendor/assets/stylesheets/sass/_grid.scss +273 -0
  38. data/vendor/assets/stylesheets/sass/_typography.scss +274 -0
  39. data/vendor/assets/stylesheets/sass/extensions/modular-scale/lib/modular-scale.rb +129 -0
  40. data/vendor/assets/stylesheets/sass/extensions/modular-scale/stylesheets/_modular-scale.scss +310 -0
  41. data/vendor/assets/stylesheets/sass/extensions/sassy-math/lib/sassy-math.rb +159 -0
  42. data/vendor/assets/stylesheets/sass/extensions/sassy-math/stylesheets/_math.scss +310 -0
  43. data/vendor/assets/stylesheets/sass/functions/_all.scss +15 -0
  44. data/vendor/assets/stylesheets/sass/functions/_breakpoints.scss +11 -0
  45. data/vendor/assets/stylesheets/sass/functions/_buttons.scss +44 -0
  46. data/vendor/assets/stylesheets/sass/functions/_clearfix.scss +25 -0
  47. data/vendor/assets/stylesheets/sass/functions/_forms.scss +18 -0
  48. data/vendor/assets/stylesheets/sass/functions/_grid-calc.scss +59 -0
  49. data/vendor/assets/stylesheets/sass/functions/_height-calc.scss +6 -0
  50. data/vendor/assets/stylesheets/sass/functions/_line-and-height.scss +7 -0
  51. data/vendor/assets/stylesheets/sass/functions/_responsivity.scss +34 -0
  52. data/vendor/assets/stylesheets/sass/functions/_semantic-grid.scss +187 -0
  53. data/vendor/assets/stylesheets/sass/functions/_strip-units.scss +5 -0
  54. data/vendor/assets/stylesheets/sass/functions/_typography.scss +15 -0
  55. data/vendor/assets/stylesheets/sass/functions/_visibility.scss +17 -0
  56. data/vendor/assets/stylesheets/sass/gumby.scss +37 -0
  57. data/vendor/assets/stylesheets/sass/ui/_all.scss +10 -0
  58. data/vendor/assets/stylesheets/sass/ui/_buttons.scss +151 -0
  59. data/vendor/assets/stylesheets/sass/ui/_forms.scss +379 -0
  60. data/vendor/assets/stylesheets/sass/ui/_icons.scss +37 -0
  61. data/vendor/assets/stylesheets/sass/ui/_images.scss +21 -0
  62. data/vendor/assets/stylesheets/sass/ui/_labels.scss +86 -0
  63. data/vendor/assets/stylesheets/sass/ui/_navbar.scss +417 -0
  64. data/vendor/assets/stylesheets/sass/ui/_tables.scss +87 -0
  65. data/vendor/assets/stylesheets/sass/ui/_tabs.scss +109 -0
  66. data/vendor/assets/stylesheets/sass/ui/_toggles.scss +69 -0
  67. data/vendor/assets/stylesheets/sass/ui/_video.scss +22 -0
  68. data/vendor/assets/stylesheets/sass/var/_lists.scss +20 -0
  69. data/vendor/assets/stylesheets/sass/var/_settings.scss +149 -0
  70. data/vendor/assets/stylesheets/sass/var/icons/_entypo-icon-list.scss +286 -0
  71. data/vendor/assets/stylesheets/sass/var/icons/_entypo.scss +294 -0
  72. metadata +116 -0
@@ -0,0 +1,129 @@
1
+ require 'compass'
2
+ Compass::Frameworks.register('sassy-math', :path => File.expand_path("../.."))
3
+
4
+
5
+ # This tells Compass what your Compass extension is called, and where to find
6
+ # its files
7
+ # Replace 'extension' with the name of your extension. Spaces allowed.
8
+ extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
9
+ Compass::Frameworks.register('modular-scale', :path => extension_path)
10
+
11
+ # Version and date of version for your Compass extension.
12
+ # Replace Extension with the name of your extension
13
+ # Letters, numbers, and underscores only
14
+ # Version is a number. If a version contains alphas, it will be created as
15
+ # a prerelease version
16
+ # Date is in the form of YYYY-MM-DD
17
+ module ModularScale
18
+ VERSION = "1.0.6"
19
+ DATE = "2012-08-13"
20
+ end
21
+
22
+ # This is where any custom SassScript should be placed. The functions will be
23
+ # available on require of your extension without the need for users to import
24
+ # any partials. Uncomment below.
25
+
26
+ # Modular Scale Sass Script
27
+ module Sass::Script
28
+ class Number < Literal
29
+ # Comparison
30
+ def <=>(other)
31
+ value <=> other.value
32
+ end
33
+ end
34
+ end
35
+
36
+ module Sass::Script::Functions
37
+ # Modular Scale
38
+ def double_octave
39
+ value = 4 / 1.0
40
+ Sass::Script::Number.new(value)
41
+ end
42
+ def major_twelfth
43
+ value = 3 / 1.0
44
+ Sass::Script::Number.new(value)
45
+ end
46
+ def major_eleventh
47
+ value = 8 / 3.0
48
+ Sass::Script::Number.new(value)
49
+ end
50
+ def major_tenth
51
+ value = 5 / 2.0
52
+ Sass::Script::Number.new(value)
53
+ end
54
+ def octave
55
+ value = 2 / 1.0
56
+ Sass::Script::Number.new(value)
57
+ end
58
+ def major_seventh
59
+ value = 15 / 8.0
60
+ Sass::Script::Number.new(value)
61
+ end
62
+ def minor_seventh
63
+ value = 16 /9.0
64
+ Sass::Script::Number.new(value)
65
+ end
66
+ def major_sixth
67
+ value = 5 / 3.0
68
+ Sass::Script::Number.new(value)
69
+ end
70
+ def minor_sixth
71
+ value = 8 / 5.0
72
+ Sass::Script::Number.new(value)
73
+ end
74
+ def fifth
75
+ value = 3 / 2.0
76
+ Sass::Script::Number.new(value)
77
+ end
78
+ def augmented_fourth
79
+ value = Math.sqrt(2) / 1.0
80
+ Sass::Script::Number.new(value)
81
+ end
82
+ def fourth
83
+ value = 4 / 3.0
84
+ Sass::Script::Number.new(value)
85
+ end
86
+ def major_third
87
+ value = 5 / 4.0
88
+ Sass::Script::Number.new(value)
89
+ end
90
+ def minor_third
91
+ value = 6 / 5.0
92
+ Sass::Script::Number.new(value)
93
+ end
94
+ def major_second
95
+ value = 9 / 8.0
96
+ Sass::Script::Number.new(value)
97
+ end
98
+ def minor_second
99
+ value = 16 / 15.0
100
+ Sass::Script::Number.new(value)
101
+ end
102
+
103
+ # Lists
104
+ def sort_list(list)
105
+ sep = list.separator if list.is_a?(Sass::Script::List)
106
+ list = list.to_a.sort
107
+ Sass::Script::List.new(list, sep)
108
+ end
109
+ def reverse_list(list)
110
+ sep = list.separator if list.is_a?(Sass::Script::List)
111
+ list = list.to_a.reverse
112
+ Sass::Script::List.new(list, sep)
113
+ end
114
+ def trim_list(list, threshold, ascending)
115
+ # remove list items above or below a threshold
116
+ sep = list.separator if list.is_a?(Sass::Script::List)
117
+ list = list.to_a
118
+ if ascending.value
119
+ list = list.delete_if {
120
+ |x| x.value <= threshold.value
121
+ }
122
+ else
123
+ list = list.delete_if {
124
+ |x| x.value >= threshold.value
125
+ }
126
+ end
127
+ Sass::Script::List.new(list, sep)
128
+ end
129
+ end
@@ -0,0 +1,310 @@
1
+ // SASSY MODULAR-SCALE
2
+ // https://github.com/scottkellum/modular-scale
3
+
4
+ // Defaults
5
+ $ratio: golden_ratio() !default;
6
+ $base-size: 16px !default;
7
+ $round-pixels: true !default;
8
+
9
+ // Modular Scale function
10
+ @function modular-scale($multiple, $base-size: $base-size, $ratio: $ratio, $round-pixels: $round-pixels) {
11
+
12
+ // return the $base-size if $multiple is zero
13
+ @if $multiple == 0 {
14
+ @if type-of($base-size) == "list" {
15
+ $base-size: sort_list($base-size);
16
+ @return nth($base-size, 1);
17
+ }
18
+
19
+ // return just the simple $base-size value if it's not a list
20
+ @return $base-size;
21
+ }
22
+
23
+ // if multiple base-sizes are passed in as a list
24
+ // and multiple ratios are passed in as a list
25
+ // calculate values in using each base-size / ratio combination
26
+ @if type-of($base-size) == "list" and type-of($ratio) == "list" {
27
+ @if unit(ms-multibase-multiratio($multiple, $base-size, $ratio)) == "px" and $round-pixels == true {
28
+ @return round(ms-multibase-multiratio($multiple, $base-size, $ratio));
29
+ }
30
+ @return ms-multibase-multiratio($multiple, $base-size, $ratio);
31
+ }
32
+
33
+ // if multiple base-sizes are passed in as a list
34
+ // calculate values in using each base-size
35
+ @if type-of($base-size) == "list" and type-of($ratio) == "number" {
36
+ @if unit(ms-multibase($multiple, $base-size, $ratio)) == "px" and $round-pixels == true {
37
+ @return round(ms-multibase($multiple, $base-size, $ratio));
38
+ }
39
+ @return ms-multibase($multiple, $base-size, $ratio);
40
+ }
41
+
42
+ // if multiple ratios are passed in as a list
43
+ // calculate values in using each ratio
44
+ @if type-of($base-size) == "number" and type-of($ratio) == "list" {
45
+ @if unit(ms-multiratio($multiple, $base-size, $ratio)) == "px" and $round-pixels == true {
46
+ @return round(ms-multiratio($multiple, $base-size, $ratio));
47
+ }
48
+ @return ms-multiratio($multiple, $base-size, $ratio);
49
+ }
50
+
51
+ // If there are no lists just run the simple function
52
+ @if unit(power($ratio, $multiple) * $base-size) == "px" and $round-pixels == true {
53
+ @return round(power($ratio, $multiple) * $base-size);
54
+ }
55
+ @return power($ratio, $multiple) * $base-size;
56
+ }
57
+
58
+ // calculate values in using each base-size / ratio combination
59
+ @function ms-multibase-multiratio($multiple, $base-size: $base-size, $ratio: $ratio) {
60
+
61
+ // start with an empty list to place all values in
62
+ $scale-values: ();
63
+
64
+ // make sure base sizes are in ascending order
65
+ $base-size: sort_list($base-size);
66
+
67
+ // take each base-size in turn
68
+ $k: 1;
69
+ @while $k <= length($base-size) {
70
+
71
+ // add each $base-size to the list except the first
72
+ @if $k > 1 {
73
+ $scale-values: append($scale-values, nth($base-size, $k));
74
+ }
75
+
76
+ // take each ratio in turn
77
+ $j: 1;
78
+ @while $j <= length($ratio) {
79
+
80
+ // reset $modular-scale for each set
81
+ $modular-scale: nth($base-size, $k);
82
+
83
+ // do the scale for each base-size using this ratio
84
+ @if $multiple > 0 {
85
+
86
+ // up $multiple times
87
+ // and add the result to $scale-values
88
+ @for $i from 1 through $multiple {
89
+ $modular-scale: power(nth($ratio, $j), $i) * nth($base-size, $k);
90
+ $scale-values: append($scale-values, $modular-scale);
91
+ }
92
+
93
+ // and down until the value is lower than the lowest $base-size
94
+ // and add the result to $scale-values
95
+ $i: -1;
96
+ $modular-scale: nth($base-size, $k);
97
+ @while $modular-scale >= nth($base-size, 1) {
98
+ $modular-scale: power(nth($ratio, $j), $i) * nth($base-size, $k);
99
+ $scale-values: append($scale-values, $modular-scale);
100
+ $i: $i - 1;
101
+ }
102
+ }
103
+ @if $multiple < 0 {
104
+
105
+ // do the scale down for each set to below 1px
106
+ $i: 0;
107
+ $modular-scale: nth($base-size, $k);
108
+ @while $i >= $multiple {
109
+ $modular-scale: power(nth($ratio, $j), $i) * nth($base-size, $k);
110
+ $scale-values: append($scale-values, $modular-scale);
111
+ $i: $i - 1;
112
+ }
113
+ }
114
+ $j: $j + 1;
115
+ }
116
+ $k: $k + 1;
117
+ }
118
+
119
+ // return trimmed and sorted final list
120
+ @return trim-sort($multiple, $scale-values, $base-size);
121
+ }
122
+
123
+ // calculate values in using each base-size
124
+ @function ms-multibase($multiple, $base-size: $base-size, $ratio: $ratio) {
125
+
126
+ // start with an empty list to place all values in
127
+ $scale-values: ();
128
+
129
+ // make sure base sizes are in ascending order
130
+ $base-size: sort_list($base-size);
131
+
132
+ // take each base-size in turn
133
+ $k: 1;
134
+ @while $k <= length($base-size) {
135
+
136
+ // add each $base-size to the list except the first
137
+ @if $k > 1 {
138
+ $scale-values: append($scale-values, nth($base-size, $k));
139
+ }
140
+
141
+ // reset $modular-scale for each set
142
+ $modular-scale: nth($base-size, $k);
143
+
144
+ // do the scale for each base-size using this ratio
145
+ @if $multiple > 0 {
146
+
147
+ // up $multiple times
148
+ // and add the result to $scale-values
149
+ @for $i from 1 through $multiple {
150
+ $modular-scale: power($ratio, $i) * nth($base-size, $k);
151
+ $scale-values: append($scale-values, $modular-scale);
152
+ }
153
+
154
+ // and down until the value is lower than the lowest $base-size
155
+ // and add the result to $scale-values
156
+ $i: -1;
157
+ $modular-scale: nth($base-size, $k);
158
+ @while $modular-scale >= nth($base-size, 1) {
159
+ $modular-scale: power($ratio, $i) * nth($base-size, $k);
160
+ $scale-values: append($scale-values, $modular-scale);
161
+ $i: $i - 1;
162
+ }
163
+ }
164
+ @if $multiple < 0 {
165
+
166
+ // do the scale down for each set to below 1px
167
+ $i: 0;
168
+ $modular-scale: nth($base-size, $k);
169
+ @while $i >= $multiple {
170
+ $modular-scale: power($ratio, $i) * nth($base-size, $k);
171
+ $scale-values: append($scale-values, $modular-scale);
172
+ $i: $i - 1;
173
+ }
174
+ }
175
+ $k: $k + 1;
176
+ }
177
+
178
+ // return trimmed and sorted final list
179
+ @return trim-sort($multiple, $scale-values, $base-size);
180
+ }
181
+
182
+ // calculate values in using each ratio
183
+ @function ms-multiratio($multiple, $base-size: $base-size, $ratio: $ratio) {
184
+
185
+ // start with an empty list to place all values in
186
+ $scale-values: ();
187
+
188
+ // If $multiple is a positive integer (up the scale)
189
+ @if $multiple > 0 {
190
+
191
+ // take each ratio in turn
192
+ $j: 1;
193
+ @while $j <= length($ratio) {
194
+
195
+ // reset $modular-scale for each set
196
+ $modular-scale: $base-size;
197
+
198
+ // do the scale using this ratio thru the multiple, and add the result to $scale-values
199
+ @for $i from 1 through $multiple {
200
+ $modular-scale: power(nth($ratio, $j), $i) * $base-size;
201
+ $scale-values: append($scale-values, $modular-scale);
202
+ }
203
+ $j: $j + 1;
204
+ }
205
+
206
+ // sort acsending
207
+ $scale-values: sort_list($scale-values);
208
+
209
+ // return the final value using the laced list
210
+ @return nth($scale-values, $multiple);
211
+ }
212
+
213
+ // If $multiple is a negative integer (down the scale)
214
+ @if $multiple < 0 {
215
+
216
+ // take each ratio in turn
217
+ $j: 1;
218
+ @while $j <= length($ratio) {
219
+
220
+ // reset $modular-scale for each set
221
+ $modular-scale: $base-size;
222
+
223
+ // do the scale using this ratio thru the multiple, and add the result to $scale-values
224
+ @for $i from 1 through $multiple * -1 {
225
+ $modular-scale: power(nth($ratio, $j), -$i) * $base-size;
226
+ $scale-values: append($scale-values, $modular-scale);
227
+ }
228
+ $j: $j + 1;
229
+ }
230
+
231
+ // sort decending
232
+ $scale-values: reverse_list(sort_list($scale-values));
233
+
234
+ // return the final value using the laced list
235
+ @return nth($scale-values, $multiple * -1);
236
+ }
237
+ }
238
+
239
+ // trim and sort the final list
240
+ @function trim-sort($multiple, $scale-values: $scale-values, $base-size: $base-size) {
241
+ @if $multiple > 0 {
242
+
243
+ // trim list so we can count from the lowest $base-size
244
+ $scale-values: trim_list($scale-values, nth($base-size, 1), true);
245
+
246
+ // sort acsending
247
+ $scale-values: sort_list($scale-values);
248
+
249
+ // return the final value using the laced list
250
+ @return nth($scale-values, $multiple);
251
+ }
252
+ @else {
253
+
254
+ // trim list so we can count from the lowest $base-size
255
+ $scale-values: trim_list($scale-values, nth($base-size, 1), false);
256
+
257
+ // sort acsending
258
+ $scale-values: reverse_list(sort_list($scale-values));
259
+
260
+ // return the final value using the laced list
261
+ @return nth($scale-values, -$multiple);
262
+ }
263
+ }
264
+
265
+ /////////////////////////////////////////////////////////////////////////
266
+
267
+ // alias for golden_ratio()
268
+ @function golden() {
269
+ @return golden_ratio();
270
+ }
271
+
272
+ // Shortcut
273
+ @function ms($multiple, $base-size: $base-size, $ratio: $ratio, $round-pixels: $round-pixels) {
274
+ // Return the value from the Modular Scale function
275
+ @return modular-scale($multiple, $base-size, $ratio, $round-pixels);
276
+ }
277
+
278
+ // Write Modular Scale List
279
+ @function modular-scale-list($start: 0, $finish: 20, $base-size: $base-size, $ratio: $ratio, $round-pixels: $round-pixels) {
280
+ $ms-list: unquote("MS-LIST:");
281
+ @for $i from $start through $finish {
282
+ $ms-list: append($ms-list, ms($i, $base-size, $ratio, $round-pixels));
283
+ }
284
+ @return $ms-list;
285
+ }
286
+
287
+ @function ms-list($start: 0, $finish: 20, $base-size: $base-size, $ratio: $ratio, $round-pixels: $round-pixels) {
288
+ @return modular-scale-list($start, $finish, $base-size, $ratio, $round-pixels);
289
+ }
290
+
291
+ @mixin modular-scale-list($start: 0, $finish: 20, $base-size: $base-size, $ratio: $ratio, $round-pixels: $round-pixels) {
292
+ @debug modular-scale-list($start, $finish, $base-size, $ratio, $round-pixels);
293
+ }
294
+
295
+ @mixin ms-list($start: 0, $finish: 20, $base-size: $base-size, $ratio: $ratio, $round-pixels: $round-pixels) {
296
+ @debug modular-scale-list($start, $finish, $base-size, $ratio, $round-pixels);
297
+ }
298
+
299
+ @mixin modular-scale-list-output($start: 0, $finish: 20, $base-size: $base-size, $ratio: $ratio, $round-pixels: $round-pixels) {
300
+ MODULAR-SCALE-LIST {
301
+ ms-list: modular-scale-list($start, $finish, $base-size, $ratio, $round-pixels);
302
+ }
303
+ }
304
+
305
+ @mixin ms-list-output($start: 0, $finish: 20, $base-size: $base-size, $ratio: $ratio, $round-pixels: $round-pixels) {
306
+ @include modular-scale-list-output($start, $finish, $base-size, $ratio, $round-pixels);
307
+ }
308
+
309
+ // Other libraries can easily query if this function is avalible
310
+ $modular-scale-loaded: true;
@@ -0,0 +1,159 @@
1
+ require 'compass'
2
+ Compass::Frameworks.register("sassy-math", :path => "#{File.dirname(__FILE__)}/..")
3
+
4
+ # Sassy math Functions
5
+ module Sass::Script::Functions
6
+ # Exponents
7
+ def exponent(base, powerNum, powerDen)
8
+ base = base.value.to_f
9
+ powerNum = powerNum.value.to_f
10
+ powerDen = powerDen.value.to_f
11
+ result = base ** (powerNum / powerDen)
12
+ Sass::Script::Number.new(result)
13
+ end
14
+ def power(base, exponent)
15
+ base = base.value.to_f
16
+ exponent = exponent.value.to_f
17
+ result = base ** exponent
18
+ Sass::Script::Number.new(result)
19
+ end
20
+ def sqrt(number)
21
+ number = number.value.to_f
22
+ result = Math.sqrt(number)
23
+ Sass::Script::Number.new(result)
24
+ end
25
+ def nth_root(number, root)
26
+ number = number.value.to_f
27
+ root = root.value.to_f
28
+ result = number ** (1.0 / root)
29
+ Sass::Script::Number.new(result)
30
+ end
31
+ # Logarithms
32
+ def ln(num)
33
+ result = Math.log(num.value)
34
+ Sass::Script::Number.new(result)
35
+ end
36
+ def log10(num)
37
+ result = Math.log10(num.value)
38
+ Sass::Script::Number.new(result)
39
+ end
40
+ # Miscellaneous
41
+ def factorial(number)
42
+ result = 1
43
+ number = number.value
44
+ if number > 0
45
+ (1..number).each do |i|
46
+ result = result * i
47
+ end
48
+ end
49
+ Sass::Script::Number.new(result)
50
+ end
51
+ def random(max = Sass::Script::Number.new(100)) ## shamelessly taken from here: https://gist.github.com/1561650
52
+ Sass::Script::Number.new(rand(max.value), max.numerator_units, max.denominator_units)
53
+ end
54
+ def hypot(a, b)
55
+ a = a.value.to_f
56
+ b = b.value.to_f
57
+ result = Math.hypot(a, b)
58
+ Sass::Script::Number.new(result)
59
+ end
60
+ # Constants
61
+ def pi
62
+ pi = Math::PI
63
+ Sass::Script::Number.new(pi)
64
+ end
65
+ def e
66
+ e = Math::E
67
+ Sass::Script::Number.new(e)
68
+ end
69
+ def golden_ratio()
70
+ result = (1.0 / 2.0) + (Math.sqrt(5) / 2.0)
71
+ Sass::Script::Number.new(result)
72
+ end
73
+ # Comparative Functions
74
+ def is_int(number)
75
+ number = number.value.to_f
76
+ if number - number.floor != 0
77
+ result = false
78
+ else
79
+ result = true
80
+ end
81
+ Sass::Script::Bool.new(result)
82
+ end
83
+ def is_float(number)
84
+ number = number.value
85
+ if number - number.floor != 0
86
+ result = true
87
+ else
88
+ result = false
89
+ end
90
+ Sass::Script::Bool.new(result)
91
+ end
92
+ # Trigonometric Functions
93
+ def deg_to_rad(degree)
94
+ result = degree.value.to_f * Math::PI / 180
95
+ Sass::Script::Number.new(result)
96
+ end
97
+ def rad_to_deg(rad)
98
+ result = rad.value.to_f * 180 / Math::PI
99
+ Sass::Script::Number.new(result)
100
+ end
101
+ def cosh(rad)
102
+ rad = rad.value.to_f
103
+ result = Math.cosh(rad)
104
+ Sass::Script::Number.new(result)
105
+ end
106
+ def acos(rad)
107
+ rad = rad.value.to_f
108
+ result = Math.acos(rad)
109
+ Sass::Script::Number.new(result)
110
+ end
111
+ def acosh(rad)
112
+ rad = rad.value.to_f
113
+ result = Math.acosh(rad)
114
+ Sass::Script::Number.new(result)
115
+ end
116
+ def sinh(rad)
117
+ rad = rad.value.to_f
118
+ result = Math.sinh(rad)
119
+ Sass::Script::Number.new(result)
120
+ end
121
+ def asin(rad)
122
+ rad = rad.value.to_f
123
+ result = Math.asin(rad)
124
+ Sass::Script::Number.new(result)
125
+ end
126
+ def asinh(rad)
127
+ rad = rad.value.to_f
128
+ result = Math.asinh(rad)
129
+ Sass::Script::Number.new(result)
130
+ end
131
+ def tanh(rad)
132
+ rad = rad.value.to_f
133
+ result = Math.tanh(rad)
134
+ Sass::Script::Number.new(result)
135
+ end
136
+ def atan(rad)
137
+ rad = rad.value.to_f
138
+ result = Math.atan(rad)
139
+ Sass::Script::Number.new(result)
140
+ end
141
+ def atan2(y, x)
142
+ y = y.value.to_f
143
+ x = x.value.to_f
144
+ result = Math.atan2(y, x)
145
+ Sass::Script::Number.new(result)
146
+ end
147
+ def atanh(rad)
148
+ rad = rad.value.to_f
149
+ result = Math.atanh(rad)
150
+ Sass::Script::Number.new(result)
151
+ end
152
+ end
153
+
154
+ module SassyMath
155
+
156
+ VERSION = "1.5"
157
+ DATE = "2012-07-29"
158
+
159
+ end