jap_mag 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +31 -0
- data/Rakefile +2 -0
- data/app/assets/stylesheets/base.scss +205 -0
- data/app/assets/stylesheets/index.css +18 -0
- data/app/assets/stylesheets/mixins.scss +21 -0
- data/app/assets/stylesheets/reset.scss +48 -0
- data/app/assets/stylesheets/variables.scss +10 -0
- data/app/assets/stylesheets/widgets.scss +507 -0
- data/app/helpers/widgets_helper.rb +149 -0
- data/jap_mag.gemspec +17 -0
- data/lib/jap_mag/version.rb +3 -0
- data/lib/jap_mag.rb +6 -0
- metadata +61 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Felix Ding
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# JapMag
|
2
|
+
|
3
|
+
JapMag is the design language created by Felix Ding in the spring of 2012. The essential idea behind JapMag is Japanese Minimalism. It focuses on content itself, and aims to solve information overload. On interaction design, JapMag advocates a flat information architecutre, a one-task-one-step method and a natural content flow on each page. Visually, JapMag stresses typography, whitespace and uses graphical elements as little as possible. Technically, JapMag avoids using Javascript, or overriding browsers' default behaviors.
|
4
|
+
|
5
|
+
This gem helps designers start a project that follows JapMag. It consists of several CSS definations, Rails helpers and view templates.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'jap_mag'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install jap_mag
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Documentation is one the way. Stay tuned!
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,205 @@
|
|
1
|
+
@import 'variables';
|
2
|
+
@import "mixins";
|
3
|
+
|
4
|
+
body {
|
5
|
+
font: 12px / 130% "Lucida Grande", Arial, Helvetica, Verdana, sans-serif;
|
6
|
+
color: $color_body;
|
7
|
+
}
|
8
|
+
|
9
|
+
#body {
|
10
|
+
width: $base_width;
|
11
|
+
padding: 10px;
|
12
|
+
margin: 0 auto;
|
13
|
+
}
|
14
|
+
|
15
|
+
a {
|
16
|
+
color: $color_blue;
|
17
|
+
text-decoration: none;
|
18
|
+
|
19
|
+
|
20
|
+
&:hover {
|
21
|
+
color: #fff;
|
22
|
+
background-color: #000;
|
23
|
+
}
|
24
|
+
|
25
|
+
img {
|
26
|
+
border: none;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
em {
|
31
|
+
font-style: italic;
|
32
|
+
}
|
33
|
+
|
34
|
+
.hidden {
|
35
|
+
display: none;
|
36
|
+
}
|
37
|
+
|
38
|
+
h1, h2, h3, h4 {
|
39
|
+
font-weight: normal;
|
40
|
+
color: black;
|
41
|
+
line-height: 1em;
|
42
|
+
margin: 0 0 1em;
|
43
|
+
-webkit-font-smoothing: antialiased;
|
44
|
+
}
|
45
|
+
|
46
|
+
h1 {
|
47
|
+
margin: 0 0 15px 0;
|
48
|
+
font-size: (40px / 12px) * 100%;
|
49
|
+
|
50
|
+
a {
|
51
|
+
color: black;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
h2 {
|
56
|
+
font-size: 1.4em;
|
57
|
+
}
|
58
|
+
|
59
|
+
h3 {
|
60
|
+
font-size: 1.2em;
|
61
|
+
}
|
62
|
+
|
63
|
+
blockquote {
|
64
|
+
border-left: 2px solid #ccc;
|
65
|
+
margin: 0 0 0 3em;
|
66
|
+
padding: 0 0px 0 1em;
|
67
|
+
}
|
68
|
+
|
69
|
+
#header {
|
70
|
+
overflow: hidden;
|
71
|
+
padding: 0 0 10px;
|
72
|
+
margin: 0 0 20px;
|
73
|
+
|
74
|
+
.slogan {
|
75
|
+
font-size: (20px / 12px) * 100%;
|
76
|
+
}
|
77
|
+
|
78
|
+
.navigation {
|
79
|
+
overflow: hidden;
|
80
|
+
margin: 20px 0 0;
|
81
|
+
|
82
|
+
li {
|
83
|
+
float: left;
|
84
|
+
margin: 0 10px 0 0;
|
85
|
+
padding: 0 10px 0 0;
|
86
|
+
border-right: 1px solid #ccc;
|
87
|
+
|
88
|
+
&:last-child {
|
89
|
+
border: none;
|
90
|
+
}
|
91
|
+
|
92
|
+
.highlight {
|
93
|
+
color: red;
|
94
|
+
|
95
|
+
&:hover {
|
96
|
+
color: white;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
#wrapper {
|
104
|
+
margin: 0;
|
105
|
+
padding: 0;
|
106
|
+
overflow: hidden;
|
107
|
+
|
108
|
+
.primary {
|
109
|
+
width: (720px / $base_width) * 100%;
|
110
|
+
margin-right: 30px;
|
111
|
+
float: right;
|
112
|
+
overflow: hidden;
|
113
|
+
}
|
114
|
+
|
115
|
+
.secondary {
|
116
|
+
float: left;
|
117
|
+
width: (150px / $base_width) * 100%;
|
118
|
+
overflow: hidden;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
#footer {
|
123
|
+
margin: 50px 0 10px;
|
124
|
+
color: #666;
|
125
|
+
|
126
|
+
.languages {
|
127
|
+
overflow: hidden;
|
128
|
+
margin: 5px 0 0;
|
129
|
+
|
130
|
+
li {
|
131
|
+
float: left;
|
132
|
+
margin: 0 20px 0 0;
|
133
|
+
padding: 0 0 0 20px;
|
134
|
+
}
|
135
|
+
|
136
|
+
.zh-CN {
|
137
|
+
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFqSURBVHjaYrzOwPAPjJgYQEDAleHVbhADIvgHLPgHiQ0QQCxAlkR9NW8sw+cV/1gV/7Gb/hV4+vfzhj8Mv/78//Pn/+/f/8AkhH1t0yaAAAJp4I37zyz2lDfu79uqv/++/WYz+cuq/vvLxt8gdb+A5K9/v34B2SyyskBLAAII5JAva/7/+/z367a/f3/8ZuT9+//Pr78vQUrB6n4CSSj6/RuoASCAWEDO/fD3ddEfhv9/OE3/sKj8/n7k9/fDQNUIs/+DVf8HawAIIJCT/v38C3Hr95N/GDh/f94AVvT7N8RUBpjxQAVADQABBNLw/y/Ifwy/f/399ufTOpDBEPf8g5sN0QBEDAwAAQTWABEChgOSA9BVA00E2wAQQCANQBbEif/AzoCqgLkbbBYwWP/+//sXqBYggFhAkfL7D7OkJFCOCSj65zfUeFjwg8z++/ffX5AGoGKAAGI8jhSRyIw/SJH9D4aAYQoQYAA6rnMw1jU2vQAAAABJRU5ErkJggg==) no-repeat 0 2px;
|
138
|
+
}
|
139
|
+
|
140
|
+
.en {
|
141
|
+
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHzSURBVHjaYkxOP8IAB//+Mfz7w8Dwi4HhP5CcJb/n/7evb16/APL/gRFQDiAAw3JuAgAIBEDQ/iswEERjGzBQLEru97ll0g0+3HvqMn1SpqlqGsZMsZsIe0SICA5gt5a/AGIEarCPtFh+6N/ffwxA9OvP/7//QYwff/6fZahmePeB4dNHhi+fGb59Y4zyvHHmCEAAAW3YDzQYaJJ93a+vX79aVf58//69fvEPlpIfnz59+vDhw7t37968efP3b/SXL59OnjwIEEAsDP+YgY53b2b89++/awvLn98MDi2cVxl+/vl6mituCtBghi9f/v/48e/XL86krj9XzwEEEENy8g6gu22rfn78+NGs5Ofr16+ZC58+fvyYwX8rxOxXr169fPny+fPn1//93bJlBUAAsQADZMEBxj9/GBxb2P/9+S/R8u3vzxuyaX8ZHv3j8/YGms3w8ycQARmi2eE37t4ACCDGR4/uSkrKAS35B3TT////wADOgLOBIaXIyjBlwxKAAGKRXjCB0SOEaeu+/y9fMnz4AHQxCP348R/o+l+//sMZQBNLEvif3AcIIMZbty7Ly6t9ZmXl+fXj/38GoHH/UcGfP79//BBiYHjy9+8/oUkNAAHEwt1V/vI/KBY/QSISFqM/GBg+MzB8A6PfYC5EFiDAABqgW776MP0rAAAAAElFTkSuQmCC) no-repeat 0 2px;
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
.field_with_errors {
|
147
|
+
padding: 2px;
|
148
|
+
background-color: red;
|
149
|
+
display: table;
|
150
|
+
}
|
151
|
+
|
152
|
+
#error_explanation {
|
153
|
+
width: 450px;
|
154
|
+
border: 2px solid red;
|
155
|
+
padding: 7px;
|
156
|
+
padding-bottom: 0;
|
157
|
+
margin-bottom: 20px;
|
158
|
+
background-color: #f0f0f0;
|
159
|
+
|
160
|
+
h2 {
|
161
|
+
text-align: left;
|
162
|
+
font-weight: bold;
|
163
|
+
padding: 5px 5px 5px 15px;
|
164
|
+
font-size: 1em;
|
165
|
+
margin: -7px;
|
166
|
+
margin-bottom: 0px;
|
167
|
+
background-color: #c00;
|
168
|
+
color: #fff;
|
169
|
+
}
|
170
|
+
|
171
|
+
ul li {
|
172
|
+
list-style: square;
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
ol.list {
|
177
|
+
list-style: decimal;
|
178
|
+
margin: 1em 0;
|
179
|
+
padding: 0 0 0 4em;
|
180
|
+
|
181
|
+
li {
|
182
|
+
margin: 0 0 0.5em 0;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
/* iPhone 2G, 3G, 3GS Portrait */
|
187
|
+
@media only screen and (device-width: 320px) and (orientation: portrait) {
|
188
|
+
@include iphone(300px);
|
189
|
+
}
|
190
|
+
|
191
|
+
/* iPhone 2G, 3G, 3GS Landscape */
|
192
|
+
@media only screen and (max-device-width: 480px) and (orientation: landscape) {
|
193
|
+
/* CSS3 Rules for iPhone in Landscape Orientation */
|
194
|
+
@include iphone(460px);
|
195
|
+
}
|
196
|
+
|
197
|
+
/* iPhone 4, 4S Portrait */
|
198
|
+
@media only screen and (device-width: 480px) and (orientation: portrait) and (-webkit-min-device-pixel-ratio: 2) {
|
199
|
+
@include iphone(300px);
|
200
|
+
}
|
201
|
+
|
202
|
+
/* iPhone 4, 4S Landscape */
|
203
|
+
@media only screen and (device-width: 960px) and (orientation: landscape) {
|
204
|
+
@include iphone(460px);
|
205
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require_self
|
12
|
+
*= require reset
|
13
|
+
*= require_tree ./vendors
|
14
|
+
*= require variables
|
15
|
+
*= require widgets
|
16
|
+
*= require base
|
17
|
+
*= require_tree ./modules
|
18
|
+
*/
|
@@ -0,0 +1,21 @@
|
|
1
|
+
@mixin box-shadow($effect: 1px 0px 5px black) {
|
2
|
+
box-shadow: $effect;
|
3
|
+
-moz-box-shadow: $effect;
|
4
|
+
-webkit-box-shadow: $effect;
|
5
|
+
}
|
6
|
+
|
7
|
+
@mixin iphone($base_width) {
|
8
|
+
html {
|
9
|
+
-webkit-text-size-adjust: none;
|
10
|
+
}
|
11
|
+
|
12
|
+
#body {
|
13
|
+
width: $base_width;
|
14
|
+
}
|
15
|
+
|
16
|
+
form.basic {
|
17
|
+
input[type=text], input[type=email], input[type=password], textarea {
|
18
|
+
width: 95%;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
/* http://meyerweb.com/eric/tools/css/reset/
|
2
|
+
v2.0 | 20110126
|
3
|
+
License: none (public domain)
|
4
|
+
*/
|
5
|
+
|
6
|
+
html, body, div, span, applet, object, iframe,
|
7
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
8
|
+
a, abbr, acronym, address, big, cite, code,
|
9
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
10
|
+
small, strike, strong, sub, sup, tt, var,
|
11
|
+
b, u, i, center,
|
12
|
+
dl, dt, dd, ol, ul, li,
|
13
|
+
fieldset, form, label, legend,
|
14
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
15
|
+
article, aside, canvas, details, embed,
|
16
|
+
figure, figcaption, footer, header, hgroup,
|
17
|
+
menu, nav, output, ruby, section, summary,
|
18
|
+
time, mark, audio, video {
|
19
|
+
margin: 0;
|
20
|
+
padding: 0;
|
21
|
+
border: 0;
|
22
|
+
font-size: 100%;
|
23
|
+
font: inherit;
|
24
|
+
vertical-align: baseline;
|
25
|
+
}
|
26
|
+
/* HTML5 display-role reset for older browsers */
|
27
|
+
article, aside, details, figcaption, figure,
|
28
|
+
footer, header, hgroup, menu, nav, section {
|
29
|
+
display: block;
|
30
|
+
}
|
31
|
+
body {
|
32
|
+
line-height: 1;
|
33
|
+
}
|
34
|
+
ol, ul {
|
35
|
+
list-style: none;
|
36
|
+
}
|
37
|
+
blockquote, q {
|
38
|
+
quotes: none;
|
39
|
+
}
|
40
|
+
blockquote:before, blockquote:after,
|
41
|
+
q:before, q:after {
|
42
|
+
content: '';
|
43
|
+
content: none;
|
44
|
+
}
|
45
|
+
table {
|
46
|
+
border-collapse: collapse;
|
47
|
+
border-spacing: 0;
|
48
|
+
}
|
@@ -0,0 +1,507 @@
|
|
1
|
+
@import "mixins";
|
2
|
+
@import "variables";
|
3
|
+
|
4
|
+
.widget {
|
5
|
+
margin-bottom: 30px;
|
6
|
+
overflow: hidden;
|
7
|
+
|
8
|
+
li {
|
9
|
+
margin: 10px 0;
|
10
|
+
}
|
11
|
+
|
12
|
+
.more {
|
13
|
+
font-size: 14px;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
div.pagination {
|
18
|
+
margin: 10px 0;
|
19
|
+
|
20
|
+
em {
|
21
|
+
padding: 10px;
|
22
|
+
}
|
23
|
+
|
24
|
+
.current {
|
25
|
+
background: #aaa;
|
26
|
+
color: #fff;
|
27
|
+
}
|
28
|
+
|
29
|
+
a {
|
30
|
+
padding: 10px;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
#flash {
|
35
|
+
div {
|
36
|
+
margin: 10px auto;
|
37
|
+
color: white;
|
38
|
+
font-size: 14px;
|
39
|
+
padding: 10px;
|
40
|
+
}
|
41
|
+
|
42
|
+
.notice {
|
43
|
+
background: $color_green;
|
44
|
+
}
|
45
|
+
|
46
|
+
.warning {
|
47
|
+
background: $color_yellow;
|
48
|
+
}
|
49
|
+
|
50
|
+
.error {
|
51
|
+
background: #e75151;
|
52
|
+
}
|
53
|
+
|
54
|
+
&.fadeout {
|
55
|
+
left: 0;
|
56
|
+
margin: 0;
|
57
|
+
padding: 0;
|
58
|
+
position: absolute;
|
59
|
+
top: 0;
|
60
|
+
width: 100%;
|
61
|
+
z-index: 999;
|
62
|
+
display: none;
|
63
|
+
|
64
|
+
div {
|
65
|
+
margin: 0 auto;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
table.basic {
|
71
|
+
border: none;
|
72
|
+
border-collapse: collapse;
|
73
|
+
border-spacing: 0;
|
74
|
+
font-size: 12px;
|
75
|
+
margin: 0;
|
76
|
+
padding: 0;
|
77
|
+
text-align: left;
|
78
|
+
width: 100%;
|
79
|
+
|
80
|
+
td, & th {
|
81
|
+
margin: 0;
|
82
|
+
padding: 10px;
|
83
|
+
}
|
84
|
+
|
85
|
+
th {
|
86
|
+
background-color: #eee;
|
87
|
+
border-top: 2px solid #ccc;
|
88
|
+
border-bottom: 1px solid #ccc;
|
89
|
+
}
|
90
|
+
|
91
|
+
td {
|
92
|
+
border-top: 1px solid #ccc;
|
93
|
+
|
94
|
+
.actions a {
|
95
|
+
margin-right: 10px;
|
96
|
+
}
|
97
|
+
|
98
|
+
&.field {
|
99
|
+
background: #eee;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
tr:last-child {
|
104
|
+
border-bottom: 1px solid #ccc;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
/* call to action*/
|
109
|
+
.cta {
|
110
|
+
background: $color_blue;
|
111
|
+
color: #fff;
|
112
|
+
border: none;
|
113
|
+
font-weight: bold;
|
114
|
+
display: inline-block;
|
115
|
+
|
116
|
+
span {
|
117
|
+
padding: 5px 10px;
|
118
|
+
display: block;
|
119
|
+
}
|
120
|
+
|
121
|
+
&:hover {
|
122
|
+
background: $color_body;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
/* rating stars */
|
127
|
+
.rating {
|
128
|
+
background: url(/assets/star.gif) repeat-x 0 -32px;
|
129
|
+
height: 16px;
|
130
|
+
|
131
|
+
span {
|
132
|
+
display: none;
|
133
|
+
}
|
134
|
+
|
135
|
+
&.rating-1 {
|
136
|
+
width: 16px;
|
137
|
+
}
|
138
|
+
|
139
|
+
&.rating-2 {
|
140
|
+
width: 32px;
|
141
|
+
}
|
142
|
+
|
143
|
+
&.rating-3 {
|
144
|
+
width: 48px;
|
145
|
+
}
|
146
|
+
|
147
|
+
&.rating-4 {
|
148
|
+
width: 64px;
|
149
|
+
}
|
150
|
+
|
151
|
+
&.rating-5 {
|
152
|
+
width: 80px;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
|
157
|
+
/* @group ul.tabs */
|
158
|
+
div.tab {
|
159
|
+
clear: both;
|
160
|
+
margin-bottom: 10px;
|
161
|
+
overflow: hidden;
|
162
|
+
width: 100%;
|
163
|
+
border: none;
|
164
|
+
|
165
|
+
ul.tab {
|
166
|
+
border-bottom: 1px solid #CCC;
|
167
|
+
padding-left: 16px;
|
168
|
+
zoom: 1;
|
169
|
+
margin: 0px;
|
170
|
+
padding: 0.2em 0.2em 0px;
|
171
|
+
position: relative;
|
172
|
+
border: none;
|
173
|
+
border-bottom: 1px solid #CCC;
|
174
|
+
|
175
|
+
&:after {
|
176
|
+
display: block;
|
177
|
+
height: 0;
|
178
|
+
clear: both;
|
179
|
+
}
|
180
|
+
|
181
|
+
li {
|
182
|
+
border: solid 1px #CCC;
|
183
|
+
border-bottom: 0;
|
184
|
+
float: left;
|
185
|
+
list-style: none;
|
186
|
+
margin: 0px 5px 1px 0px;
|
187
|
+
padding: 0px;
|
188
|
+
position: relative;
|
189
|
+
top: 1px;
|
190
|
+
white-space: nowrap;
|
191
|
+
border-radius: 0;
|
192
|
+
|
193
|
+
&.current {
|
194
|
+
margin-bottom: 0px;
|
195
|
+
padding-bottom: 1px;
|
196
|
+
background: white;
|
197
|
+
|
198
|
+
a {
|
199
|
+
color: #000;
|
200
|
+
|
201
|
+
&:hover {
|
202
|
+
background: transparent;
|
203
|
+
}
|
204
|
+
}
|
205
|
+
}
|
206
|
+
|
207
|
+
a {
|
208
|
+
float: left;
|
209
|
+
padding: 3px 13px;
|
210
|
+
text-decoration: none;
|
211
|
+
cursor: pointer;
|
212
|
+
}
|
213
|
+
}
|
214
|
+
}
|
215
|
+
|
216
|
+
.ui-tabs-hide {
|
217
|
+
display: none;
|
218
|
+
}
|
219
|
+
}
|
220
|
+
/* @end */
|
221
|
+
|
222
|
+
.toolbar {
|
223
|
+
overflow: hidden;
|
224
|
+
|
225
|
+
.left {
|
226
|
+
float: left;
|
227
|
+
}
|
228
|
+
|
229
|
+
.right {
|
230
|
+
float: right;
|
231
|
+
}
|
232
|
+
}
|
233
|
+
|
234
|
+
/* @form.basic */
|
235
|
+
form.basic {
|
236
|
+
input[type=text], input[type=search], input[type=email], input[type=password], textarea {
|
237
|
+
width: 500px;
|
238
|
+
padding: 5px;
|
239
|
+
font-size: 1em;
|
240
|
+
color: #555;
|
241
|
+
}
|
242
|
+
|
243
|
+
textarea {
|
244
|
+
resize: vertical;
|
245
|
+
height: 150px;
|
246
|
+
}
|
247
|
+
|
248
|
+
.error, .errorExplanation {
|
249
|
+
margin-left: 4px;
|
250
|
+
color: red;
|
251
|
+
}
|
252
|
+
|
253
|
+
.field {
|
254
|
+
padding: 10px 0;
|
255
|
+
}
|
256
|
+
|
257
|
+
.description {
|
258
|
+
color: #949494;
|
259
|
+
}
|
260
|
+
|
261
|
+
p {
|
262
|
+
margin: 1.5em 0;
|
263
|
+
overflow: hidden;
|
264
|
+
}
|
265
|
+
|
266
|
+
.required_mark {
|
267
|
+
margin-left: 0em;
|
268
|
+
color: red;
|
269
|
+
}
|
270
|
+
|
271
|
+
.radios {
|
272
|
+
.radio {
|
273
|
+
padding: 5px;
|
274
|
+
margin: 0;
|
275
|
+
|
276
|
+
&:nth-child(odd) {
|
277
|
+
border-bottom: 0;
|
278
|
+
}
|
279
|
+
|
280
|
+
&.checked {
|
281
|
+
background: #eee;
|
282
|
+
&:hover {
|
283
|
+
background: #eee;
|
284
|
+
}
|
285
|
+
}
|
286
|
+
|
287
|
+
&:hover {
|
288
|
+
background: #eee;
|
289
|
+
cursor: pointer;
|
290
|
+
}
|
291
|
+
|
292
|
+
input[type=radio] {
|
293
|
+
margin: 0 1em 0 0;
|
294
|
+
}
|
295
|
+
}
|
296
|
+
}
|
297
|
+
}
|
298
|
+
/* @end */
|
299
|
+
|
300
|
+
|
301
|
+
img.avatar {
|
302
|
+
width: 50px;
|
303
|
+
height: 50px;
|
304
|
+
}
|
305
|
+
|
306
|
+
.clearfix {
|
307
|
+
clear: both;
|
308
|
+
}
|
309
|
+
|
310
|
+
.label {
|
311
|
+
padding: 1px 6px 2px;
|
312
|
+
font-size: 9.75px;
|
313
|
+
font-weight: bold;
|
314
|
+
color: white;
|
315
|
+
text-transform: uppercase;
|
316
|
+
white-space: nowrap;
|
317
|
+
background-color: #BFBFBF;
|
318
|
+
-webkit-border-radius: 3px;
|
319
|
+
-moz-border-radius: 3px;
|
320
|
+
border-radius: 3px;
|
321
|
+
line-height: 18px;
|
322
|
+
|
323
|
+
&.finished {
|
324
|
+
background-color: $color_green;
|
325
|
+
}
|
326
|
+
|
327
|
+
&.wishlist {
|
328
|
+
background-color: $color_pink;
|
329
|
+
}
|
330
|
+
|
331
|
+
&.reading {
|
332
|
+
background-color: $color_yellow;
|
333
|
+
}
|
334
|
+
|
335
|
+
&.rank {
|
336
|
+
background-color: transparent;
|
337
|
+
border: 1px solid #999;
|
338
|
+
color: #999;
|
339
|
+
}
|
340
|
+
}
|
341
|
+
|
342
|
+
.tag {
|
343
|
+
border: 0px solid;
|
344
|
+
padding: 0 5px 0 13px;
|
345
|
+
margin: 0 3px 3px 0;
|
346
|
+
float: left;
|
347
|
+
background: url(asset_path("tag.png", image)) no-repeat 0;
|
348
|
+
|
349
|
+
&.current:hover {
|
350
|
+
text-decoration: none;
|
351
|
+
}
|
352
|
+
}
|
353
|
+
|
354
|
+
/* scope button */
|
355
|
+
ul.scopes {
|
356
|
+
overflow: hidden;
|
357
|
+
list-style: none;
|
358
|
+
padding: 5px;
|
359
|
+
margin: 0;
|
360
|
+
|
361
|
+
li {
|
362
|
+
float: left;
|
363
|
+
margin-right: 5px;
|
364
|
+
padding-right: 5px;
|
365
|
+
|
366
|
+
span {
|
367
|
+
font-weight: bold;
|
368
|
+
}
|
369
|
+
|
370
|
+
a {
|
371
|
+
padding: 2px 4px;
|
372
|
+
|
373
|
+
&.current {
|
374
|
+
background: $color_yellow;
|
375
|
+
color: #fff;
|
376
|
+
}
|
377
|
+
}
|
378
|
+
}
|
379
|
+
}
|
380
|
+
|
381
|
+
.logs {
|
382
|
+
.header {
|
383
|
+
background: #eee;
|
384
|
+
padding: 5px;
|
385
|
+
margin: 0 0 1em;
|
386
|
+
|
387
|
+
.version {
|
388
|
+
color: $color_green;
|
389
|
+
margin: 0 1em 0 0;
|
390
|
+
font-weight: bold;
|
391
|
+
}
|
392
|
+
}
|
393
|
+
|
394
|
+
.log {
|
395
|
+
overflow: hidden;
|
396
|
+
margin: 0 0 1em;
|
397
|
+
|
398
|
+
.left {
|
399
|
+
float: left;
|
400
|
+
width: 100px;
|
401
|
+
margin: 0 10px 0 0;
|
402
|
+
text-align: right;
|
403
|
+
|
404
|
+
.new {
|
405
|
+
background: $color_red;
|
406
|
+
}
|
407
|
+
|
408
|
+
.fixed {
|
409
|
+
background: $color_green;
|
410
|
+
}
|
411
|
+
|
412
|
+
.improved {
|
413
|
+
background: $color_yellow;
|
414
|
+
}
|
415
|
+
}
|
416
|
+
|
417
|
+
.right {
|
418
|
+
float: left;
|
419
|
+
width: 80%;
|
420
|
+
|
421
|
+
p {
|
422
|
+
margin: 0 0 5px;
|
423
|
+
}
|
424
|
+
|
425
|
+
.title {
|
426
|
+
font-weight: bold;
|
427
|
+
}
|
428
|
+
}
|
429
|
+
}
|
430
|
+
}
|
431
|
+
|
432
|
+
.row {
|
433
|
+
padding: 10px 0;
|
434
|
+
margin: 10px 0;
|
435
|
+
border-top: 1px solid #eee;
|
436
|
+
overflow: hidden;
|
437
|
+
|
438
|
+
&.description {
|
439
|
+
.key {
|
440
|
+
display: none;
|
441
|
+
}
|
442
|
+
|
443
|
+
.value {
|
444
|
+
width: 100%;
|
445
|
+
}
|
446
|
+
}
|
447
|
+
|
448
|
+
.key {
|
449
|
+
float: left;
|
450
|
+
width: 200px;
|
451
|
+
text-transform: uppercase;
|
452
|
+
}
|
453
|
+
|
454
|
+
.value {
|
455
|
+
float: left;
|
456
|
+
width: 320px;
|
457
|
+
color: #444;
|
458
|
+
|
459
|
+
.sub {
|
460
|
+
padding: 10px 0;
|
461
|
+
border-top: 1px solid #DDD;
|
462
|
+
width: 100%;
|
463
|
+
overflow: hidden;
|
464
|
+
|
465
|
+
&:first-child {
|
466
|
+
padding-top: 0;
|
467
|
+
border-top: 0;
|
468
|
+
}
|
469
|
+
|
470
|
+
&:last-child {
|
471
|
+
padding-bottom: 0;
|
472
|
+
}
|
473
|
+
}
|
474
|
+
}
|
475
|
+
}
|
476
|
+
|
477
|
+
.toolbar {
|
478
|
+
overflow: hidden;
|
479
|
+
margin: 0 0 30px 0;
|
480
|
+
|
481
|
+
.left {
|
482
|
+
float: left;
|
483
|
+
}
|
484
|
+
|
485
|
+
.right {
|
486
|
+
float: right;
|
487
|
+
}
|
488
|
+
}
|
489
|
+
|
490
|
+
.list {
|
491
|
+
list-style: disc;
|
492
|
+
margin: 0 0 9px 3em;
|
493
|
+
}
|
494
|
+
|
495
|
+
|
496
|
+
.block {
|
497
|
+
margin: 0 0 20px;
|
498
|
+
|
499
|
+
h3 {
|
500
|
+
@include h3;
|
501
|
+
}
|
502
|
+
|
503
|
+
table.basic th {
|
504
|
+
background: none;
|
505
|
+
font-weight: bold;
|
506
|
+
}
|
507
|
+
}
|
@@ -0,0 +1,149 @@
|
|
1
|
+
module WidgetsHelper
|
2
|
+
|
3
|
+
#
|
4
|
+
# navigation helper
|
5
|
+
# by Felix
|
6
|
+
#
|
7
|
+
# the helper matches params with request.request_uri
|
8
|
+
#
|
9
|
+
# example:
|
10
|
+
# sections = {
|
11
|
+
# 'radio'=>{:title => 'Station', :url => radio_path},
|
12
|
+
# 'edit_station'=>{:url => 'Radio', :url => edit_station_path}
|
13
|
+
# }
|
14
|
+
# options = {
|
15
|
+
# :id => 'test_menu'
|
16
|
+
# :current => 'current'
|
17
|
+
# }
|
18
|
+
# outputs:
|
19
|
+
# <ul id="test_menu">
|
20
|
+
# <li><a href="/station">Station</a></li>
|
21
|
+
# <li class="current"><a href="/radio/">Radio</a></li>
|
22
|
+
# </ul>
|
23
|
+
#:title
|
24
|
+
def menu(sections, options=nil)
|
25
|
+
items = Array.new
|
26
|
+
|
27
|
+
# default options
|
28
|
+
options ||= Hash.new
|
29
|
+
options[:id] ||= nil
|
30
|
+
options[:class] ||= nil
|
31
|
+
options[:current] ||= 'current' # jquery ui tabs plugin needs the later one
|
32
|
+
|
33
|
+
sections.each do |section|
|
34
|
+
klass = section[:current] ? "#{options[:current]} #{section[:class]}".strip : section[:class]
|
35
|
+
items << content_tag(:li, link_to(section[:title], section[:url], :class => klass))
|
36
|
+
end
|
37
|
+
|
38
|
+
return content_tag :ul, :id => options[:id], :class => options[:class] do
|
39
|
+
items.collect {|item| concat(item)}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def clearfix options={}
|
44
|
+
opt = {:class => " clearfix"}
|
45
|
+
options[:class] += opt[:class] if options[:class]
|
46
|
+
(options[:class] || opt[:class]).strip!
|
47
|
+
opt = opt.merge(options)
|
48
|
+
content_tag(:div, nil, opt)
|
49
|
+
end
|
50
|
+
|
51
|
+
def link_to_user(user, options={})
|
52
|
+
|
53
|
+
default_options = {
|
54
|
+
:href => user,
|
55
|
+
:avatar => false,
|
56
|
+
:title => user.name,
|
57
|
+
:class => ""
|
58
|
+
}
|
59
|
+
|
60
|
+
options = default_options.merge(options)
|
61
|
+
|
62
|
+
if options[:avatar]
|
63
|
+
return unless user.avatar?
|
64
|
+
|
65
|
+
text = image_tag(user.avatar.url(options[:avatar]), :alt => user.name, :class => "avatar")
|
66
|
+
|
67
|
+
options[:class] += " avatar".strip
|
68
|
+
else
|
69
|
+
text = user.name
|
70
|
+
end
|
71
|
+
|
72
|
+
#raise url_for(user)#user_path(:subdomain => "aaa").inspect
|
73
|
+
link_to(text, options[:href], :title => options[:title], :class => options[:class])
|
74
|
+
end
|
75
|
+
|
76
|
+
def title(*titles)
|
77
|
+
seperator = " - "
|
78
|
+
|
79
|
+
default_options = {:sitename => true}
|
80
|
+
options = titles.last.is_a?(Hash) ? titles.pop : {}
|
81
|
+
options = default_options.merge(options)
|
82
|
+
|
83
|
+
page_title = page_title_for_return = titles.join(seperator)
|
84
|
+
page_title = t("logo") + seperator + page_title_for_return if options[:sitename]
|
85
|
+
|
86
|
+
content_for(:title, page_title)
|
87
|
+
|
88
|
+
page_title_for_return
|
89
|
+
end
|
90
|
+
|
91
|
+
def random_disable_with_status
|
92
|
+
status = [
|
93
|
+
"Just a moment",
|
94
|
+
"Let's stay together",
|
95
|
+
"On the highway to hell",
|
96
|
+
"Don't worry baby",
|
97
|
+
"Let it be",
|
98
|
+
"Getting you away from here",
|
99
|
+
"Let's get it started",
|
100
|
+
"It's now or never"
|
101
|
+
]
|
102
|
+
|
103
|
+
status.shuffle.first + "..."
|
104
|
+
end
|
105
|
+
|
106
|
+
#
|
107
|
+
# call to action
|
108
|
+
#
|
109
|
+
def cta text, url, html_options={}
|
110
|
+
default_html_options = {:class => "cta"}
|
111
|
+
html_options = default_html_options.merge(html_options)
|
112
|
+
html_options[:class] = (html_options[:class].to_s + " cta").strip
|
113
|
+
|
114
|
+
link_to content_tag(:span, text), url, html_options
|
115
|
+
end
|
116
|
+
|
117
|
+
#
|
118
|
+
# paginator
|
119
|
+
#
|
120
|
+
def paginator(collections, options={})
|
121
|
+
will_paginate collections, options
|
122
|
+
end
|
123
|
+
|
124
|
+
def time_difference time
|
125
|
+
"#{distance_of_time_in_words(time, Time.now, true)} ago" if time
|
126
|
+
end
|
127
|
+
|
128
|
+
def current_or_null(condition)
|
129
|
+
condition ? "current" : nil
|
130
|
+
end
|
131
|
+
|
132
|
+
def scope_button scopes, options={}
|
133
|
+
content_tag :ul, class: :scopes do
|
134
|
+
scopes.collect do |scope|
|
135
|
+
count = options[:count][scope[:key]]
|
136
|
+
url = eval("#{options[:path].to_s}(scope: :#{scope[:key]})")
|
137
|
+
current = ((params[:scope] == scope[:key].to_s) or (scope[:default] and params[:scope].blank?))
|
138
|
+
|
139
|
+
concat content_tag(:li, link_to("#{content_tag(:span, scope[:text])} (#{count})".html_safe, url, class: current_or_null(current)))
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
protected
|
145
|
+
|
146
|
+
def current_template
|
147
|
+
File.basename(lookup_context.find_all(params[:action], params[:controller]).first.inspect)
|
148
|
+
end
|
149
|
+
end
|
data/jap_mag.gemspec
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/jap_mag/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Felix Ding"]
|
6
|
+
gem.email = ["felixding@gmail.com"]
|
7
|
+
gem.description = %q{JapMag is the design language created by Felix Ding. This gem helps designers start a project that follows JapMag.}
|
8
|
+
gem.summary = "jap_mag-#{gem.version}"
|
9
|
+
gem.homepage = "http://dingyu.me"
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "jap_mag"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = JapMag::VERSION
|
17
|
+
end
|
data/lib/jap_mag.rb
ADDED
metadata
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jap_mag
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Felix Ding
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-09-08 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: JapMag is the design language created by Felix Ding. This gem helps designers
|
15
|
+
start a project that follows JapMag.
|
16
|
+
email:
|
17
|
+
- felixding@gmail.com
|
18
|
+
executables: []
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- .gitignore
|
23
|
+
- Gemfile
|
24
|
+
- LICENSE
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- app/assets/stylesheets/base.scss
|
28
|
+
- app/assets/stylesheets/index.css
|
29
|
+
- app/assets/stylesheets/mixins.scss
|
30
|
+
- app/assets/stylesheets/reset.scss
|
31
|
+
- app/assets/stylesheets/variables.scss
|
32
|
+
- app/assets/stylesheets/widgets.scss
|
33
|
+
- app/helpers/widgets_helper.rb
|
34
|
+
- jap_mag.gemspec
|
35
|
+
- lib/jap_mag.rb
|
36
|
+
- lib/jap_mag/version.rb
|
37
|
+
homepage: http://dingyu.me
|
38
|
+
licenses: []
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
requirements: []
|
56
|
+
rubyforge_project:
|
57
|
+
rubygems_version: 1.8.24
|
58
|
+
signing_key:
|
59
|
+
specification_version: 3
|
60
|
+
summary: jap_mag-
|
61
|
+
test_files: []
|