compass-ratchet 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/README.md +67 -0
  2. data/lib/compass-ratchet.rb +3 -0
  3. data/stylesheets/_compass-ratchet.scss +14 -0
  4. data/stylesheets/compass-ratchet/_bars.scss +330 -0
  5. data/stylesheets/compass-ratchet/_base.scss +155 -0
  6. data/stylesheets/compass-ratchet/_buttons.scss +124 -0
  7. data/stylesheets/compass-ratchet/_chevrons.scss +32 -0
  8. data/stylesheets/compass-ratchet/_counts.scss +42 -0
  9. data/stylesheets/compass-ratchet/_forms.scss +126 -0
  10. data/stylesheets/compass-ratchet/_lists.scss +122 -0
  11. data/stylesheets/compass-ratchet/_popovers.scss +158 -0
  12. data/stylesheets/compass-ratchet/_push.scss +30 -0
  13. data/stylesheets/compass-ratchet/_segmented-controllers.scss +67 -0
  14. data/stylesheets/compass-ratchet/_shared.scss +8 -0
  15. data/stylesheets/compass-ratchet/_sliders.scss +40 -0
  16. data/stylesheets/compass-ratchet/_toggles.scss +71 -0
  17. data/templates/project/checkout.html +81 -0
  18. data/templates/project/choose-movie.html +125 -0
  19. data/templates/project/choose-theater.html +110 -0
  20. data/templates/project/config.rb +8 -0
  21. data/templates/project/css/app.css +1 -0
  22. data/templates/project/img/argo.png +0 -0
  23. data/templates/project/img/ralph.png +0 -0
  24. data/templates/project/img/skyfall.png +0 -0
  25. data/templates/project/index.html +160 -0
  26. data/templates/project/js/popovers.js +63 -0
  27. data/templates/project/js/push.js +417 -0
  28. data/templates/project/js/segmented-controllers.js +47 -0
  29. data/templates/project/js/sliders.js +114 -0
  30. data/templates/project/js/toggles.js +94 -0
  31. data/templates/project/manifest.rb +24 -0
  32. data/templates/project/sass/app.scss +13 -0
  33. data/templates/project/settings.html +73 -0
  34. data/templates/project/theaters.html +131 -0
  35. metadata +111 -0
@@ -0,0 +1,67 @@
1
+ Compass Ratchet
2
+ ===============
3
+
4
+ Prototype iPhone apps with simple Sass components. This extension is meant for Compass users who use project templates and prefer to use Sass instead of CSS for their Ratchet projects.
5
+
6
+ ## Contribe
7
+ Please fork this repository, then submit a pull request with your changes in a new topic branch.
8
+
9
+ ## Installation
10
+
11
+ ### Bundler
12
+ If you want to bundle into your app, install bundler.
13
+
14
+ $ gem install bundler
15
+
16
+ With Bundler installed, add this to your Gemfile.
17
+
18
+ group :assets do
19
+ gem 'compass-ratchet'
20
+ end
21
+
22
+ Run this in the command line:
23
+
24
+ $ bundle install
25
+ $ git add Gemfile Gemfile.lock
26
+
27
+ ### Manual
28
+ If bundler isn't your thing, install this gem.
29
+
30
+ $ gem install compass-ratchet
31
+
32
+ Then verify it's installed.
33
+
34
+ $ compass help compass-ratchet
35
+
36
+ Next in your Compass project add this to your config.rb
37
+
38
+ require 'compass-ratchet'
39
+
40
+ ## Usage
41
+
42
+ In your project import either the whole library or parts
43
+
44
+ ``` scss
45
+ @import "ratchet";
46
+ ```
47
+
48
+ or
49
+
50
+ ``` scss
51
+ @import "ratchet/bars";
52
+ @import "ratchet/base";
53
+ @import "ratchet/buttons";
54
+ @import "ratchet/chevrons";
55
+ @import "ratchet/counts";
56
+ @import "ratchet/forms";
57
+ @import "ratchet/lists";
58
+ @import "ratchet/popovers";
59
+ @import "ratchet/push";
60
+ @import "ratchet/segmented-controllers";
61
+ @import "ratchet/sliders";
62
+ @import "ratchet/toggles";
63
+ ```
64
+
65
+ ## Credits
66
+
67
+ This Compass-ratchet was created by **[Stephen Way](https://github.com/stephenway)**
@@ -0,0 +1,3 @@
1
+ require 'compass'
2
+ extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
3
+ Compass::Frameworks.register('compass-ratchet', :path => extension_path)
@@ -0,0 +1,14 @@
1
+ @import "compass-ratchet/shared";
2
+
3
+ @import "compass-ratchet/bars";
4
+ @import "compass-ratchet/base";
5
+ @import "compass-ratchet/buttons";
6
+ @import "compass-ratchet/chevrons";
7
+ @import "compass-ratchet/counts";
8
+ @import "compass-ratchet/forms";
9
+ @import "compass-ratchet/lists";
10
+ @import "compass-ratchet/popovers";
11
+ @import "compass-ratchet/push";
12
+ @import "compass-ratchet/segmented-controllers";
13
+ @import "compass-ratchet/sliders";
14
+ @import "compass-ratchet/toggles";
@@ -0,0 +1,330 @@
1
+ @import "compass-ratchet/shared";
2
+
3
+ @import "compass/css3/border-radius";
4
+ @import "compass/css3/box-shadow";
5
+ @import "compass/css3/box";
6
+ @import "compass/css3/box-sizing";
7
+ @import "compass/css3/images";
8
+ @import "compass/css3/text-shadow";
9
+ @import "compass/css3/transform";
10
+
11
+ /* General bar styles
12
+ -------------------------------------------------- */
13
+
14
+ [class*="bar-"] {
15
+ position: fixed;
16
+ right: 0;
17
+ left: 0;
18
+ z-index: 10;
19
+ height: 44px;
20
+ padding: 5px;
21
+ @include box-sizing(border-box);
22
+ }
23
+
24
+ /* Modifier class to dock any bar below .bar-title */
25
+ .bar-header-secondary {
26
+ top: 45px;
27
+ }
28
+
29
+ /* Modifier class to dock any bar to bottom of viewport */
30
+ .bar-footer {
31
+ bottom: 0;
32
+ }
33
+
34
+ /* Generic bar for wrapping buttons, segmented controllers, etc. */
35
+ .bar-standard {
36
+ background-color: #f2f2f2;
37
+ @include background(linear-gradient(top, #f2f2f2, #e5e5e5));
38
+ border-bottom: 1px solid #aaa;
39
+ @include box-shadow(inset 0 1px 1px -1px #fff);
40
+ }
41
+
42
+ /* Flip border position to top for footer bars */
43
+ .bar-footer.bar-standard,
44
+ .bar-footer-secondary.bar-standard {
45
+ border-top: 1px solid #aaa;
46
+ border-bottom-width: 0;
47
+ }
48
+
49
+ /* Title bar
50
+ -------------------------------------------------- */
51
+
52
+ /* Bar docked to top of viewport for showing page title and actions */
53
+ .bar-title {
54
+ top: 0;
55
+ display: -webkit-box;
56
+ display: box;
57
+ background-color: #1eb0e9;
58
+ @include background(linear-gradient(top, #1eb0e9, #109adc));
59
+ border-bottom: 1px solid #0e5895;
60
+ @include box-shadow(inset 0 1px 1px -1px rgba(255, 255, 255, .8));
61
+ @include box-orient(horizontal);
62
+ }
63
+
64
+ /* Centered text in the .bar-title */
65
+ .bar-title .title {
66
+ position: absolute;
67
+ top: 0;
68
+ left: 0;
69
+ display: block;
70
+ width: 100%;
71
+ font-size: 20px;
72
+ font-weight: bold;
73
+ line-height: 44px;
74
+ color: #fff;
75
+ text-align: center;
76
+ @include text-shadow(0 -1px rgba(0, 0, 0, .5));
77
+ white-space: nowrap;
78
+ }
79
+
80
+ .bar-title > a:not([class*="button"]) {
81
+ display: block;
82
+ width: 100%;
83
+ height: 100%;
84
+ }
85
+
86
+ /* Retain specified title color */
87
+ .bar-title .title a {
88
+ color: inherit;
89
+ }
90
+
91
+ /* Tab bar
92
+ -------------------------------------------------- */
93
+
94
+ /* Bar docked to bottom used for primary app navigation */
95
+ .bar-tab {
96
+ bottom: 0;
97
+ height: 50px;
98
+ padding: 0;
99
+ background-color: #393939;
100
+ @include background(linear-gradient(top, #393939, #2b2b2b));
101
+ border-top: 1px solid #000;
102
+ border-bottom-width: 0;
103
+ @include box-shadow(inset 0 1px 1px -1px rgba(255, 255, 255, .6));
104
+ }
105
+
106
+ /* Wrapper for individual tab */
107
+ .tab-inner {
108
+ display: -webkit-box;
109
+ display: box;
110
+ height: 100%;
111
+ list-style: none;
112
+ @include box-orient(horizontal);
113
+ }
114
+
115
+ /* Navigational tab */
116
+ .tab-item {
117
+ height: 100%;
118
+ padding-top: 9px;
119
+ text-align: center;
120
+ @include box-sizing(border-box);
121
+ @include box-flex(1);
122
+ }
123
+
124
+ /* Active state for tab */
125
+ .tab-item.active {
126
+ @include box-shadow(inset 0 0 20px rgba(0, 0, 0, .5));
127
+ }
128
+
129
+ /* Icon for tab */
130
+ .tab-icon {
131
+ display: block;
132
+ height: 18px;
133
+ margin: 0 auto;
134
+ }
135
+
136
+ /* Label for tab */
137
+ .tab-label {
138
+ margin-top: 1px;
139
+ font-size: 10px;
140
+ font-weight: bold;
141
+ color: #fff;
142
+ @include text-shadow(0 1px rgba(0, 0, 0, .3));
143
+ }
144
+
145
+ /* Buttons in title bars
146
+ -------------------------------------------------- */
147
+
148
+ /* Generic style for all buttons in .bar-title */
149
+ .bar-title [class*="button"] {
150
+ position: relative;
151
+ z-index: 10; /* Places buttons over full width title */
152
+ font-size: 12px;
153
+ line-height: 23px;
154
+ color: #fff;
155
+ @include text-shadow(0 -1px 0 rgba(0, 0, 0, .3));
156
+ background-color: #1eb0e9;
157
+ @include background(linear-gradient(top, #1eb0e9, #0984c6));
158
+ border: 1px solid #0e5895;
159
+ @include box-shadow(0 1px rgba(255, 255, 255, .25));
160
+ @include box-flex(0);
161
+ }
162
+
163
+
164
+ /* Hacky way to right align buttons outside of flex-box system
165
+ Note: is only absolutely positioned button, would be better if flex-box had an "align right" option */
166
+ .bar-title .title + [class*="button"]:last-child,
167
+ .bar-title .button + [class*="button"]:last-child,
168
+ .bar-title [class*="button"].pull-right {
169
+ position: absolute;
170
+ top: 5px;
171
+ right: 5px;
172
+ }
173
+
174
+ /* Override standard button active states */
175
+ .bar-title .button:active {
176
+ color: #fff;
177
+ background-color: #0876b1;
178
+ }
179
+
180
+ /* Directional buttons in title bars (thanks to @GregorAdams for solution - http://cssnerd.com/2011/11/30/the-best-pure-css3-ios-style-arrow-back-button/)
181
+ -------------------------------------------------- */
182
+
183
+ /* Add relative positioning so :before content is positioned properly */
184
+ .bar-title .button-prev,
185
+ .bar-title .button-next {
186
+ position: relative;
187
+ }
188
+
189
+ /* Prev/next button base styles */
190
+ .bar-title .button-prev {
191
+ margin-left: 7px; /* Push over to make room for :before content */
192
+ border-left: 0;
193
+ border-bottom-left-radius: 10px 15px;
194
+ border-top-left-radius: 10px 15px;
195
+ }
196
+ .bar-title .button-next {
197
+ margin-right: 7px; /* Push over to make room for :before content */
198
+ border-right: 0;
199
+ border-top-right-radius: 10px 15px;
200
+ border-bottom-right-radius: 10px 15px;
201
+ }
202
+
203
+ /* Pointed part of directional button */
204
+ .bar-title .button-prev:before,
205
+ .bar-title .button-next:before {
206
+ position: absolute;
207
+ top: 2px;
208
+ width: 27px;
209
+ height: 27px;
210
+ @include border-radius(30px 100px 2px 40px, 2px 40px 30px 100px);
211
+ content: '';
212
+ @include box-shadow(inset 1px 0 #0e5895, inset 0 1px #0e5895);
213
+ -webkit-mask-image: -webkit-gradient(linear, left top, right bottom, from(#000), color-stop(.33, #000), color-stop(.5, transparent), to(transparent));
214
+ mask-image: gradient(linear, left top, right bottom, from(#000), color-stop(.33, #000), color-stop(.5, transparent), to(transparent));
215
+ }
216
+ .bar-title .button-prev:before {
217
+ left: -5px;
218
+ @include background(linear-gradient(left bottom, #0984c6, #1eb0e9));
219
+ border-left: 1.5px solid rgba(255, 255, 255, .25);
220
+ @include rotate(-45deg);
221
+ @include skew(-10deg, -10deg);
222
+ }
223
+ .bar-title .button-next:before {
224
+ right: -5px;
225
+ @include background(linear-gradient(left bottom, #1eb0e9, #0984c6));
226
+ border-top: 1.5px solid rgba(255, 255, 255, .25);
227
+ @include rotate(135deg);
228
+ @include skew(-10deg, -10deg);
229
+ }
230
+
231
+ /* Active states for the directional buttons */
232
+ .bar-title .button-prev:active,
233
+ .bar-title .button-next:active,
234
+ .bar-title .button-prev:active:before,
235
+ .bar-title .button-next:active:before {
236
+ color: #fff;
237
+ background-color: #0876b1;
238
+ background-image: none;
239
+ }
240
+ .bar-title .button-prev:active:before,
241
+ .bar-title .button-next:active:before {
242
+ content: '';
243
+ }
244
+ .bar-title .button-prev:active:before {
245
+ @include box-shadow(inset 0 3px 3px rgba(0, 0, 0, .2));
246
+ }
247
+ .bar-title .button-next:active:before {
248
+ @include box-shadow(inset 0 -3px 3px rgba(0, 0, 0, .2));
249
+ }
250
+
251
+ /* Block buttons in any bar
252
+ -------------------------------------------------- */
253
+
254
+ /* Add proper padding and replace buttons normal dropshadow with a shine from bar */
255
+ [class*="bar"] .button-block {
256
+ padding: 7px 0;
257
+ margin-bottom: 0;
258
+ @include box-shadow(inset 0 1px 1px rgba(255, 255, 255, .4), 0 1px rgba(255, 255, 255, .8));
259
+ }
260
+
261
+ /* Override standard padding changes for .button-blocks */
262
+ [class*="bar"] .button-block:active {
263
+ padding: 7px 0;
264
+ }
265
+
266
+ /* Segmented controller in any bar
267
+ -------------------------------------------------- */
268
+
269
+ /* Remove standard segmented bottom margin */
270
+ [class*="bar-"] .segmented-controller {
271
+ margin-bottom: 0;
272
+ }
273
+
274
+ /* Add margins between segmented controllers and buttons */
275
+ [class*="bar-"] .segmented-controller + [class*="button"],
276
+ [class*="bar-"] [class*="button"] + .segmented-controller {
277
+ margin-left: 5px;
278
+ }
279
+
280
+ /* Segmented controller in a title bar
281
+ -------------------------------------------------- */
282
+
283
+ .bar-title .segmented-controller {
284
+ line-height: 18px;
285
+ @include text-shadow(0 -1px 0 rgba(0, 0, 0, 0.3));
286
+ background-color: #1eb0e9;
287
+ @include background(linear-gradient(top, #1eb0e9, #0984c6));
288
+ border: 1px solid #0e5895;
289
+ @include border-radius(3px);
290
+ @include box-shadow(0 1px rgba(255, 255, 255, .25));
291
+ @include box-flex(1);
292
+ }
293
+
294
+ /* Set color for tab border and highlight */
295
+ .bar-title .segmented-controller li {
296
+ border-left: 1px solid #0e5895;
297
+ @include box-shadow(inset 1px 0 rgba(255, 255, 255, .25));
298
+ }
299
+
300
+ /* Remove inset shadow from first tab or one to the right of the active tab */
301
+ .bar-title .segmented-controller .active + li,
302
+ .bar-title .segmented-controller li:first-child {
303
+ @include box-shadow(none);
304
+ }
305
+
306
+ /* Remove left-hand border from first tab */
307
+ .bar-title .segmented-controller li:first-child {
308
+ border-left-width: 0;
309
+ }
310
+
311
+ /* Depressed state (active) */
312
+ .bar-title .segmented-controller li.active {
313
+ background-color: #0082c4;
314
+ @include box-shadow(inset 0 1px 6px rgba(0, 0, 0, .3));
315
+ }
316
+
317
+ /* Set color of links to white */
318
+ .bar-title .segmented-controller li > a {
319
+ color: #fff;
320
+ }
321
+
322
+
323
+ /* Search forms in standard bar
324
+ -------------------------------------------------- */
325
+
326
+ /* Position/size search bar within the bar */
327
+ .bar-standard input[type=search] {
328
+ height: 32px;
329
+ margin: 0;
330
+ }
@@ -0,0 +1,155 @@
1
+ @import "compass-ratchet/shared";
2
+
3
+ @import "compass/css3/transition";
4
+ @import "compass/css3/transform";
5
+
6
+ /* Hard reset
7
+ -------------------------------------------------- */
8
+
9
+ html,
10
+ body,
11
+ div,
12
+ span,
13
+ iframe,
14
+ h1,
15
+ h2,
16
+ h3,
17
+ h4,
18
+ h5,
19
+ h6,
20
+ p,
21
+ blockquote,
22
+ pre,
23
+ a,
24
+ abbr,
25
+ acronym,
26
+ address,
27
+ big,
28
+ cite,
29
+ code,
30
+ del,
31
+ dfn,
32
+ em,
33
+ img,
34
+ ins,
35
+ kbd,
36
+ q,
37
+ s,
38
+ samp,
39
+ small,
40
+ strike,
41
+ strong,
42
+ sub,
43
+ sup,
44
+ tt,
45
+ var,
46
+ b,
47
+ u,
48
+ i,
49
+ center,
50
+ dl,
51
+ dt,
52
+ dd,
53
+ ol,
54
+ ul,
55
+ li,
56
+ fieldset,
57
+ form,
58
+ label,
59
+ legend,
60
+ table,
61
+ caption,
62
+ tbody,
63
+ tfoot,
64
+ thead,
65
+ tr,
66
+ th,
67
+ td,
68
+ article,
69
+ aside,
70
+ canvas,
71
+ details,
72
+ embed,
73
+ figure,
74
+ figcaption,
75
+ footer,
76
+ header,
77
+ hgroup,
78
+ menu,
79
+ nav,
80
+ output,
81
+ section,
82
+ summary,
83
+ time,
84
+ audio,
85
+ video {
86
+ padding: 0;
87
+ margin: 0;
88
+ border: 0;
89
+ }
90
+
91
+ /* Prevents iOS text size adjust after orientation change, without disabling (Thanks to @necolas) */
92
+ html {
93
+ -webkit-text-size-adjust: 100%;
94
+ -ms-text-size-adjust: 100%;
95
+ }
96
+
97
+ /* Base styles
98
+ -------------------------------------------------- */
99
+
100
+ body {
101
+ position: fixed;
102
+ top: 0;
103
+ right: 0;
104
+ bottom: 0;
105
+ left: 0;
106
+ font: 14px/1.25 "Helvetica Neue", sans-serif;
107
+ color: #222;
108
+ background-color: #fff;
109
+ }
110
+
111
+ /* Universal link styling */
112
+ a {
113
+ color: #0882f0;
114
+ text-decoration: none;
115
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* Removes the dark touch outlines on links */
116
+ }
117
+
118
+ /* Wrapper to be used around all content not in .bar-title and .bar-tab */
119
+ .content {
120
+ position: fixed;
121
+ top: 0;
122
+ right: 0;
123
+ bottom: 0;
124
+ left: 0;
125
+ overflow: auto;
126
+ background: #fff;
127
+ @include transition-property(top);
128
+ @include transition-property(bottom);
129
+ @include transition-duration(.2s);
130
+ @include transition-timing-function(linear);
131
+ -webkit-overflow-scrolling: touch;
132
+ }
133
+
134
+ /* Hack to force all relatively and absolutely positioned elements still render while scrolling
135
+ Note: This is a bug for "-webkit-overflow-scrolling: touch" */
136
+ .content > * {
137
+ @include translateZ(0px);
138
+ }
139
+
140
+ /* Utility wrapper to pad in components like forms, block buttons and segmented-controllers so they're not full-bleed */
141
+ .content-padded {
142
+ padding: 10px;
143
+ }
144
+
145
+ /* Pad top/bottom of content so it doesn't hide behind .bar-title and .bar-tab.
146
+ Note: For these to work, content must come after both bars in the markup */
147
+ .bar-title ~ .content {
148
+ top: 44px;
149
+ }
150
+ .bar-tab ~ .content {
151
+ bottom: 51px;
152
+ }
153
+ .bar-header-secondary ~ .content {
154
+ top: 88px;
155
+ }