fishnet 1.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.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ *.log
4
+ .bundle
5
+ .config
6
+ .yardoc
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ # For Heroku deployment - doesn't pick up the development dependencies from the gemspec
6
+ gem 'thin'
7
+ gem 'haml-rails'
8
+ gem 'jquery-rails'
@@ -0,0 +1,115 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ Fishnet (0.0.1)
5
+ rails (>= 3.1.0)
6
+ sass-rails
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionmailer (3.2.3)
12
+ actionpack (= 3.2.3)
13
+ mail (~> 2.4.4)
14
+ actionpack (3.2.3)
15
+ activemodel (= 3.2.3)
16
+ activesupport (= 3.2.3)
17
+ builder (~> 3.0.0)
18
+ erubis (~> 2.7.0)
19
+ journey (~> 1.0.1)
20
+ rack (~> 1.4.0)
21
+ rack-cache (~> 1.2)
22
+ rack-test (~> 0.6.1)
23
+ sprockets (~> 2.1.2)
24
+ activemodel (3.2.3)
25
+ activesupport (= 3.2.3)
26
+ builder (~> 3.0.0)
27
+ activerecord (3.2.3)
28
+ activemodel (= 3.2.3)
29
+ activesupport (= 3.2.3)
30
+ arel (~> 3.0.2)
31
+ tzinfo (~> 0.3.29)
32
+ activeresource (3.2.3)
33
+ activemodel (= 3.2.3)
34
+ activesupport (= 3.2.3)
35
+ activesupport (3.2.3)
36
+ i18n (~> 0.6)
37
+ multi_json (~> 1.0)
38
+ arel (3.0.2)
39
+ builder (3.0.0)
40
+ daemons (1.1.8)
41
+ erubis (2.7.0)
42
+ eventmachine (0.12.10)
43
+ haml (3.1.4)
44
+ haml-rails (0.3.4)
45
+ actionpack (~> 3.0)
46
+ activesupport (~> 3.0)
47
+ haml (~> 3.0)
48
+ railties (~> 3.0)
49
+ hike (1.2.1)
50
+ i18n (0.6.0)
51
+ journey (1.0.3)
52
+ jquery-rails (2.0.2)
53
+ railties (>= 3.2.0, < 5.0)
54
+ thor (~> 0.14)
55
+ json (1.6.6)
56
+ mail (2.4.4)
57
+ i18n (>= 0.4.0)
58
+ mime-types (~> 1.16)
59
+ treetop (~> 1.4.8)
60
+ mime-types (1.18)
61
+ multi_json (1.3.2)
62
+ polyglot (0.3.3)
63
+ rack (1.4.1)
64
+ rack-cache (1.2)
65
+ rack (>= 0.4)
66
+ rack-ssl (1.3.2)
67
+ rack
68
+ rack-test (0.6.1)
69
+ rack (>= 1.0)
70
+ rails (3.2.3)
71
+ actionmailer (= 3.2.3)
72
+ actionpack (= 3.2.3)
73
+ activerecord (= 3.2.3)
74
+ activeresource (= 3.2.3)
75
+ activesupport (= 3.2.3)
76
+ bundler (~> 1.0)
77
+ railties (= 3.2.3)
78
+ railties (3.2.3)
79
+ actionpack (= 3.2.3)
80
+ activesupport (= 3.2.3)
81
+ rack-ssl (~> 1.3.2)
82
+ rake (>= 0.8.7)
83
+ rdoc (~> 3.4)
84
+ thor (~> 0.14.6)
85
+ rake (0.9.2.2)
86
+ rdoc (3.12)
87
+ json (~> 1.4)
88
+ sass (3.1.15)
89
+ sass-rails (3.2.5)
90
+ railties (~> 3.2.0)
91
+ sass (>= 3.1.10)
92
+ tilt (~> 1.3)
93
+ sprockets (2.1.2)
94
+ hike (~> 1.2)
95
+ rack (~> 1.0)
96
+ tilt (~> 1.1, != 1.3.0)
97
+ thin (1.3.1)
98
+ daemons (>= 1.0.9)
99
+ eventmachine (>= 0.12.6)
100
+ rack (>= 1.0.0)
101
+ thor (0.14.6)
102
+ tilt (1.3.3)
103
+ treetop (1.4.10)
104
+ polyglot
105
+ polyglot (>= 0.3.1)
106
+ tzinfo (0.3.33)
107
+
108
+ PLATFORMS
109
+ ruby
110
+
111
+ DEPENDENCIES
112
+ Fishnet!
113
+ haml-rails
114
+ jquery-rails
115
+ thin
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Matthew Kitt
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,2 @@
1
+ web: bundle exec thin start -p $PORT
2
+
@@ -0,0 +1,2 @@
1
+ wip: nothing to see here
2
+
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,30 @@
1
+
2
+ /* VENDOR ASSETS */
3
+ //= require jquery
4
+
5
+ (function() {
6
+ var dimensions = $('#page_dimensions')
7
+
8
+ // enable nice looking pre tags
9
+ window.prettyPrint && prettyPrint()
10
+
11
+ // Set the inner contents of the page width right away
12
+ dimensions.html(window.innerWidth + 'px')
13
+
14
+ // Report the size of the viewport to the page info element
15
+ window.onresize = function(e) {
16
+ dimensions.html(window.innerWidth + 'px')
17
+ }
18
+
19
+ $('#structure_toggler').on('click', function(e) {
20
+ e.preventDefault()
21
+ $('#the_structures').toggleClass('in')
22
+ })
23
+
24
+ $('#example_toggler').on('click', function(e) {
25
+ e.preventDefault()
26
+ $('#the_example').toggleClass('in')
27
+ })
28
+
29
+ }())
30
+
@@ -0,0 +1,3 @@
1
+ @import fishnet/settings
2
+ @import fishnet/functions
3
+ @import fishnet/mixins
@@ -0,0 +1,42 @@
1
+
2
+ // Calculations based on the [semantic grid system](http://semantic.gs/)
3
+
4
+ // Utility function for measuring the width of the `standard` grid
5
+ @function gridsystem_width($columns:$columns)
6
+ @return ($column-width * $columns) + ($gutter-width * $columns)
7
+
8
+ // Utility function for measuring the width of the grid when using `push/pull` columns
9
+ @function gridsystem_half_width($columns:$columns)
10
+ @return ($column-width * $columns) + (($gutter-width * .5) * $columns)
11
+
12
+ // Utility function for measuring the width of the grid when using `full` columns
13
+ @function gridsystem_full_width($columns:$columns)
14
+ @return ($column-width * $columns)
15
+
16
+
17
+ // Returns the width of the column within a `standard` grid
18
+ @function column_width($x, $columns:$columns)
19
+ @return $total-width * (((($gutter-width + $column-width) * $x) - $gutter-width) / gridsystem_width($columns))
20
+
21
+ // Returns the width of the column within a `pull` grid
22
+ @function column_pull_width($x, $columns:$columns)
23
+ $_half: $gutter-width * .5
24
+ @return $total-width * (((($_half + $column-width) * $x) - $_half) / gridsystem_half_width($columns))
25
+
26
+ // Returns the width of the column within a `push` grid
27
+ @function column_push_width($x, $columns:$columns)
28
+ @return column_pull_width($x, $columns)
29
+
30
+ // Returns the width of the column within a `full` grid
31
+ @function column_full_width($x, $columns:$columns)
32
+ @return $total-width * (((($column-width) * $x)) / gridsystem_full_width($columns))
33
+
34
+ // Returns the width of the `offset` used in the grid
35
+ @function offset_width($offset:0)
36
+ $_half: $gutter-width * .5
37
+ @return $total-width * ((($gutter-width + $column-width) * $offset) / gridsystem_width($columns)) + $total-width * ($_half / gridsystem_width($columns))
38
+
39
+ // Returns the width of spacing between columns
40
+ @function gutter_space($columns:$columns)
41
+ @return $total-width * (($gutter-width * .5) / gridsystem_width($columns))
42
+
@@ -0,0 +1,72 @@
1
+
2
+ // Convenience mixins for generating various non-semantic `column` classes. Generally used in quick prototypes.
3
+
4
+ // _Use these sparingly, as they can quickly create a lot of classes in your compiled CSS_
5
+ // _For instance if only using typical `column` classes (`standard`, `push`, `pull`, `full`) with 12 columns, would equate to 48 classes_
6
+
7
+
8
+ // ### Typical Columns
9
+
10
+ @mixin add-column-classes($name: "col", $columns:$columns)
11
+ @for $i from 1 through $columns
12
+ .#{$name}-#{$i}
13
+ +column($i, $columns)
14
+
15
+ @mixin add-column-pull-classes($name: "col-pull", $columns:$columns, $resize:true)
16
+ @for $i from 1 through $columns
17
+ .#{$name}-#{$i}
18
+ +column-pull($i, $columns, $resize)
19
+
20
+ @mixin add-column-push-classes($name: "col-push", $columns:$columns, $resize:true)
21
+ @for $i from 1 through $columns
22
+ .#{$name}-#{$i}
23
+ +column-push($i, $columns, $resize)
24
+
25
+ @mixin add-column-full-classes($name: "col-full", $columns:$columns)
26
+ @for $i from 1 through $columns
27
+ .#{$name}-#{$i}
28
+ +column-full($i, $columns)
29
+
30
+
31
+ // ### Offset Columns
32
+
33
+ @mixin add-column-offset-left-classes($name: "col-offset-left", $columns:$columns)
34
+ @for $i from 1 through $columns
35
+ .#{$name}-#{$i}
36
+ +column-offset-left($i, $columns - $i, $columns)
37
+
38
+ @mixin add-column-offset-left-pull-classes($name: "col-offset-left-pull", $columns:$columns, $resize:true)
39
+ @for $i from 1 through $columns
40
+ .#{$name}-#{$i}
41
+ +column-offset-left-pull($i, $columns - $i, $columns, $resize)
42
+
43
+ @mixin add-column-offset-left-push-classes($name: "col-offset-left-push", $columns:$columns, $resize:true)
44
+ @for $i from 1 through $columns
45
+ .#{$name}-#{$i}
46
+ +column-offset-left-push($i, $columns - $i, $columns, $resize)
47
+
48
+ @mixin add-column-offset-left-full-classes($name: "col-offset-left-full", $columns:$columns)
49
+ @for $i from 1 through $columns
50
+ .#{$name}-#{$i}
51
+ +column-offset-left-full($i, $columns - $i, $columns)
52
+
53
+ @mixin add-column-offset-right-classes($name: "col-offset-right", $columns:$columns)
54
+ @for $i from 1 through $columns
55
+ .#{$name}-#{$i}
56
+ +column-offset-right($i, $columns - $i, $columns)
57
+
58
+ @mixin add-column-offset-right-pull-classes($name: "col-offset-right-pull", $columns:$columns, $resize:true)
59
+ @for $i from 1 through $columns
60
+ .#{$name}-#{$i}
61
+ +column-offset-right-pull($i, $columns - $i, $columns, $resize)
62
+
63
+ @mixin add-column-offset-right-push-classes($name: "col-offset-right-push", $columns:$columns, $resize:true)
64
+ @for $i from 1 through $columns
65
+ .#{$name}-#{$i}
66
+ +column-offset-right-push($i, $columns - $i, $columns, $resize)
67
+
68
+ @mixin add-column-offset-right-full-classes($name: "col-offset-right-full", $columns:$columns)
69
+ @for $i from 1 through $columns
70
+ .#{$name}-#{$i}
71
+ +column-offset-right-full($i, $columns - $i, $columns)
72
+
@@ -0,0 +1,105 @@
1
+
2
+ // Calculations based on the [semantic grid system](http://semantic.gs/)
3
+
4
+ // ### Typical Columns
5
+
6
+ @mixin base-column
7
+ -moz-box-sizing: border-box
8
+ -webkit-box-sizing: border-box
9
+ box-sizing: border-box
10
+ display: block
11
+ float: left
12
+
13
+ @mixin column($x, $columns:$columns)
14
+ +base-column
15
+ margin-left: gutter_space($columns)
16
+ margin-right: gutter_space($columns)
17
+ width: column_width($x, $columns)
18
+
19
+ @mixin column-pull($x, $columns:$columns, $resize:true)
20
+ +base-column
21
+ margin-left: 0
22
+ margin-right: gutter_space($columns)
23
+ @if $resize == true
24
+ width: column_pull_width($x, $columns)
25
+ @else
26
+ width: column_width($x, $columns)
27
+
28
+ @mixin column-push($x, $columns:$columns, $resize:true)
29
+ +base-column
30
+ margin-left: gutter_space($columns)
31
+ margin-right: 0
32
+ @if $resize == true
33
+ width: column_push_width($x, $columns)
34
+ @else
35
+ width: column_width($x, $columns)
36
+
37
+ @mixin column-full($x, $columns:$columns)
38
+ +base-column
39
+ margin-left: 0
40
+ margin-right: 0
41
+ width: column_full_width($x, $columns)
42
+
43
+
44
+ // ### Offset Columns
45
+
46
+ @mixin column-offset-left($x, $offset:0, $columns:$columns)
47
+ +base-column
48
+ margin-left: offset_width($offset)
49
+ margin-right: gutter_space($columns)
50
+ width: column_width($x, $columns)
51
+
52
+ @mixin column-offset-left-pull($x, $offset:0, $columns:$columns, $resize:true)
53
+ +base-column
54
+ margin-left: offset_width($offset) - gutter_space($columns)
55
+ margin-right: gutter_space($columns)
56
+ @if $resize == true
57
+ width: column_pull_width($x, $columns)
58
+ @else
59
+ width: column_width($x, $columns)
60
+
61
+ @mixin column-offset-left-push($x, $offset:0, $columns:$columns, $resize:true)
62
+ +base-column
63
+ margin-left: offset_width($offset)
64
+ margin-right: 0
65
+ @if $resize == true
66
+ width: column_push_width($x, $columns)
67
+ @else
68
+ width: column_width($x, $columns)
69
+
70
+ @mixin column-offset-left-full($x, $offset:0, $columns:$columns)
71
+ +base-column
72
+ margin-left: offset_width($offset) - gutter_space($columns)
73
+ margin-right: 0
74
+ width: column_full_width($x, $columns)
75
+
76
+ @mixin column-offset-right($x, $offset:0, $columns:$columns)
77
+ +base-column
78
+ margin-left: gutter_space($columns)
79
+ margin-right: offset_width($offset)
80
+ width: column_width($x, $columns)
81
+
82
+ @mixin column-offset-right-pull($x, $offset:0, $columns:$columns, $resize:true)
83
+ +base-column
84
+ margin-left: 0
85
+ margin-right: offset_width($offset) - gutter_space($columns)
86
+ @if $resize == true
87
+ width: column_pull_width($x, $columns)
88
+ @else
89
+ width: column_width($x, $columns)
90
+
91
+ @mixin column-offset-right-push($x, $offset:0, $columns:$columns, $resize:true)
92
+ +base-column
93
+ margin-left: gutter_space($columns)
94
+ margin-right: offset_width($offset) - gutter_space($columns)
95
+ @if $resize == true
96
+ width: column_push_width($x, $columns)
97
+ @else
98
+ width: column_width($x, $columns)
99
+
100
+ @mixin column-offset-right-full($x, $offset:0, $columns:$columns)
101
+ +base-column
102
+ margin-left: 0
103
+ margin-right: offset_width($offset) - gutter_space($columns)
104
+ width: column_full_width($x, $columns)
105
+
@@ -0,0 +1,18 @@
1
+
2
+ // Defaults which can be freely overriden
3
+ $column-width: 60px !default
4
+ $gutter-width: 20px !default
5
+ $columns: 12 !default
6
+ $total-width: 100% !default
7
+
8
+ // Wrapper around defining the defaults (useful for recalculating a grid for media queries)
9
+ // If using a fixed grid, pass `fixed` or some other random value for `$page-width`
10
+ @mixin grid-settings($page-width:100%, $cols:$columns, $col-width:$column-width, $gut-width:$gutter-width)
11
+ $columns: $cols
12
+ $column-width: $col-width
13
+ $gutter-width: $gut-width
14
+ @if $page-width == 100%
15
+ $total-width: 100%
16
+ @else
17
+ $total-width: gridsystem_width($columns)
18
+