jetpack-rails 0.1.0
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.
- data/LICENSE +13 -0
- data/README.md +3 -0
- data/lib/jetpack-rails.rb +9 -0
- data/vendor/assets/javascripts/jetpack/alerts.js +8 -0
- data/vendor/assets/javascripts/jetpack/modal.js +51 -0
- data/vendor/assets/javascripts/jetpack/tabs.js +44 -0
- data/vendor/assets/javascripts/jetpack/tipsy.js +268 -0
- data/vendor/assets/javascripts/jetpack.js +4 -0
- data/vendor/assets/stylesheets/jetpack/forms.css.scss +67 -0
- data/vendor/assets/stylesheets/jetpack/fractionalize.css.scss +101 -0
- data/vendor/assets/stylesheets/jetpack/interface.css.scss +67 -0
- data/vendor/assets/stylesheets/jetpack/mixins.css.scss +60 -0
- data/vendor/assets/stylesheets/jetpack/navigation.css.scss +53 -0
- data/vendor/assets/stylesheets/jetpack/presets.css.scss +33 -0
- data/vendor/assets/stylesheets/jetpack/resetize.css.scss +535 -0
- data/vendor/assets/stylesheets/jetpack/tables.css.scss +32 -0
- data/vendor/assets/stylesheets/jetpack/typography.css.scss +94 -0
- data/vendor/assets/stylesheets/jetpack.css.scss +8 -0
- metadata +74 -0
data/LICENSE
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright (c) 2011 Andrew Burleson
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
|
4
|
+
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
|
5
|
+
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
|
6
|
+
Software is furnished to do so, subject to the following conditions:
|
7
|
+
|
8
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
9
|
+
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
11
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
12
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
13
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
$(function() {
|
2
|
+
$('div.alert_message[data-persist=false]').delay(2000).slideUp();
|
3
|
+
$('div.alert_message[data-persist=true]').append('<a href="#" class="close">x</a>');
|
4
|
+
$('div.alert_message[data-persist=true] a.close').click( function( event ) {
|
5
|
+
$(this).parent().slideUp();
|
6
|
+
event.preventDefault();
|
7
|
+
});
|
8
|
+
});
|
@@ -0,0 +1,51 @@
|
|
1
|
+
/*
|
2
|
+
* Jetpack Modal
|
3
|
+
* Super-Simple Modal Dialogs
|
4
|
+
*
|
5
|
+
* Inspired by jQuery Reveal Plugin 1.0
|
6
|
+
*/
|
7
|
+
|
8
|
+
(function ($) {
|
9
|
+
$('a[data-modal]').live('click', function (event) {
|
10
|
+
event.preventDefault();
|
11
|
+
var modalLocation = $(this).attr('data-modal');
|
12
|
+
$('#' + modalLocation).modal();
|
13
|
+
});
|
14
|
+
|
15
|
+
$.fn.modal = function() {
|
16
|
+
var modal = $(this);
|
17
|
+
var modalBg = $('.modal_bg');
|
18
|
+
|
19
|
+
if ( modalBg.length == 0 ) {
|
20
|
+
modalBg = $('<div class="modal_bg"></div>').insertAfter(modal);
|
21
|
+
}
|
22
|
+
|
23
|
+
if( modal.not(':visible') ) {
|
24
|
+
openModal();
|
25
|
+
} else {
|
26
|
+
closeModal();
|
27
|
+
}
|
28
|
+
|
29
|
+
function openModal() {
|
30
|
+
modalBg.fadeIn();
|
31
|
+
modal.fadeIn();
|
32
|
+
}
|
33
|
+
|
34
|
+
function closeModal() {
|
35
|
+
modal.fadeOut();
|
36
|
+
modalBg.fadeOut();
|
37
|
+
}
|
38
|
+
|
39
|
+
$('body').keyup( function (event) {
|
40
|
+
if (event.which === 27) {
|
41
|
+
closeModal();
|
42
|
+
}
|
43
|
+
});
|
44
|
+
|
45
|
+
$('a.close_modal').click( function(event) {
|
46
|
+
event.preventDefault();
|
47
|
+
closeModal();
|
48
|
+
});
|
49
|
+
|
50
|
+
};
|
51
|
+
})(jQuery);
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/*
|
2
|
+
* Skeleton Tabs Remix
|
3
|
+
* Converting to a jQuery function that can be called
|
4
|
+
* .tabs() or .pills()
|
5
|
+
* on any selector.
|
6
|
+
*
|
7
|
+
* Based on:
|
8
|
+
* Skeleton V1.1
|
9
|
+
* Copyright 2011, Dave Gamache
|
10
|
+
* www.getskeleton.com
|
11
|
+
* Free to use under the MIT license.
|
12
|
+
* http://www.opensource.org/licenses/mit-license.php
|
13
|
+
* 8/17/2011
|
14
|
+
*/
|
15
|
+
|
16
|
+
(function($) {
|
17
|
+
$.fn.tabs = $.fn.pills = function() {
|
18
|
+
var selector = $(this);
|
19
|
+
|
20
|
+
selector.each( function(i) {
|
21
|
+
//Get all tabs
|
22
|
+
var tab = $(this).find('> li > a');
|
23
|
+
tab.click(function(e) {
|
24
|
+
|
25
|
+
//Get Location of tab's content
|
26
|
+
var contentLocation = $(this).attr('href');
|
27
|
+
|
28
|
+
//Let go if not a hashed one
|
29
|
+
if(contentLocation.charAt(0)=="#") {
|
30
|
+
|
31
|
+
e.preventDefault();
|
32
|
+
|
33
|
+
//Make Tab Active
|
34
|
+
tab.removeClass('active');
|
35
|
+
$(this).addClass('active');
|
36
|
+
|
37
|
+
//Show Tab Content & add active class
|
38
|
+
$(contentLocation).show().addClass('active').siblings().hide().removeClass('active');
|
39
|
+
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
43
|
+
}
|
44
|
+
})(jQuery);
|
@@ -0,0 +1,268 @@
|
|
1
|
+
// TIPSY +
|
2
|
+
// Changes to default Tipsy:
|
3
|
+
// * Default Gravity is now S (meaning tips appear above element)
|
4
|
+
// * Fade is on by default
|
5
|
+
// * Added 'popover' functoin as convenient way of creating popovers
|
6
|
+
|
7
|
+
|
8
|
+
// tipsy, facebook style tooltips for jquery
|
9
|
+
// version 1.0.0a
|
10
|
+
// (c) 2008-2010 jason frame [jason@onehackoranother.com]
|
11
|
+
// released under the MIT license
|
12
|
+
|
13
|
+
(function($) {
|
14
|
+
|
15
|
+
function maybeCall(thing, ctx) {
|
16
|
+
return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
|
17
|
+
};
|
18
|
+
|
19
|
+
function Tipsy(element, options) {
|
20
|
+
this.$element = $(element);
|
21
|
+
this.options = options;
|
22
|
+
this.enabled = true;
|
23
|
+
this.fixTitle();
|
24
|
+
};
|
25
|
+
|
26
|
+
Tipsy.prototype = {
|
27
|
+
show: function() {
|
28
|
+
var title = this.getTitle();
|
29
|
+
if (title && this.enabled) {
|
30
|
+
var $tip = this.tip();
|
31
|
+
|
32
|
+
$tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
|
33
|
+
$tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
|
34
|
+
$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
|
35
|
+
|
36
|
+
var pos = $.extend({}, this.$element.offset(), {
|
37
|
+
width: this.$element[0].offsetWidth,
|
38
|
+
height: this.$element[0].offsetHeight
|
39
|
+
});
|
40
|
+
|
41
|
+
var actualWidth = $tip[0].offsetWidth,
|
42
|
+
actualHeight = $tip[0].offsetHeight,
|
43
|
+
gravity = maybeCall(this.options.gravity, this.$element[0]);
|
44
|
+
|
45
|
+
var tp;
|
46
|
+
switch (gravity.charAt(0)) {
|
47
|
+
case 'n':
|
48
|
+
tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
|
49
|
+
break;
|
50
|
+
case 's':
|
51
|
+
tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
|
52
|
+
break;
|
53
|
+
case 'e':
|
54
|
+
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
|
55
|
+
break;
|
56
|
+
case 'w':
|
57
|
+
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
|
58
|
+
break;
|
59
|
+
}
|
60
|
+
|
61
|
+
if (gravity.length == 2) {
|
62
|
+
if (gravity.charAt(1) == 'w') {
|
63
|
+
tp.left = pos.left + pos.width / 2 - 15;
|
64
|
+
} else {
|
65
|
+
tp.left = pos.left + pos.width / 2 - actualWidth + 15;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
$tip.css(tp).addClass('tipsy-' + gravity);
|
70
|
+
$tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
|
71
|
+
if (this.options.className) {
|
72
|
+
$tip.addClass(maybeCall(this.options.className, this.$element[0]));
|
73
|
+
}
|
74
|
+
|
75
|
+
if (this.options.fade) {
|
76
|
+
$tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
|
77
|
+
} else {
|
78
|
+
$tip.css({visibility: 'visible', opacity: this.options.opacity});
|
79
|
+
}
|
80
|
+
}
|
81
|
+
},
|
82
|
+
|
83
|
+
hide: function() {
|
84
|
+
if (this.options.fade) {
|
85
|
+
this.tip().stop().fadeOut(function() { $(this).remove(); });
|
86
|
+
} else {
|
87
|
+
this.tip().remove();
|
88
|
+
}
|
89
|
+
},
|
90
|
+
|
91
|
+
fixTitle: function() {
|
92
|
+
var $e = this.$element;
|
93
|
+
if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
|
94
|
+
$e.attr('original-title', $e.attr('title') || '').removeAttr('title');
|
95
|
+
}
|
96
|
+
},
|
97
|
+
|
98
|
+
getTitle: function() {
|
99
|
+
var title, $e = this.$element, o = this.options;
|
100
|
+
this.fixTitle();
|
101
|
+
var title, o = this.options;
|
102
|
+
if (typeof o.title == 'string') {
|
103
|
+
title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
|
104
|
+
} else if (typeof o.title == 'function') {
|
105
|
+
title = o.title.call($e[0]);
|
106
|
+
}
|
107
|
+
title = ('' + title).replace(/(^\s*|\s*$)/, "");
|
108
|
+
return title || o.fallback;
|
109
|
+
},
|
110
|
+
|
111
|
+
tip: function() {
|
112
|
+
if (!this.$tip) {
|
113
|
+
this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
|
114
|
+
}
|
115
|
+
return this.$tip;
|
116
|
+
},
|
117
|
+
|
118
|
+
validate: function() {
|
119
|
+
if (!this.$element[0].parentNode) {
|
120
|
+
this.hide();
|
121
|
+
this.$element = null;
|
122
|
+
this.options = null;
|
123
|
+
}
|
124
|
+
},
|
125
|
+
|
126
|
+
enable: function() { this.enabled = true; },
|
127
|
+
disable: function() { this.enabled = false; },
|
128
|
+
toggleEnabled: function() { this.enabled = !this.enabled; }
|
129
|
+
};
|
130
|
+
|
131
|
+
$.fn.tipsy = function(options) {
|
132
|
+
|
133
|
+
if (options === true) {
|
134
|
+
return this.data('tipsy');
|
135
|
+
} else if (typeof options == 'string') {
|
136
|
+
var tipsy = this.data('tipsy');
|
137
|
+
if (tipsy) tipsy[options]();
|
138
|
+
return this;
|
139
|
+
}
|
140
|
+
|
141
|
+
options = $.extend({}, $.fn.tipsy.defaults, options);
|
142
|
+
|
143
|
+
function get(ele) {
|
144
|
+
var tipsy = $.data(ele, 'tipsy');
|
145
|
+
if (!tipsy) {
|
146
|
+
tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
|
147
|
+
$.data(ele, 'tipsy', tipsy);
|
148
|
+
}
|
149
|
+
return tipsy;
|
150
|
+
}
|
151
|
+
|
152
|
+
function enter() {
|
153
|
+
var tipsy = get(this);
|
154
|
+
tipsy.hoverState = 'in';
|
155
|
+
if (options.delayIn == 0) {
|
156
|
+
tipsy.show();
|
157
|
+
} else {
|
158
|
+
tipsy.fixTitle();
|
159
|
+
setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
|
160
|
+
}
|
161
|
+
};
|
162
|
+
|
163
|
+
function leave() {
|
164
|
+
var tipsy = get(this);
|
165
|
+
tipsy.hoverState = 'out';
|
166
|
+
if (options.delayOut == 0) {
|
167
|
+
tipsy.hide();
|
168
|
+
} else {
|
169
|
+
setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
|
170
|
+
}
|
171
|
+
};
|
172
|
+
|
173
|
+
if (!options.live) this.each(function() { get(this); });
|
174
|
+
|
175
|
+
if (options.trigger != 'manual') {
|
176
|
+
var binder = options.live ? 'live' : 'bind',
|
177
|
+
eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
|
178
|
+
eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
|
179
|
+
this[binder](eventIn, enter)[binder](eventOut, leave);
|
180
|
+
}
|
181
|
+
|
182
|
+
return this;
|
183
|
+
|
184
|
+
};
|
185
|
+
|
186
|
+
$.fn.tipsy.defaults = {
|
187
|
+
className: null,
|
188
|
+
delayIn: 0,
|
189
|
+
delayOut: 0,
|
190
|
+
fade: false,
|
191
|
+
fallback: '',
|
192
|
+
gravity: 's',
|
193
|
+
html: false,
|
194
|
+
live: false,
|
195
|
+
offset: 0,
|
196
|
+
opacity: 0.8,
|
197
|
+
title: 'title',
|
198
|
+
trigger: 'hover'
|
199
|
+
};
|
200
|
+
|
201
|
+
// Overwrite this method to provide options on a per-element basis.
|
202
|
+
// For example, you could store the gravity in a 'tipsy-gravity' attribute:
|
203
|
+
// return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
|
204
|
+
// (remember - do not modify 'options' in place!)
|
205
|
+
$.fn.tipsy.elementOptions = function(ele, options) {
|
206
|
+
return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
|
207
|
+
};
|
208
|
+
|
209
|
+
$.fn.tipsy.autoNS = function() {
|
210
|
+
return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
|
211
|
+
};
|
212
|
+
|
213
|
+
$.fn.tipsy.autoWE = function() {
|
214
|
+
return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
|
215
|
+
};
|
216
|
+
|
217
|
+
/**
|
218
|
+
* yields a closure of the supplied parameters, producing a function that takes
|
219
|
+
* no arguments and is suitable for use as an autogravity function like so:
|
220
|
+
*
|
221
|
+
* @param margin (int) - distance from the viewable region edge that an
|
222
|
+
* element should be before setting its tooltip's gravity to be away
|
223
|
+
* from that edge.
|
224
|
+
* @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
|
225
|
+
* if there are no viewable region edges effecting the tooltip's
|
226
|
+
* gravity. It will try to vary from this minimally, for example,
|
227
|
+
* if 'sw' is preferred and an element is near the right viewable
|
228
|
+
* region edge, but not the top edge, it will set the gravity for
|
229
|
+
* that element's tooltip to be 'se', preserving the southern
|
230
|
+
* component.
|
231
|
+
*/
|
232
|
+
$.fn.tipsy.autoBounds = function(margin, prefer) {
|
233
|
+
return function() {
|
234
|
+
var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
|
235
|
+
boundTop = $(document).scrollTop() + margin,
|
236
|
+
boundLeft = $(document).scrollLeft() + margin,
|
237
|
+
$this = $(this);
|
238
|
+
|
239
|
+
if ($this.offset().top < boundTop) dir.ns = 'n';
|
240
|
+
if ($this.offset().left < boundLeft) dir.ew = 'w';
|
241
|
+
if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
|
242
|
+
if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
|
243
|
+
|
244
|
+
return dir.ns + (dir.ew ? dir.ew : '');
|
245
|
+
}
|
246
|
+
};
|
247
|
+
})(jQuery);
|
248
|
+
|
249
|
+
// Added convenience function for generating popovers with Tipsy.
|
250
|
+
// To use, create a wrapper for the HTML content of the popover, and place its selector in the "rel" attribute of the element which is popped over.
|
251
|
+
//
|
252
|
+
// Example Markup
|
253
|
+
//
|
254
|
+
// <a class="popped" href="#" rel="#my-popover">pop over this</a>
|
255
|
+
// <div id="my-popover"><h1>Hello</h1><p>I'm going to be popped over.</p></div>
|
256
|
+
//
|
257
|
+
// Example Function Call
|
258
|
+
//
|
259
|
+
// $(function(){
|
260
|
+
// $('a.popped').popover();
|
261
|
+
// });
|
262
|
+
(function($){
|
263
|
+
$.fn.popover = function() {
|
264
|
+
var selector = $(this).attr('rel');
|
265
|
+
var content = $(selector).html();
|
266
|
+
$(this).tipsy({ fade: true, html: true, title: function() { return content; } });
|
267
|
+
};
|
268
|
+
})(jQuery);
|
@@ -0,0 +1,67 @@
|
|
1
|
+
/* Forms +
|
2
|
+
* Influenced by Twitter Bootstrap, Normalize, and Formalize Projects
|
3
|
+
* ---------------------------------------------------------------------------------------- */
|
4
|
+
|
5
|
+
// Universal
|
6
|
+
form { margin-bottom: $baseline; @include font; @include clearfix;
|
7
|
+
|
8
|
+
fieldset {
|
9
|
+
margin: 0 0 $baseline; padding: 0; border: 0; position: relative; clear: both;
|
10
|
+
legend { display: block; margin-bottom: $baseline; font-size: $base_size * 1.3; }
|
11
|
+
}
|
12
|
+
|
13
|
+
div.input { @include clearfix; margin-bottom: $baseline;
|
14
|
+
label { display: block; text-align: right; height: 2em; font-weight: 700; }
|
15
|
+
|
16
|
+
input[type="text"], input[type="email"], select, textarea {
|
17
|
+
@include border-radius(3px); border: 1px solid $light2; box-shadow: inset 0px 1px 2px rgba(0,0,0,0.1); color: $dark1;
|
18
|
+
}
|
19
|
+
|
20
|
+
.radio, .checkboxes {
|
21
|
+
label { display: inline !important; margin: 0 $baseline 0 0; height: auto; font-weight: 300; }
|
22
|
+
input { width: auto; margin-right: $baseline / 4; }
|
23
|
+
}
|
24
|
+
|
25
|
+
span.hint { display: block; margin-top: $baseline / 4; clear: both; color: $light2; font-size: $base_size - 1px; }
|
26
|
+
}
|
27
|
+
|
28
|
+
input[type="submit"] { margin-bottom: $baseline / 2; }
|
29
|
+
}
|
30
|
+
|
31
|
+
// Standard Form Elements (labels beside inputs)
|
32
|
+
form.standard {
|
33
|
+
|
34
|
+
fieldset {
|
35
|
+
legend { padding: 0 0 0 20%; }
|
36
|
+
}
|
37
|
+
|
38
|
+
div.input {
|
39
|
+
label { float: left; width: 17.5%; margin-right: 2.5%; }
|
40
|
+
|
41
|
+
input[type="text"], input[type="email"], select, textarea { float: left; width: 80%; }
|
42
|
+
|
43
|
+
.radio, .checkboxes {
|
44
|
+
label { float: none; }
|
45
|
+
}
|
46
|
+
|
47
|
+
span.hint { float: left; margin-left: 20%; }
|
48
|
+
}
|
49
|
+
|
50
|
+
input[type="submit"] { margin-left: 20%; }
|
51
|
+
|
52
|
+
div.inset { margin-left: 20%; }
|
53
|
+
}
|
54
|
+
|
55
|
+
// Stacked Form Elements
|
56
|
+
form.stacked { margin-bottom: $baseline; @include font;
|
57
|
+
|
58
|
+
div.input {
|
59
|
+
label { clear: both; margin-bottom: $baseline / 4; text-align: left; }
|
60
|
+
input, select, textarea { width: 100%; }
|
61
|
+
|
62
|
+
.radio, .checkboxes {
|
63
|
+
input { width: auto; }
|
64
|
+
}
|
65
|
+
|
66
|
+
}
|
67
|
+
}
|
@@ -0,0 +1,101 @@
|
|
1
|
+
/* --------------------------------------------------
|
2
|
+
|
3
|
+
Fractionalize.CSS
|
4
|
+
A css framework that lets you setup many different
|
5
|
+
fractional grid layouts quickly and easily.
|
6
|
+
|
7
|
+
WHY?
|
8
|
+
Grab just about any other framework and try this:
|
9
|
+
Create a layout using four equal colums.
|
10
|
+
Create a second layout using five equal columns.
|
11
|
+
Oops -- any "traditional" grid framework has either
|
12
|
+
and odd or even number of total columns, meaning that while
|
13
|
+
you're using that framework you can either divide the page
|
14
|
+
equally into odd increments, or even increments, but not
|
15
|
+
both.
|
16
|
+
|
17
|
+
That's lame. Hence, this framework isn't about using a
|
18
|
+
fancy schmancy generator and agonizing over how many
|
19
|
+
columns you should ask it for, it's about being able
|
20
|
+
to quickly and easily divide the page into whatever
|
21
|
+
fractions you want at any time.
|
22
|
+
|
23
|
+
Inspired by Blueprint CSS, and based on Blueprint
|
24
|
+
terminology and use.
|
25
|
+
|
26
|
+
SASSY
|
27
|
+
Originally a pure CSS framework, this has now been
|
28
|
+
converted to leverage the power of SASS to make it
|
29
|
+
even better.
|
30
|
+
http://www.sass-lang.com
|
31
|
+
|
32
|
+
-------------------------------------------------- */
|
33
|
+
|
34
|
+
|
35
|
+
// LAYOUT DEFAULTS
|
36
|
+
// Make sure the body always fills the page.
|
37
|
+
* { margin: 0; }
|
38
|
+
html, body { height: 100%; }
|
39
|
+
|
40
|
+
// VARIABLES
|
41
|
+
// Setup the pixel dimensions
|
42
|
+
$full_width: 960px;
|
43
|
+
|
44
|
+
@function margin_width( $denom ) {
|
45
|
+
@if $denom == 1 { @return 0 }
|
46
|
+
@if $denom == 2 { @return 20px }
|
47
|
+
@if $denom == 3 { @return 21px }
|
48
|
+
@if $denom == 4 { @return 20px }
|
49
|
+
@if $denom == 5 { @return 20px }
|
50
|
+
@if $denom == 6 { @return 18px }
|
51
|
+
@if $denom == 8 { @return 16px }
|
52
|
+
@if $denom == 10 { @return 10px }
|
53
|
+
}
|
54
|
+
|
55
|
+
@function col_width( $denom ) {
|
56
|
+
$col_space: $full_width / $denom;
|
57
|
+
$gutters: $denom - 1;
|
58
|
+
$total_margin: $gutters * margin_width( $denom );
|
59
|
+
$total_width: $full_width - $total_margin;
|
60
|
+
@return $total_width / $denom
|
61
|
+
}
|
62
|
+
|
63
|
+
@function col_span( $num, $denom ) {
|
64
|
+
$col_width: $num * col_width( $denom );
|
65
|
+
$margin_width: ($num - 1) * margin_width( $denom );
|
66
|
+
@return $col_width + $margin_width
|
67
|
+
}
|
68
|
+
|
69
|
+
@mixin container( $width: $full_width ) {
|
70
|
+
width: $full_width;
|
71
|
+
margin: 0 auto;
|
72
|
+
clear: both;
|
73
|
+
@include clearfix;
|
74
|
+
}
|
75
|
+
|
76
|
+
@mixin grid( $num, $denom ) {
|
77
|
+
display: block;
|
78
|
+
float: left;
|
79
|
+
width: col_span( $num, $denom );
|
80
|
+
margin-left: margin_width( $denom );
|
81
|
+
&:first-child { margin-left: 0; }
|
82
|
+
}
|
83
|
+
|
84
|
+
@mixin prepend( $num, $denom ) {
|
85
|
+
padding-left: col_span( $num, $denom ) + margin_width( $denom );
|
86
|
+
}
|
87
|
+
|
88
|
+
@mixin append( $num, $denom ) {
|
89
|
+
padding-right: col_span( $num, $denom ) + margin_width( $denom );
|
90
|
+
}
|
91
|
+
|
92
|
+
@mixin col_border( $denom, $thickness: 1px, $style: solid, $color: #CCC ) {
|
93
|
+
$half: margin_width( $denom ) / 2;
|
94
|
+
$padding: $half - $thickness;
|
95
|
+
$margin: $half;
|
96
|
+
padding-left: $padding;
|
97
|
+
margin-left: $margin;
|
98
|
+
border-left: $thickness $style $color;
|
99
|
+
}
|
100
|
+
|
101
|
+
div.container { clear: both; margin: 0 auto; width: $full_width; }
|
@@ -0,0 +1,67 @@
|
|
1
|
+
/* Interface Elements
|
2
|
+
* Influenced by Twitter Bootstrap and Formalize
|
3
|
+
* ---------------------------------------------------------------------------------------- */
|
4
|
+
|
5
|
+
|
6
|
+
// LABELS
|
7
|
+
span.label {
|
8
|
+
display: inline-block; padding: 1px 5px; background: $light2; color: $white; @include border-radius(3px);
|
9
|
+
&.success { background: $success2; }
|
10
|
+
&.notice { background: $notice2; color: $dark2; }
|
11
|
+
&.error { background: $error2; }
|
12
|
+
}
|
13
|
+
|
14
|
+
// BUTTONS
|
15
|
+
a.button, span.button {
|
16
|
+
display: inline-block;
|
17
|
+
cursor: pointer;
|
18
|
+
@include box-shadow( 0px 1px 1px rgba(0,0,0,0.15) );
|
19
|
+
@include border-radius(4px);
|
20
|
+
@include buttonize( $white, $light1 );
|
21
|
+
font: bold 12px/1.3 $sans;
|
22
|
+
text-decoration: none;
|
23
|
+
color: $dark2;
|
24
|
+
padding: 3px 10px;
|
25
|
+
width: auto;
|
26
|
+
&:active { @include buttonize( $light1, $white ); @include box-shadow( none ); }
|
27
|
+
&.disabled { @include buttonize( $light1, $light1); color: $light2; @include box-shadow( none ); }
|
28
|
+
&.danger { @include buttonize( lighten($error2, 20%), $error2 ); color: $dark2; text-shadow: 0px 1px lighten($error2, 20%);
|
29
|
+
&:active { @include buttonize( $error2, lighten($error2, 20%) ); text-shadow: 0px 1px lighten($error2, 15%); @include box-shadow( none ); }
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
div.alert_message {
|
34
|
+
@include border-radius(4px); color: $white; padding: 7px 12px; margin-bottom: $baseline; @include box-shadow;
|
35
|
+
&.success { @include buttonize( lighten( $success2, 15% ), $success2); text-shadow: 0px -1px darken( $success2, 15% ); }
|
36
|
+
&.notice { @include buttonize( lighten( $notice2, 15% ), $notice2); color: $dark2; text-shadow: 0px 1px $notice1; }
|
37
|
+
&.error { @include buttonize( lighten( $error2, 15% ), $error2); text-shadow: 0px -1px darken( $error2, 15% ); }
|
38
|
+
a.close { @include font( 18px, $sans, 700, 13.5px ); float: right; text-decoration: none; opacity: 0.2; color: $black; text-shadow: 0px 1px $white;
|
39
|
+
&:hover { opacity: 0.4; }
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
// MODALS
|
44
|
+
div.modal_bg { display: none; position: fixed; background: #000; opacity: 0.8; z-index: 1000; top: 0; left: 0; bottom: 0; right: 0; }
|
45
|
+
div.modal { display: none; top: 40px; left: 50%; margin-left: -359px; width: 700px; background: $dark2; position: absolute; z-index: 1001; padding: $baseline; }
|
46
|
+
div.modal .close_modal { font-size: 22px; line-height: .5; position: absolute; top: 8px; right: 11px; color: #aaa; text-shadow: 0 -1px 1px rbga(0,0,0,.6); font-weight: bold; cursor: pointer; }
|
47
|
+
|
48
|
+
// TIPSY
|
49
|
+
.tipsy { font-size: 11px; position: absolute; padding: 5px; z-index: 100000; }
|
50
|
+
.tipsy-inner { background-color: $black; color: $white; max-width: 200px; padding: 5px 8px 4px 8px; text-align: center; @include border-radius(4px); }
|
51
|
+
.tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; }
|
52
|
+
/* Rules to colour arrows */
|
53
|
+
.tipsy-arrow-n { border-bottom-color: #000; }
|
54
|
+
.tipsy-arrow-s { border-top-color: #000; }
|
55
|
+
.tipsy-arrow-e { border-left-color: #000; }
|
56
|
+
.tipsy-arrow-w { border-right-color: #000; }
|
57
|
+
.tipsy-n .tipsy-arrow { top: 0px; left: 50%; margin-left: -5px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent; }
|
58
|
+
.tipsy-nw .tipsy-arrow { top: 0; left: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
|
59
|
+
.tipsy-ne .tipsy-arrow { top: 0; right: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
|
60
|
+
.tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -5px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
|
61
|
+
.tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
|
62
|
+
.tipsy-se .tipsy-arrow { bottom: 0; right: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
|
63
|
+
.tipsy-e .tipsy-arrow { right: 0; top: 50%; margin-top: -5px; border-left-style: solid; border-right: none; border-top-color: transparent; border-bottom-color: transparent; }
|
64
|
+
.tipsy-w .tipsy-arrow { left: 0; top: 50%; margin-top: -5px; border-right-style: solid; border-left: none; border-top-color: transparent; border-bottom-color: transparent; }
|
65
|
+
|
66
|
+
// POPOVERS
|
67
|
+
.popover { display: none; }
|