spans 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,23 +1,49 @@
|
|
1
1
|
# = require spans/hashgrid
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
3
|
+
class spans.Helper
|
4
|
+
constructor: (options) -> @grid = new spans.hashgrid(options)
|
5
|
+
|
6
|
+
class spans.Flexgrid
|
7
|
+
constructor: (@sampleFontSize, @sampleAtomWidth, @sampleAtomHeight, @modulesXCount, @modulesYCount) ->
|
8
|
+
@ratio = (@modulesYCount * @sampleAtomHeight) / (@modulesXCount * @sampleAtomWidth)
|
9
|
+
@heightToFontSize = (@modulesYCount * @sampleAtomHeight) / @sampleFontSize
|
10
|
+
$(window).resize @newFontSize
|
11
|
+
@newFontSize()
|
12
|
+
|
13
|
+
newFontSize: =>
|
14
|
+
min = Math.min($(window).innerHeight(), $(window).innerWidth() * @ratio)
|
15
|
+
fontSize = min / @heightToFontSize
|
16
|
+
$('body').css(fontSize: "#{fontSize}px")
|
17
|
+
|
18
|
+
|
19
|
+
# new spans.ToWidthFitter(16 / 1024)
|
20
|
+
class spans.ToWidthFitter
|
21
|
+
constructor: (@sampleFontToSampleWidth) ->
|
22
|
+
$(window).resize @newFontSize
|
23
|
+
@newFontSize()
|
24
|
+
|
25
|
+
newFontSize: =>
|
26
|
+
|
27
|
+
console.log($(window).innerHeight() * @sampleFontToSampleWidth)
|
28
|
+
$('html').css(fontSize: "#{$(window).innerWidth() * @sampleFontToSampleWidth}px")
|
29
|
+
|
30
|
+
# new spans.ToHeightFitter(16 / 768)
|
31
|
+
class spans.ToHeightFitter
|
32
|
+
constructor: (@sampleFontToSampleHeight) ->
|
33
|
+
$(window).resize @newFontSize
|
34
|
+
@newFontSize()
|
35
|
+
|
36
|
+
newFontSize: =>
|
37
|
+
$('html').css(fontSize: "#{$(window).innerHeight() * @sampleFontToSampleHeight}px")
|
38
|
+
|
39
|
+
|
40
|
+
# new spans.ToWindowFitter(16 / 768, 1024 / 768)
|
41
|
+
class spans.ToWindowFitter
|
42
|
+
constructor: (@sampleFontToSampleHeight, @sampleWidthToSampleHeight) ->
|
17
43
|
$(window).resize @newFontSize
|
18
44
|
@newFontSize()
|
19
45
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
46
|
+
newFontSize: =>
|
47
|
+
min = Math.min($(window).innerHeight(), $(window).innerWidth() / @sampleWidthToSampleHeight)
|
48
|
+
fontSize = min * @sampleFontToSampleHeight
|
49
|
+
$('html').css(fontSize: "#{fontSize}px")
|
@@ -13,13 +13,13 @@
|
|
13
13
|
.vert{
|
14
14
|
@extend .span1;
|
15
15
|
box-sizing: border-box;
|
16
|
-
background: rgba(
|
16
|
+
background: rgba(255, 0, 0, 0.1);
|
17
17
|
}
|
18
18
|
|
19
19
|
.horiz{
|
20
20
|
height: y(1);
|
21
21
|
box-sizing: border-box;
|
22
|
-
background: rgba(
|
22
|
+
background: rgba(255, 0, 0, 0.1);
|
23
23
|
margin-bottom: y(1);
|
24
24
|
}
|
25
25
|
}
|
data/lib/spans/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spans
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: inline-blocks
|
@@ -58,7 +58,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
58
58
|
version: '0'
|
59
59
|
segments:
|
60
60
|
- 0
|
61
|
-
hash: -
|
61
|
+
hash: -3412805545090323807
|
62
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
67
|
version: '0'
|
68
68
|
segments:
|
69
69
|
- 0
|
70
|
-
hash: -
|
70
|
+
hash: -3412805545090323807
|
71
71
|
requirements: []
|
72
72
|
rubyforge_project:
|
73
73
|
rubygems_version: 1.8.23
|