rails_design 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +20 -0
- data/README.md +18 -0
- data/Rakefile +18 -0
- data/app/assets/images/image-square.png +0 -0
- data/app/assets/images/logo.png +0 -0
- data/app/assets/javascripts/default_form/datetime.js +31 -0
- data/app/assets/javascripts/default_form/default_valid.js +101 -0
- data/app/assets/javascripts/default_form/field.js +33 -0
- data/app/assets/javascripts/default_form/index.js +9 -0
- data/app/assets/javascripts/default_form/valid_weui.js +17 -0
- data/app/assets/javascripts/rails_design/attachment.js +295 -0
- data/app/assets/javascripts/rails_design/cable.js +3 -0
- data/app/assets/javascripts/rails_design/dataset.js +39 -0
- data/app/assets/javascripts/rails_design/index.js +4 -0
- data/app/assets/javascripts/rails_design/stimulus.js +19 -0
- data/app/assets/javascripts/rails_design/turbo.js +35 -0
- data/app/assets/javascripts/stimulus_com/checkbox.js +77 -0
- data/app/assets/javascripts/stimulus_com/choice.js +18 -0
- data/app/assets/javascripts/stimulus_com/common.js +52 -0
- data/app/assets/javascripts/stimulus_com/count_down.js +27 -0
- data/app/assets/javascripts/stimulus_com/former.js +26 -0
- data/app/assets/javascripts/stimulus_com/hover.js +40 -0
- data/app/assets/javascripts/stimulus_com/index.js +58 -0
- data/app/assets/javascripts/stimulus_com/input.js +36 -0
- data/app/assets/javascripts/stimulus_com/menu.js +34 -0
- data/app/assets/javascripts/stimulus_com/modal.js +85 -0
- data/app/assets/javascripts/stimulus_com/modal_show.js +16 -0
- data/app/assets/javascripts/stimulus_com/navbar.js +11 -0
- data/app/assets/javascripts/stimulus_com/notice.js +10 -0
- data/app/assets/javascripts/stimulus_com/picture.js +85 -0
- data/app/assets/javascripts/stimulus_com/show.js +26 -0
- data/app/assets/javascripts/stimulus_com/showcase.js +34 -0
- data/app/assets/javascripts/stimulus_com/slide.js +188 -0
- data/app/assets/javascripts/stimulus_com/slide_y.js +189 -0
- data/app/assets/javascripts/stimulus_com/sortable.js +41 -0
- data/app/assets/javascripts/stimulus_com/sticky.js +11 -0
- data/app/assets/javascripts/stimulus_com/swipe.js +78 -0
- data/app/assets/javascripts/stimulus_com/taxon.js +45 -0
- data/app/assets/javascripts/stimulus_com/time.js +19 -0
- data/app/assets/javascripts/stimulus_com/touch.js +83 -0
- data/app/assets/javascripts/stimulus_com/tree.js +34 -0
- data/app/assets/javascripts/stimulus_com/tree_remote.js +64 -0
- data/app/assets/javascripts/stimulus_com/typer.js +41 -0
- data/app/assets/javascripts/stimulus_com/visit.js +61 -0
- data/app/assets/javascripts/stimulus_phone/index.js +19 -0
- data/app/assets/javascripts/stimulus_phone/qq_map.js +29 -0
- data/app/assets/javascripts/stimulus_phone/search.js +37 -0
- data/app/assets/javascripts/stimulus_phone/wechat.js +80 -0
- data/app/assets/javascripts/stimulus_phone/weui-actionsheet.js +43 -0
- data/app/assets/javascripts/stimulus_phone/weui-datepicker.js +38 -0
- data/app/assets/javascripts/stimulus_phone/weui-dialog.js +24 -0
- data/app/assets/javascripts/stimulus_phone/weui-picker.js +54 -0
- data/app/assets/javascripts/stimulus_phone/wxpay.js +29 -0
- data/app/assets/stylesheets/app.scss +3 -0
- data/app/assets/stylesheets/ext_bulma/base/_all.scss +5 -0
- data/app/assets/stylesheets/ext_bulma/base/_choices.scss +3 -0
- data/app/assets/stylesheets/ext_bulma/base/_global.scss +19 -0
- data/app/assets/stylesheets/ext_bulma/base/_main.scss +15 -0
- data/app/assets/stylesheets/ext_bulma/components/_all.scss +10 -0
- data/app/assets/stylesheets/ext_bulma/components/_box.scss +15 -0
- data/app/assets/stylesheets/ext_bulma/components/_breadcrumb.scss +17 -0
- data/app/assets/stylesheets/ext_bulma/components/_card.scss +12 -0
- data/app/assets/stylesheets/ext_bulma/components/_level.scss +8 -0
- data/app/assets/stylesheets/ext_bulma/components/_media.scss +14 -0
- data/app/assets/stylesheets/ext_bulma/components/_menu.scss +76 -0
- data/app/assets/stylesheets/ext_bulma/components/_pagination.scss +9 -0
- data/app/assets/stylesheets/ext_bulma/components/_panel.scss +5 -0
- data/app/assets/stylesheets/ext_bulma/elements/_all.scss +7 -0
- data/app/assets/stylesheets/ext_bulma/elements/_button.scss +14 -0
- data/app/assets/stylesheets/ext_bulma/elements/_fa.scss +4 -0
- data/app/assets/stylesheets/ext_bulma/elements/_image.scss +38 -0
- data/app/assets/stylesheets/ext_bulma/elements/_table.scss +52 -0
- data/app/assets/stylesheets/ext_bulma/elements/_title.scss +9 -0
- data/app/assets/stylesheets/ext_bulma/expand/_all.scss +2 -0
- data/app/assets/stylesheets/ext_bulma/expand/_slide.scss +26 -0
- data/app/assets/stylesheets/ext_bulma/expand/_sortable.scss +4 -0
- data/app/assets/stylesheets/ext_bulma/form/_all.scss +34 -0
- data/app/assets/stylesheets/ext_bulma/form/_checkbox.scss +267 -0
- data/app/assets/stylesheets/ext_bulma/form/_file.scss +23 -0
- data/app/assets/stylesheets/ext_bulma/form/_select.scss +5 -0
- data/app/assets/stylesheets/ext_bulma/form/_tools.scss +30 -0
- data/app/assets/stylesheets/ext_bulma/grid/_all.scss +3 -0
- data/app/assets/stylesheets/ext_bulma/grid/_columns.scss +13 -0
- data/app/assets/stylesheets/ext_bulma/helpers/_all.scss +5 -0
- data/app/assets/stylesheets/ext_bulma/helpers/_dot.scss +11 -0
- data/app/assets/stylesheets/ext_bulma/helpers/_drawable.scss +3 -0
- data/app/assets/stylesheets/ext_bulma/helpers/_grid.scss +10 -0
- data/app/assets/stylesheets/ext_bulma/index.scss +22 -0
- data/app/assets/stylesheets/ext_bulma/layout/_all.scss +4 -0
- data/app/assets/stylesheets/ext_bulma/layout/_footer.scss +4 -0
- data/app/assets/stylesheets/ext_bulma/layout/_level.scss +1 -0
- data/app/assets/stylesheets/ext_choices/index.scss +16 -0
- data/app/assets/stylesheets/ext_font/index.scss +4 -0
- data/app/assets/stylesheets/ext_weui/index.scss +24 -0
- data/app/assets/stylesheets/ext_weui/widget/_actionsheet.scss +3 -0
- data/app/assets/stylesheets/ext_weui/widget/_article.scss +7 -0
- data/app/assets/stylesheets/ext_weui/widget/_button.scss +7 -0
- data/app/assets/stylesheets/ext_weui/widget/_cell.scss +17 -0
- data/app/assets/stylesheets/ext_weui/widget/_form.scss +3 -0
- data/app/assets/stylesheets/ext_weui/widget/_half_screen_dialog.scss +10 -0
- data/app/assets/stylesheets/ext_weui/widget/_icon.scss +9 -0
- data/app/assets/stylesheets/ext_weui/widget/_media.scss +43 -0
- data/app/assets/stylesheets/ext_weui/widget/_panel.scss +4 -0
- data/app/assets/stylesheets/ext_weui/widget/_preview.scss +5 -0
- data/app/assets/stylesheets/ext_weui/widget/_search.scss +5 -0
- data/app/assets/stylesheets/ext_weui/widget/_tab.scss +10 -0
- data/app/assets/stylesheets/ext_weui/widget/_tabbar.scss +12 -0
- data/app/assets/stylesheets/ext_weui/widget/_uploader.scss +14 -0
- data/app/assets/stylesheets/phone.scss +6 -0
- data/app/assets/stylesheets/slide/index.scss +208 -0
- data/app/assets/stylesheets/ui_tooltip/_mixins.scss +46 -0
- data/app/assets/stylesheets/ui_tooltip/_variables.scss +5 -0
- data/app/assets/stylesheets/ui_tooltip/index.scss +278 -0
- data/app/controllers/design/base_controller.rb +4 -0
- data/app/controllers/design/home_controller.rb +13 -0
- data/app/views/design/home/swipe.html.erb +7 -0
- data/app/views/layouts/ui/base.html.erb +5 -0
- data/config/routes.rb +11 -0
- data/lib/rails_design/config.rb +8 -0
- data/lib/rails_design/engine.rb +5 -0
- data/lib/rails_design.rb +2 -0
- metadata +181 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
.slide {
|
2
|
+
--height: 430px;
|
3
|
+
position: relative;
|
4
|
+
height: calc(var(--height) + 30px);
|
5
|
+
//margin-bottom: 27px;
|
6
|
+
|
7
|
+
figure {
|
8
|
+
position: absolute;
|
9
|
+
width: 100%;
|
10
|
+
height: var(--height);
|
11
|
+
text-align: center;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
.slide-y {
|
16
|
+
position: relative;
|
17
|
+
height: 100vh;
|
18
|
+
|
19
|
+
figure {
|
20
|
+
position: absolute;
|
21
|
+
width: 100%;
|
22
|
+
height: 100%;
|
23
|
+
text-align: center;
|
24
|
+
background: black;
|
25
|
+
}
|
26
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
@charset "utf-8";
|
2
|
+
|
3
|
+
@import 'file';
|
4
|
+
@import 'select';
|
5
|
+
@import 'tools';
|
6
|
+
@import 'checkbox';
|
7
|
+
|
8
|
+
form.button_to {
|
9
|
+
display: inline;
|
10
|
+
button:not(.button),
|
11
|
+
input[type="submit"] {
|
12
|
+
border: none;
|
13
|
+
padding: 0;
|
14
|
+
background: none;
|
15
|
+
cursor: pointer;
|
16
|
+
}
|
17
|
+
button:not(.button):focus,
|
18
|
+
input[type="submit"]:focus {
|
19
|
+
outline: none;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
form.button_box {
|
24
|
+
display: inline-block;
|
25
|
+
width: 100%;
|
26
|
+
height: 30px;
|
27
|
+
button:not(.button) {
|
28
|
+
text-align: left;
|
29
|
+
border: solid 1px transparent;
|
30
|
+
box-shadow: inset 1px 1px 2px dimgrey;
|
31
|
+
width: 100%;
|
32
|
+
height: 100%;
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,267 @@
|
|
1
|
+
$switch-background: $grey-light !default;
|
2
|
+
$switch-border: .1rem solid transparent !default;
|
3
|
+
$switch-background-active: $primary !default;
|
4
|
+
$switch-radius: $radius !default;
|
5
|
+
$switch-paddle-background: $white !default;
|
6
|
+
$switch-paddle-background-active: $primary !default;
|
7
|
+
$switch-paddle-offset: 0.25rem !default;
|
8
|
+
$switch-paddle-transition: all 0.25s ease-out !default;
|
9
|
+
$switch-focus: 1px dotted $grey-light !default;
|
10
|
+
|
11
|
+
@mixin switch-size($size) {
|
12
|
+
$switch-height: $size * 1.5;
|
13
|
+
$switch-width: $switch-height * 2;
|
14
|
+
$paddle-height: $switch-height - ($switch-paddle-offset * 2);
|
15
|
+
$paddle-width: $switch-height - ($switch-paddle-offset * 2);
|
16
|
+
$paddle-active-offest: $switch-width - $paddle-width - ($switch-paddle-offset * 1.5);
|
17
|
+
+ label {
|
18
|
+
position: relative;
|
19
|
+
display: inline-flex;
|
20
|
+
align-items: center;
|
21
|
+
justify-content: flex-start;
|
22
|
+
font-size: $size;
|
23
|
+
height: $control-height;
|
24
|
+
line-height: $control-line-height;
|
25
|
+
padding-left: $switch-width + .5;
|
26
|
+
padding-top: .2rem;
|
27
|
+
cursor: pointer;
|
28
|
+
|
29
|
+
&::before,
|
30
|
+
&:before {
|
31
|
+
position: absolute;
|
32
|
+
display: block;
|
33
|
+
top: calc( 50% - #{$switch-height} / 2 );
|
34
|
+
left: 0;
|
35
|
+
width: $switch-width;
|
36
|
+
height: $switch-height;
|
37
|
+
border: $switch-border;
|
38
|
+
border-radius: $switch-radius;
|
39
|
+
background: $switch-background;
|
40
|
+
content: '';
|
41
|
+
}
|
42
|
+
|
43
|
+
&::after,
|
44
|
+
&:after { display: block;
|
45
|
+
position: absolute;
|
46
|
+
top: calc( 50% - #{$paddle-height} / 2 );
|
47
|
+
left: $switch-paddle-offset;
|
48
|
+
width: $paddle-width;
|
49
|
+
height: $paddle-height;
|
50
|
+
transform: translate3d(0, 0, 0);
|
51
|
+
border-radius: $switch-radius;
|
52
|
+
background: $switch-paddle-background;
|
53
|
+
transition: $switch-paddle-transition;content: '';
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
&.is-rtl {
|
58
|
+
+ label {
|
59
|
+
padding-left: 0;
|
60
|
+
padding-right: $switch-width + .5;
|
61
|
+
&::before,
|
62
|
+
&:before {
|
63
|
+
left: auto;
|
64
|
+
right: 0;
|
65
|
+
}
|
66
|
+
&::after,
|
67
|
+
&:after {
|
68
|
+
left: auto;
|
69
|
+
right: $paddle-active-offest;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
&:checked {
|
75
|
+
+ label {
|
76
|
+
&::before,
|
77
|
+
&:before {
|
78
|
+
background: $switch-background-active;
|
79
|
+
}
|
80
|
+
&::after {
|
81
|
+
left: $paddle-active-offest;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
&.is-rtl {
|
86
|
+
+ label {
|
87
|
+
&::after,
|
88
|
+
&:after {
|
89
|
+
left: auto;
|
90
|
+
right: $switch-paddle-offset;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
&.is-outlined {
|
97
|
+
+ label {
|
98
|
+
&::before,
|
99
|
+
&:before {
|
100
|
+
background-color: transparent;
|
101
|
+
border-color: $switch-background;
|
102
|
+
}
|
103
|
+
|
104
|
+
&::after,
|
105
|
+
&:after {
|
106
|
+
background: $switch-background;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
&:checked {
|
111
|
+
+ label {
|
112
|
+
&::before,
|
113
|
+
&:before {
|
114
|
+
background-color: transparent;
|
115
|
+
border-color: $switch-background-active;
|
116
|
+
}
|
117
|
+
&::after,
|
118
|
+
&:after {
|
119
|
+
background: $switch-paddle-background-active;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
&.is-thin {
|
126
|
+
+ label {
|
127
|
+
&::before,
|
128
|
+
&:before {
|
129
|
+
top: divide($switch-height, 2.75);
|
130
|
+
height: divide($switch-height, 4);
|
131
|
+
}
|
132
|
+
&::after,
|
133
|
+
&:after {
|
134
|
+
box-shadow: 0 0 3px $grey;
|
135
|
+
}
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
&.is-rounded {
|
140
|
+
+ label {
|
141
|
+
&::before,
|
142
|
+
&:before {
|
143
|
+
border-radius: $radius-large * 4;
|
144
|
+
}
|
145
|
+
&::after,
|
146
|
+
&:after {
|
147
|
+
border-radius: 50%;
|
148
|
+
}
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
.switch[type="checkbox"] {
|
154
|
+
outline: 0;
|
155
|
+
user-select: none;
|
156
|
+
display: inline-block;
|
157
|
+
position: absolute;
|
158
|
+
opacity: 0;
|
159
|
+
&:focus {
|
160
|
+
+ label {
|
161
|
+
&::before,
|
162
|
+
&:before,
|
163
|
+
&::after,
|
164
|
+
&:after {
|
165
|
+
outline: $switch-focus;
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
169
|
+
&[disabled] {
|
170
|
+
cursor: not-allowed;
|
171
|
+
+ label {
|
172
|
+
opacity: 0.5;
|
173
|
+
&::before,
|
174
|
+
&:before {
|
175
|
+
opacity: 0.5;
|
176
|
+
}
|
177
|
+
&::after,
|
178
|
+
&:after {
|
179
|
+
opacity: 0.5;
|
180
|
+
}
|
181
|
+
&:hover {
|
182
|
+
cursor: not-allowed;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
187
|
+
@include switch-size($size-normal);
|
188
|
+
&.is-small {
|
189
|
+
@include switch-size($size-small);
|
190
|
+
}
|
191
|
+
&.is-medium {
|
192
|
+
@include switch-size($size-medium);
|
193
|
+
}
|
194
|
+
&.is-large {
|
195
|
+
@include switch-size($size-large);
|
196
|
+
}
|
197
|
+
|
198
|
+
@each $name, $pair in $colors {
|
199
|
+
$color: nth($pair, 1);
|
200
|
+
$color-invert: nth($pair, 2);
|
201
|
+
&.is-#{$name} {
|
202
|
+
&:checked {
|
203
|
+
+ label {
|
204
|
+
&::before,
|
205
|
+
&:before {
|
206
|
+
background: $color;
|
207
|
+
}
|
208
|
+
}
|
209
|
+
}
|
210
|
+
&.is-outlined {
|
211
|
+
&:checked {
|
212
|
+
+ label {
|
213
|
+
&::before,
|
214
|
+
&:before {
|
215
|
+
background-color: transparent;
|
216
|
+
border-color: $color !important;
|
217
|
+
}
|
218
|
+
&::after,
|
219
|
+
&:after {
|
220
|
+
background: $color;
|
221
|
+
}
|
222
|
+
}
|
223
|
+
}
|
224
|
+
}
|
225
|
+
&.is-thin {
|
226
|
+
&.is-outlined {
|
227
|
+
+ label {
|
228
|
+
&::after,
|
229
|
+
&:after {
|
230
|
+
box-shadow: none;
|
231
|
+
}
|
232
|
+
}
|
233
|
+
}
|
234
|
+
}
|
235
|
+
}
|
236
|
+
&.is-unchecked-#{$name} {
|
237
|
+
+ label {
|
238
|
+
&::before,
|
239
|
+
&:before {
|
240
|
+
background: $color;
|
241
|
+
}
|
242
|
+
}
|
243
|
+
|
244
|
+
&.is-outlined {
|
245
|
+
+ label {
|
246
|
+
&::before,
|
247
|
+
&:before {
|
248
|
+
background-color: transparent;
|
249
|
+
border-color: $color !important;
|
250
|
+
}
|
251
|
+
&::after,
|
252
|
+
&:after {
|
253
|
+
background: $color;
|
254
|
+
}
|
255
|
+
}
|
256
|
+
}
|
257
|
+
}
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
.field-body {
|
262
|
+
.switch[type="checkbox"] {
|
263
|
+
+ label {
|
264
|
+
margin-top: .375em;
|
265
|
+
}
|
266
|
+
}
|
267
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
input[type=file] {
|
2
|
+
border: none;
|
3
|
+
padding-left: 5px;
|
4
|
+
box-shadow: none;
|
5
|
+
}
|
6
|
+
|
7
|
+
input[type=file]::-webkit-file-upload-button {
|
8
|
+
height: 100%;
|
9
|
+
background: lightgray;
|
10
|
+
border: none;
|
11
|
+
}
|
12
|
+
|
13
|
+
.file-label {
|
14
|
+
height: 100%;
|
15
|
+
}
|
16
|
+
|
17
|
+
.file.is-boxed .file-cta {
|
18
|
+
height: 100%;
|
19
|
+
}
|
20
|
+
|
21
|
+
.file-name {
|
22
|
+
text-align: center;
|
23
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
.field {
|
2
|
+
&.has-addons {
|
3
|
+
a {
|
4
|
+
margin-right: .75rem;
|
5
|
+
}
|
6
|
+
&.has-addons-middle {
|
7
|
+
align-items: center;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
.is-flex {
|
12
|
+
align-items: center;
|
13
|
+
justify-content: space-around;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
.checkbox + .checkbox {
|
18
|
+
margin-left: .5em;
|
19
|
+
}
|
20
|
+
|
21
|
+
.radio + .radio.is-block {
|
22
|
+
margin-left: 0;
|
23
|
+
}
|
24
|
+
|
25
|
+
.checkbox,
|
26
|
+
.radio {
|
27
|
+
input + span, label {
|
28
|
+
padding-left: .25em;
|
29
|
+
}
|
30
|
+
}
|