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
- namespace = (target, name, block) ->
4
- [target, name, block] = [(if typeof exports isnt 'undefined' then exports else window), arguments...] if arguments.length < 3
5
- top = target
6
- target = target[item] or= {} for item in name.split '.'
7
- block target, top
8
-
9
- namespace 'spans', (n) ->
10
- class n.Helper
11
- constructor: (options) -> @grid = new spans.hashgrid(options)
12
-
13
- class n.Flexgrid
14
- constructor: (@sampleFontSize, @sampleAtomWidth, @sampleAtomHeight, @modulesXCount, @modulesYCount) ->
15
- @ratio = (@modulesYCount * @sampleAtomHeight) / (@modulesXCount * @sampleAtomWidth)
16
- @heightToFontSize = (@modulesYCount * @sampleAtomHeight) / @sampleFontSize
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
- newFontSize: =>
21
- min = Math.min($(window).innerHeight(), $(window).innerWidth() * @ratio)
22
- fontSize = min / @heightToFontSize
23
- $('body').css(fontSize: "#{fontSize}px")
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(0, 0, 0, 0.05);
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(0, 0, 0, 0.05);
22
+ background: rgba(255, 0, 0, 0.1);
23
23
  margin-bottom: y(1);
24
24
  }
25
25
  }
data/lib/spans/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Spans
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.1
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-05 00:00:00.000000000 Z
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: -4603871019789038408
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: -4603871019789038408
70
+ hash: -3412805545090323807
71
71
  requirements: []
72
72
  rubyforge_project:
73
73
  rubygems_version: 1.8.23