seasons 0.9.3.beta11 → 0.9.3.beta12

Sign up to get free protection for your applications and to get access to all the features.
data/seasons.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{seasons}
5
- s.version = "0.9.3.beta11"
5
+ s.version = "0.9.3.beta12"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5")
8
8
  s.authors = ["Scott Kellum"]
@@ -20,7 +20,9 @@ Gem::Specification.new do |s|
20
20
  "stylesheets/seasons/tools/_css3.sass",
21
21
  "stylesheets/seasons/tools/_flexbox.sass",
22
22
  "stylesheets/seasons/tools/_grid-tools.sass",
23
+ "stylesheets/seasons/tools/_math.scss",
23
24
  "stylesheets/seasons/tools/_modular-scale.sass",
25
+ "stylesheets/seasons/tools/_relative-pixels.sass",
24
26
  "stylesheets/seasons/tools/_reset.sass",
25
27
  "stylesheets/seasons/plugin/_ad.sass",
26
28
  "stylesheets/seasons/plugin/_ipad.sass",
@@ -1,7 +1,9 @@
1
- @import tools/reset
2
- @import tools/css3
3
- @import tools/color-schemer
4
1
  @import tools/basic-functions
2
+ @import tools/color-schemer
3
+ @import tools/css3
4
+ @import tools/flexbox
5
5
  @import tools/grid-tools
6
+ @import tools/math
6
7
  @import tools/modular-scale
7
- @import tools/flexbox
8
+ @import tools/relative-pixels
9
+ @import tools/reset
@@ -0,0 +1,275 @@
1
+ // SASSY MATH
2
+
3
+ @charset "UTF-8";
4
+
5
+ //////////////////////////////
6
+ // Variables
7
+ //////////////////////////////
8
+ $pi: 3.1415926535897932384626433832795028841971693993751;
9
+ $π: $pi;
10
+ $e: 2.71828182845904523536028747135266249775724709369995;
11
+
12
+ $iter: 50;
13
+
14
+ //////////////////////////////
15
+ // Random Number
16
+ // Working from http://xkcd.com/221/
17
+ // Chosen by fair dice roll.
18
+ // Guarenteed to be random.
19
+ //////////////////////////////
20
+ @function rand() {
21
+ @return 4;
22
+ }
23
+
24
+ //////////////////////////////
25
+ // Percent
26
+ //////////////////////////////
27
+ @function percent($number) {
28
+ @return $number * 0.01;
29
+ }
30
+
31
+ //////////////////////////////
32
+ // Golden Ratio
33
+ //////////////////////////////
34
+ @function golden() {
35
+ @return 1/2 + sqrt(5) / 2;
36
+ }
37
+ @function ϕ() {
38
+ @return golden();
39
+ }
40
+
41
+ $golden: golden();
42
+ $gold: $golden;
43
+ $ϕ: $golden;
44
+
45
+ //////////////////////////////
46
+ // Exponent
47
+ //////////////////////////////
48
+ @function exponent($base, $exponent) {
49
+ // reset value
50
+ $value: $base;
51
+ // positive intergers get multiplied
52
+ @if $exponent > 1 {
53
+ @for $i from 2 through $exponent {
54
+ $value: $value * $base; } }
55
+ // negitive intergers get divided. A number divided by itself is 1
56
+ @if $exponent < 1 {
57
+ @for $i from 0 through -$exponent {
58
+ $value: $value / $base; } }
59
+ // return the last value written
60
+ @return $value;
61
+ }
62
+
63
+ @function pow($base, $exponent) {
64
+ @return exponent($base, $exponent);
65
+ }
66
+
67
+ //////////////////////////////
68
+ // Factorial
69
+ //////////////////////////////
70
+ @function factorial($number) {
71
+ // reset value
72
+ $value: 1;
73
+ // positive intergers get multiplied
74
+ @if $number > 0 {
75
+ @for $i from 1 through $number {
76
+ $value: $value * $i;
77
+ }
78
+ }
79
+ @return $value;
80
+ }
81
+
82
+ @function fact($number) {
83
+ @return factorial($number);
84
+ }
85
+
86
+
87
+ //////////////////////////////
88
+ // Polynomial Approximation
89
+ //////////////////////////////
90
+ // Maclaurin series can be used to estimate Sine and Consine
91
+ @function maclaurin($start, $key, $number) {
92
+ $value: $start;
93
+ $add: 0;
94
+
95
+ @for $i from 1 through $iter {
96
+ @if $add == 0 {
97
+ $value: $value - ( exponent($number, $key) / factorial($key) );
98
+ $add: 1;
99
+ }
100
+ @else {
101
+ $value: $value + ( exponent($number, $key) / factorial($key) );
102
+ $add: 0;
103
+ }
104
+
105
+ $key: $key + 2;
106
+ }
107
+
108
+ @return $value;
109
+ }
110
+ // Taylor series can be used to estiamte ln
111
+ @function taylor($number) {
112
+ @return taylor;
113
+ }
114
+
115
+ //////////////////////////////
116
+ // Basic Trig Functions
117
+ //////////////////////////////
118
+ @function sin($number, $unit: 'deg') {
119
+ @if $unit == 'deg' {
120
+ $number: deg-to-rad($number);
121
+ }
122
+ @return maclaurin($number, 3, $number);
123
+ }
124
+
125
+ @function cos($number, $unit: 'deg') {
126
+ @if $unit == 'deg' {
127
+ $number: deg-to-rad($number);
128
+ }
129
+ @return maclaurin(1, 2, $number);
130
+ }
131
+
132
+ // Trig Identity: Tangent = Sine divided by Cosine.
133
+ @function tan($number, $unit: 'deg') {
134
+ @if $unit == 'deg' {
135
+ $number: deg-to-rad($number);
136
+ }
137
+ @return sin($number) / cos($number);
138
+ }
139
+
140
+ //////////////////////////////
141
+ // Reciprocal Trig Functions
142
+ //////////////////////////////
143
+ @function csc($number, $unit: 'deg') {
144
+ @if $unit == 'deg' {
145
+ $number: deg-to-rad($number);
146
+ }
147
+ @return 1 / sin($number);
148
+ }
149
+
150
+ @function scs($number, $unit: 'deg') {
151
+ @if $unit == 'deg' {
152
+ $number: deg-to-rad($number);
153
+ }
154
+ @return 1 / cos($number);
155
+ }
156
+
157
+ @function cot($number, $unit: 'deg') {
158
+ @if $unit == 'deg' {
159
+ $number: deg-to-rad($number);
160
+ }
161
+ @return 1 / tan($number);
162
+ }
163
+
164
+ //////////////////////////////
165
+ // Hyperbolic Functions
166
+ //////////////////////////////
167
+ @function sinh($number) {
168
+ $top: exponent($e, (2 * $number)) - 1;
169
+ $bottom: 2 * exponent($e, $number);
170
+ @return $top / $bottom;
171
+ }
172
+
173
+ @function cosh($number) {
174
+ $top: exponent($e, (2 * $number)) + 1;
175
+ $bottom: 2 * exponent($e, $number);
176
+ @return $top / $bottom;
177
+ }
178
+
179
+ @function tanh($number) {
180
+ $top: exponent($e, (2 * $number)) - 1;
181
+ $bottom: exponent($e, (2 * $number)) + 1;
182
+ @return $top / $bottom;
183
+ }
184
+
185
+ //////////////////////////////
186
+ // Reciprocal Hyperbolic Functions
187
+ //////////////////////////////
188
+ @function csch($number) {
189
+ @return 1 / sinh($number);
190
+ }
191
+
192
+ @function sech($number) {
193
+ @return 1 / cosh($number);
194
+ }
195
+
196
+ @function coth($number) {
197
+ @return 1/ tanh($number);
198
+ }
199
+
200
+
201
+ @function log($number) {
202
+ @return $number;
203
+ }
204
+
205
+ @function ln($number) {
206
+ @if $number > 0 and $number < 1 {
207
+ $value: 0;
208
+ @for $i from 1 through $iter {
209
+ $value: $value + ( pow(-1, $i) * pow(-1 * (1 - $number), $i)) / $i;
210
+ }
211
+ $value: -1 * $value;
212
+
213
+ @return $value;
214
+ }
215
+ @else if $number == 1 {
216
+ @return 0;
217
+ }
218
+ @else {
219
+ @return ERROR;
220
+ @warn ln input must be greater than zero and less than or equal to 1;
221
+ }
222
+ }
223
+
224
+
225
+ //////////////////////////////
226
+ // Degree/Radian Conversion
227
+ //////////////////////////////
228
+ @function deg-to-rad($number) {
229
+ @return $number * $pi / 180deg;
230
+ }
231
+
232
+ @function rad-to-deg($number) {
233
+ @return $number * 180deg / $pi;
234
+ }
235
+
236
+ //////////////////////////////
237
+ // Root Functions
238
+ //////////////////////////////
239
+ // Basic General-Purpose Root Function
240
+ @function n-root($number, $n) {
241
+ @if $number < 1 {
242
+ @return ERROR;
243
+ @warn ROOT ERROR;
244
+ }
245
+ // If a whole number, generate it quickly
246
+ @for $i from 1 through $number {
247
+ @if exponent($i, $n) == $number {
248
+ @return $i;
249
+ }
250
+ }
251
+ // Else, run through other options
252
+ @for $i from 1 through $number * 1000 / 2 {
253
+ @if round(exponent($i / 1000, $n) * 100) == round($number * 100) {
254
+ @return $i / 1000;
255
+ }
256
+ }
257
+ }
258
+
259
+ @function root($number, $n) {
260
+ @return n-root($number, $n);
261
+ }
262
+
263
+ // Square Roots
264
+ @function √($number) {
265
+ @return sqrt($number);
266
+ }
267
+
268
+ @function sqrt($number) {
269
+ $guess: rand();
270
+ $root: $guess;
271
+ @for $i from 1 through $iter {
272
+ $root: $root - (pow($root, 2) - $number) / (2 * $root);
273
+ }
274
+ @return $root;
275
+ }
@@ -0,0 +1,36 @@
1
+ // Android uses Density Independent Pixels (dip or dp) as the units defined in the W3C spec for pixels and pixels (px) as hardware defined units.
2
+ // This project aims to bring these two units to CSS using Sass functions and mixins.
3
+
4
+ // Base size should be the em height on the html element
5
+ $base-size: 16px !default
6
+
7
+ // Convert dips to em, rem, or px
8
+ $dip-conversion: em !default
9
+
10
+ // Context offset
11
+ $em-offset: 1 !default
12
+
13
+ // Convert dips to em or rem (px will not work because the W3C spec considers px to be density independent pixels)
14
+ $px-conversion: em !default
15
+
16
+ @function dip($number, $em-offset, $dip-conversion)
17
+ $unitless-em-offset: $em-offset / 1em
18
+ @if unitless($em-offset)
19
+ $unitless-em-offset: $em-offset
20
+ @if $dip-conversion == px
21
+ @return $number * 1px
22
+ @if $dip-conversion == em
23
+ @return ($number / ($base-size / 1px)) * (1 / $unitless-em-offset) * 1em
24
+ @if $dip-conversion == rem
25
+ @return $number / ($base-size / 1px) * 1rem
26
+
27
+ @function dp($number, $em-offset, $dip-conversion)
28
+ @return dip($number, $em-offset, $dip-conversion)
29
+
30
+ // Simple px => em conversion
31
+ @function em($number, $em-offset)
32
+ @return dip($number, $em-offset, em)
33
+
34
+ // Simple px => rem conversion
35
+ @function em($number, $em-offset)
36
+ @return dip($number, $em-offset, rem)
@@ -13,7 +13,6 @@ $reset: true !default
13
13
  padding: 0
14
14
  border: 0
15
15
  outline: 0
16
- font-size: 100%
17
16
  vertical-align: baseline
18
17
  background: transparent
19
18
  cursor: default
@@ -31,7 +30,6 @@ $reset: true !default
31
30
  a
32
31
  margin: 0
33
32
  padding: 0
34
- font-size: 100%
35
33
  vertical-align: baseline
36
34
  background: transparent
37
35
  color: inherit
@@ -96,13 +94,6 @@ $reset: true !default
96
94
  .ie6 input
97
95
  vertical-align: text-bottom
98
96
 
99
- select, input, textarea
100
- font: 99% sans-serif
101
-
102
- table
103
- font-size: inherit
104
- font: 100%
105
-
106
97
 
107
98
  // Accessible focus treatment
108
99
  // people.opera.com/patrickl/experiments/keyboard/test
@@ -110,9 +101,6 @@ $reset: true !default
110
101
  a:hover, a:active
111
102
  outline: none
112
103
 
113
- small
114
- font-size: 85%
115
-
116
104
  strong, th
117
105
  font-weight: bold
118
106
 
@@ -124,7 +112,6 @@ $reset: true !default
124
112
  // gist.github.com/413930
125
113
 
126
114
  sub, sup
127
- font-size: 75%
128
115
  line-height: 0
129
116
  position: relative
130
117
  sup
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 9
8
8
  - 3
9
- - beta11
10
- version: 0.9.3.beta11
9
+ - beta12
10
+ version: 0.9.3.beta12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Scott Kellum
@@ -50,7 +50,9 @@ files:
50
50
  - stylesheets/seasons/tools/_css3.sass
51
51
  - stylesheets/seasons/tools/_flexbox.sass
52
52
  - stylesheets/seasons/tools/_grid-tools.sass
53
+ - stylesheets/seasons/tools/_math.scss
53
54
  - stylesheets/seasons/tools/_modular-scale.sass
55
+ - stylesheets/seasons/tools/_relative-pixels.sass
54
56
  - stylesheets/seasons/tools/_reset.sass
55
57
  - stylesheets/seasons/plugin/_ad.sass
56
58
  - stylesheets/seasons/plugin/_ipad.sass