jap_mag 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.md +1 -1
- data/app/assets/stylesheets/jap_mag/base.scss +2 -2
- data/app/assets/stylesheets/jap_mag/mixins.scss +44 -3
- data/app/assets/stylesheets/jap_mag/variables.scss +6 -1
- data/app/assets/stylesheets/jap_mag/widgets.scss +17 -5
- data/app/helpers/jap_mag_widgets_helper.rb +0 -14
- data/app/views/layouts/_footer.erb +11 -9
- data/app/views/layouts/_header.erb +5 -3
- data/app/views/layouts/application.erb +4 -2
- data/lib/jap_mag.rb +27 -1
- data/lib/jap_mag/version.rb +3 -0
- metadata +3 -2
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
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
4
|
|
5
|
-
This gem helps designers start a project that follows JapMag. It consists of several CSS definations, Rails helpers and view templates.
|
5
|
+
This gem helps designers start a project that follows JapMag design language. It consists of several CSS definations, Rails helpers and view templates. Think this gem as an UI kit similar to Twitter's Bootstrap, but more tightly integrated with Ruby on Rails.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -164,11 +164,11 @@ blockquote {
|
|
164
164
|
}
|
165
165
|
|
166
166
|
.zh-CN {
|
167
|
-
background: url(
|
167
|
+
background: url($flag_zh-cn) no-repeat 0 2px;
|
168
168
|
}
|
169
169
|
|
170
170
|
.en {
|
171
|
-
background: url(
|
171
|
+
background: url($flag_en) no-repeat 0 2px;
|
172
172
|
}
|
173
173
|
}
|
174
174
|
}
|
@@ -4,6 +4,26 @@
|
|
4
4
|
-webkit-border-radius: $radius;
|
5
5
|
}
|
6
6
|
|
7
|
+
@mixin columns($count: 2, $gap: 60px) {
|
8
|
+
-moz-column-count: $count;
|
9
|
+
-webkit-column-count: $count;
|
10
|
+
column-count: $count;
|
11
|
+
-moz-column-gap: $gap;
|
12
|
+
-webkit-column-gap: $gap;
|
13
|
+
column-gap: $gap;
|
14
|
+
}
|
15
|
+
|
16
|
+
@mixin rotate($degrees) {
|
17
|
+
-webkit-transform: rotate(#{$degrees}deg);
|
18
|
+
-moz-transform: rotate(#{$degrees}deg);
|
19
|
+
-ms-transform: rotate(#{$degrees}deg);
|
20
|
+
-o-transform: rotate(#{$degrees}deg);
|
21
|
+
transform: rotate(#{$degrees}deg);
|
22
|
+
|
23
|
+
filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=#{cos($degrees)}, M12=-#{sin($degrees)}, M21=#{sin($degrees)}, M22=#{cos($degrees)});
|
24
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=#{cos($degrees)}, M12=-#{sin($degrees)}, M21=#{sin($degrees)}, M22=#{cos($degrees)})";
|
25
|
+
zoom: 1;
|
26
|
+
}
|
7
27
|
|
8
28
|
@mixin box-shadow($effect: 1px 0px 5px black) {
|
9
29
|
box-shadow: $effect;
|
@@ -21,8 +41,7 @@
|
|
21
41
|
}
|
22
42
|
|
23
43
|
#wrapper {
|
24
|
-
padding:
|
25
|
-
margin: 0 auto;
|
44
|
+
padding: 0;
|
26
45
|
}
|
27
46
|
|
28
47
|
#body {
|
@@ -36,11 +55,19 @@
|
|
36
55
|
width: 95%;
|
37
56
|
}
|
38
57
|
}
|
58
|
+
|
59
|
+
#error_explanation {
|
60
|
+
width: auto;
|
61
|
+
}
|
39
62
|
}
|
40
63
|
|
41
64
|
@mixin set_width($base_width) {
|
42
65
|
#wrapper {
|
43
|
-
width: $base_width
|
66
|
+
width: $base_width !important;
|
67
|
+
|
68
|
+
.gutter {
|
69
|
+
width: $base_width - 20px;
|
70
|
+
}
|
44
71
|
}
|
45
72
|
}
|
46
73
|
|
@@ -66,4 +93,18 @@
|
|
66
93
|
@include set_width(568px);
|
67
94
|
@content;
|
68
95
|
}
|
96
|
+
}
|
97
|
+
|
98
|
+
/* all iPhone */
|
99
|
+
@mixin iphone_portrait_and_landscape {
|
100
|
+
@include iphone_portrait {@content};
|
101
|
+
@include iphone_4s_landscape {@content};
|
102
|
+
@include iphone_5_landscape {@content};
|
103
|
+
}
|
104
|
+
|
105
|
+
/* Desktop, say, 960px width */
|
106
|
+
@mixin desktop {
|
107
|
+
@media only screen and (min-width: 768px) {
|
108
|
+
@content;
|
109
|
+
}
|
69
110
|
}
|
@@ -3,10 +3,15 @@ $base_width: 800px;
|
|
3
3
|
$color_green: #53a440;
|
4
4
|
$color_light_green: #7dde66;
|
5
5
|
$color_lighter_green: #65b453;
|
6
|
+
$color_even_lighter_green: #e0ffe2;
|
6
7
|
$color_blue: #3b7fa6; /*#56a1cc;*/
|
7
8
|
$color_light_blue: #6aa5c6;
|
8
9
|
$color_lighter_blue: #EBF8F9;
|
9
10
|
$color_red: #e75151;/*#ff5656;*/
|
10
11
|
$color_yellow: #fc9729;
|
11
12
|
$color_pink: #FF7676;
|
12
|
-
$
|
13
|
+
$color_light_pink: #ffe0e0;
|
14
|
+
$color_body: #000;
|
15
|
+
|
16
|
+
$flag_zh-cn: "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==";
|
17
|
+
$flag_en: "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";
|
@@ -16,19 +16,18 @@
|
|
16
16
|
|
17
17
|
div.pagination {
|
18
18
|
margin: 10px 0;
|
19
|
+
overflow: hidden;
|
19
20
|
|
20
|
-
em {
|
21
|
+
em, a, span {
|
21
22
|
padding: 10px;
|
23
|
+
float: left;
|
24
|
+
margin: 0 5px 5px 0;
|
22
25
|
}
|
23
26
|
|
24
27
|
.current {
|
25
28
|
background: #aaa;
|
26
29
|
color: #fff;
|
27
30
|
}
|
28
|
-
|
29
|
-
a {
|
30
|
-
padding: 10px;
|
31
|
-
}
|
32
31
|
}
|
33
32
|
|
34
33
|
#flash {
|
@@ -74,6 +73,7 @@ table.basic {
|
|
74
73
|
margin: 0;
|
75
74
|
padding: 0;
|
76
75
|
width: 100%;
|
76
|
+
word-break: break-all;
|
77
77
|
|
78
78
|
td, & th {
|
79
79
|
margin: 0;
|
@@ -101,6 +101,14 @@ table.basic {
|
|
101
101
|
tr:last-child {
|
102
102
|
border-bottom: 1px solid #ccc;
|
103
103
|
}
|
104
|
+
|
105
|
+
.ok {
|
106
|
+
background: $color_even_lighter_green;
|
107
|
+
}
|
108
|
+
|
109
|
+
.bad {
|
110
|
+
background: $color_light_pink;
|
111
|
+
}
|
104
112
|
}
|
105
113
|
|
106
114
|
/* call to action*/
|
@@ -453,6 +461,10 @@ ul.scopes {
|
|
453
461
|
}
|
454
462
|
}
|
455
463
|
|
464
|
+
ul.list {
|
465
|
+
list-style-type: disc;
|
466
|
+
}
|
467
|
+
|
456
468
|
ol.list {
|
457
469
|
list-style-type: decimal;
|
458
470
|
}
|
@@ -168,20 +168,6 @@ module JapMagWidgetsHelper
|
|
168
168
|
file = File.join("tmp", "restart.txt")
|
169
169
|
File.exists?(file) ? File.atime(file) : nil
|
170
170
|
end
|
171
|
-
|
172
|
-
def current_controller_action_in?(*args)
|
173
|
-
args.each do |element|
|
174
|
-
if element.include?("#")
|
175
|
-
array = element.match(/([a-z\-\_]*)#([a-z\-\_]*)/).to_a
|
176
|
-
c, a = array[1], array[2]
|
177
|
-
return true if controller.controller_name == c && controller.action_name == a
|
178
|
-
else
|
179
|
-
return true if controller.controller_name == element
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
false
|
184
|
-
end
|
185
171
|
|
186
172
|
protected
|
187
173
|
|
@@ -1,11 +1,13 @@
|
|
1
1
|
<div id="footer">
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
2
|
+
<div class="gutter">
|
3
|
+
<p><%= t :copyright %></p>
|
4
|
+
<%= clearfix %>
|
5
|
+
<ul class="languages">
|
6
|
+
<%
|
7
|
+
p = params.dup.delete_if{|key| %w(action controller locale).include?(key)}
|
8
|
+
%>
|
9
|
+
<li class="en"><%= link_to_unless_current t(:english), locale: :en, params: p %></li>
|
10
|
+
<li class="zh-CN"><%= link_to_unless_current t(:chinese), locale: "zh-CN", params: p %></li>
|
11
|
+
</ul>
|
12
|
+
</div>
|
11
13
|
</div>
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<div id="header">
|
2
|
-
<
|
3
|
-
|
4
|
-
|
2
|
+
<div class="gutter">
|
3
|
+
<h1><%= link_to t("logo"), root_path %></h1>
|
4
|
+
<p class="slogan"><%= t("slogan") %></p>
|
5
|
+
<%= render "layouts/navigation" %>
|
6
|
+
</div>
|
5
7
|
</div>
|
@@ -19,8 +19,10 @@
|
|
19
19
|
<%= render :partial => "/layouts/header" %>
|
20
20
|
|
21
21
|
<div id="body">
|
22
|
-
|
23
|
-
|
22
|
+
<div class="gutter">
|
23
|
+
<%= render :partial => "/layouts/flash", :locals => {:flash => flash} %>
|
24
|
+
<%= yield %>
|
25
|
+
</div>
|
24
26
|
</div>
|
25
27
|
|
26
28
|
<%= render :partial => "/layouts/footer" %>
|
data/lib/jap_mag.rb
CHANGED
@@ -1,12 +1,38 @@
|
|
1
1
|
module JapMag
|
2
2
|
# i18N
|
3
3
|
def _ key, options={}
|
4
|
-
|
4
|
+
# for absolute pathes /
|
5
|
+
if (key[0] == "/")
|
6
|
+
key = key.gsub("/", "")
|
7
|
+
|
8
|
+
# for all other cases
|
9
|
+
else
|
10
|
+
key = "#{params[:controller]}.#{params[:action]}.#{key}"
|
11
|
+
end
|
12
|
+
|
5
13
|
t(key, options)
|
6
14
|
end
|
7
15
|
|
16
|
+
def current_controller_action_in?(*args)
|
17
|
+
controller = params["controller"]
|
18
|
+
action = params["action"]
|
19
|
+
|
20
|
+
args.each do |element|
|
21
|
+
if element.include?("#")
|
22
|
+
array = element.match(/([a-z\-\_]*)#([a-z\-\_]*)/).to_a
|
23
|
+
c, a = array[1], array[2]
|
24
|
+
return true if controller == c && action == a
|
25
|
+
else
|
26
|
+
return true if controller == element
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
false
|
31
|
+
end
|
32
|
+
|
8
33
|
def self.included base
|
9
34
|
base.helper_method :_
|
35
|
+
base.helper_method :current_controller_action_in?
|
10
36
|
end
|
11
37
|
|
12
38
|
class Engine < Rails::Engine
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jap_mag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
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:
|
12
|
+
date: 2013-03-29 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: JapMag is the design language created by Felix Ding. This gem helps designers
|
15
15
|
start a project that follows JapMag.
|
@@ -43,6 +43,7 @@ files:
|
|
43
43
|
- config/locales/en.yml
|
44
44
|
- jap_mag.gemspec
|
45
45
|
- lib/jap_mag.rb
|
46
|
+
- lib/jap_mag/version.rb
|
46
47
|
homepage: https://github.com/felixding/JapMag
|
47
48
|
licenses: []
|
48
49
|
post_install_message:
|