rails_design 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/README.md +18 -0
  4. data/Rakefile +18 -0
  5. data/app/assets/images/image-square.png +0 -0
  6. data/app/assets/images/logo.png +0 -0
  7. data/app/assets/javascripts/default_form/datetime.js +31 -0
  8. data/app/assets/javascripts/default_form/default_valid.js +101 -0
  9. data/app/assets/javascripts/default_form/field.js +33 -0
  10. data/app/assets/javascripts/default_form/index.js +9 -0
  11. data/app/assets/javascripts/default_form/valid_weui.js +17 -0
  12. data/app/assets/javascripts/rails_design/attachment.js +295 -0
  13. data/app/assets/javascripts/rails_design/cable.js +3 -0
  14. data/app/assets/javascripts/rails_design/dataset.js +39 -0
  15. data/app/assets/javascripts/rails_design/index.js +4 -0
  16. data/app/assets/javascripts/rails_design/stimulus.js +19 -0
  17. data/app/assets/javascripts/rails_design/turbo.js +35 -0
  18. data/app/assets/javascripts/stimulus_com/checkbox.js +77 -0
  19. data/app/assets/javascripts/stimulus_com/choice.js +18 -0
  20. data/app/assets/javascripts/stimulus_com/common.js +52 -0
  21. data/app/assets/javascripts/stimulus_com/count_down.js +27 -0
  22. data/app/assets/javascripts/stimulus_com/former.js +26 -0
  23. data/app/assets/javascripts/stimulus_com/hover.js +40 -0
  24. data/app/assets/javascripts/stimulus_com/index.js +58 -0
  25. data/app/assets/javascripts/stimulus_com/input.js +36 -0
  26. data/app/assets/javascripts/stimulus_com/menu.js +34 -0
  27. data/app/assets/javascripts/stimulus_com/modal.js +85 -0
  28. data/app/assets/javascripts/stimulus_com/modal_show.js +16 -0
  29. data/app/assets/javascripts/stimulus_com/navbar.js +11 -0
  30. data/app/assets/javascripts/stimulus_com/notice.js +10 -0
  31. data/app/assets/javascripts/stimulus_com/picture.js +85 -0
  32. data/app/assets/javascripts/stimulus_com/show.js +26 -0
  33. data/app/assets/javascripts/stimulus_com/showcase.js +34 -0
  34. data/app/assets/javascripts/stimulus_com/slide.js +188 -0
  35. data/app/assets/javascripts/stimulus_com/slide_y.js +189 -0
  36. data/app/assets/javascripts/stimulus_com/sortable.js +41 -0
  37. data/app/assets/javascripts/stimulus_com/sticky.js +11 -0
  38. data/app/assets/javascripts/stimulus_com/swipe.js +78 -0
  39. data/app/assets/javascripts/stimulus_com/taxon.js +45 -0
  40. data/app/assets/javascripts/stimulus_com/time.js +19 -0
  41. data/app/assets/javascripts/stimulus_com/touch.js +83 -0
  42. data/app/assets/javascripts/stimulus_com/tree.js +34 -0
  43. data/app/assets/javascripts/stimulus_com/tree_remote.js +64 -0
  44. data/app/assets/javascripts/stimulus_com/typer.js +41 -0
  45. data/app/assets/javascripts/stimulus_com/visit.js +61 -0
  46. data/app/assets/javascripts/stimulus_phone/index.js +19 -0
  47. data/app/assets/javascripts/stimulus_phone/qq_map.js +29 -0
  48. data/app/assets/javascripts/stimulus_phone/search.js +37 -0
  49. data/app/assets/javascripts/stimulus_phone/wechat.js +80 -0
  50. data/app/assets/javascripts/stimulus_phone/weui-actionsheet.js +43 -0
  51. data/app/assets/javascripts/stimulus_phone/weui-datepicker.js +38 -0
  52. data/app/assets/javascripts/stimulus_phone/weui-dialog.js +24 -0
  53. data/app/assets/javascripts/stimulus_phone/weui-picker.js +54 -0
  54. data/app/assets/javascripts/stimulus_phone/wxpay.js +29 -0
  55. data/app/assets/stylesheets/app.scss +3 -0
  56. data/app/assets/stylesheets/ext_bulma/base/_all.scss +5 -0
  57. data/app/assets/stylesheets/ext_bulma/base/_choices.scss +3 -0
  58. data/app/assets/stylesheets/ext_bulma/base/_global.scss +19 -0
  59. data/app/assets/stylesheets/ext_bulma/base/_main.scss +15 -0
  60. data/app/assets/stylesheets/ext_bulma/components/_all.scss +10 -0
  61. data/app/assets/stylesheets/ext_bulma/components/_box.scss +15 -0
  62. data/app/assets/stylesheets/ext_bulma/components/_breadcrumb.scss +17 -0
  63. data/app/assets/stylesheets/ext_bulma/components/_card.scss +12 -0
  64. data/app/assets/stylesheets/ext_bulma/components/_level.scss +8 -0
  65. data/app/assets/stylesheets/ext_bulma/components/_media.scss +14 -0
  66. data/app/assets/stylesheets/ext_bulma/components/_menu.scss +76 -0
  67. data/app/assets/stylesheets/ext_bulma/components/_pagination.scss +9 -0
  68. data/app/assets/stylesheets/ext_bulma/components/_panel.scss +5 -0
  69. data/app/assets/stylesheets/ext_bulma/elements/_all.scss +7 -0
  70. data/app/assets/stylesheets/ext_bulma/elements/_button.scss +14 -0
  71. data/app/assets/stylesheets/ext_bulma/elements/_fa.scss +4 -0
  72. data/app/assets/stylesheets/ext_bulma/elements/_image.scss +38 -0
  73. data/app/assets/stylesheets/ext_bulma/elements/_table.scss +52 -0
  74. data/app/assets/stylesheets/ext_bulma/elements/_title.scss +9 -0
  75. data/app/assets/stylesheets/ext_bulma/expand/_all.scss +2 -0
  76. data/app/assets/stylesheets/ext_bulma/expand/_slide.scss +26 -0
  77. data/app/assets/stylesheets/ext_bulma/expand/_sortable.scss +4 -0
  78. data/app/assets/stylesheets/ext_bulma/form/_all.scss +34 -0
  79. data/app/assets/stylesheets/ext_bulma/form/_checkbox.scss +267 -0
  80. data/app/assets/stylesheets/ext_bulma/form/_file.scss +23 -0
  81. data/app/assets/stylesheets/ext_bulma/form/_select.scss +5 -0
  82. data/app/assets/stylesheets/ext_bulma/form/_tools.scss +30 -0
  83. data/app/assets/stylesheets/ext_bulma/grid/_all.scss +3 -0
  84. data/app/assets/stylesheets/ext_bulma/grid/_columns.scss +13 -0
  85. data/app/assets/stylesheets/ext_bulma/helpers/_all.scss +5 -0
  86. data/app/assets/stylesheets/ext_bulma/helpers/_dot.scss +11 -0
  87. data/app/assets/stylesheets/ext_bulma/helpers/_drawable.scss +3 -0
  88. data/app/assets/stylesheets/ext_bulma/helpers/_grid.scss +10 -0
  89. data/app/assets/stylesheets/ext_bulma/index.scss +22 -0
  90. data/app/assets/stylesheets/ext_bulma/layout/_all.scss +4 -0
  91. data/app/assets/stylesheets/ext_bulma/layout/_footer.scss +4 -0
  92. data/app/assets/stylesheets/ext_bulma/layout/_level.scss +1 -0
  93. data/app/assets/stylesheets/ext_choices/index.scss +16 -0
  94. data/app/assets/stylesheets/ext_font/index.scss +4 -0
  95. data/app/assets/stylesheets/ext_weui/index.scss +24 -0
  96. data/app/assets/stylesheets/ext_weui/widget/_actionsheet.scss +3 -0
  97. data/app/assets/stylesheets/ext_weui/widget/_article.scss +7 -0
  98. data/app/assets/stylesheets/ext_weui/widget/_button.scss +7 -0
  99. data/app/assets/stylesheets/ext_weui/widget/_cell.scss +17 -0
  100. data/app/assets/stylesheets/ext_weui/widget/_form.scss +3 -0
  101. data/app/assets/stylesheets/ext_weui/widget/_half_screen_dialog.scss +10 -0
  102. data/app/assets/stylesheets/ext_weui/widget/_icon.scss +9 -0
  103. data/app/assets/stylesheets/ext_weui/widget/_media.scss +43 -0
  104. data/app/assets/stylesheets/ext_weui/widget/_panel.scss +4 -0
  105. data/app/assets/stylesheets/ext_weui/widget/_preview.scss +5 -0
  106. data/app/assets/stylesheets/ext_weui/widget/_search.scss +5 -0
  107. data/app/assets/stylesheets/ext_weui/widget/_tab.scss +10 -0
  108. data/app/assets/stylesheets/ext_weui/widget/_tabbar.scss +12 -0
  109. data/app/assets/stylesheets/ext_weui/widget/_uploader.scss +14 -0
  110. data/app/assets/stylesheets/phone.scss +6 -0
  111. data/app/assets/stylesheets/slide/index.scss +208 -0
  112. data/app/assets/stylesheets/ui_tooltip/_mixins.scss +46 -0
  113. data/app/assets/stylesheets/ui_tooltip/_variables.scss +5 -0
  114. data/app/assets/stylesheets/ui_tooltip/index.scss +278 -0
  115. data/app/controllers/design/base_controller.rb +4 -0
  116. data/app/controllers/design/home_controller.rb +13 -0
  117. data/app/views/design/home/swipe.html.erb +7 -0
  118. data/app/views/layouts/ui/base.html.erb +5 -0
  119. data/config/routes.rb +11 -0
  120. data/lib/rails_design/config.rb +8 -0
  121. data/lib/rails_design/engine.rb +5 -0
  122. data/lib/rails_design.rb +2 -0
  123. metadata +181 -0
@@ -0,0 +1,9 @@
1
+ .title-edit {
2
+ font-size: 1rem;
3
+ font-weight: normal;
4
+ color: $grey-light;
5
+ }
6
+
7
+ .title-edit:hover {
8
+ color: $grey;
9
+ }
@@ -0,0 +1,2 @@
1
+ @import 'slide';
2
+ @import 'sortable';
@@ -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,4 @@
1
+ .sortable-ghost {
2
+ opacity: .2;
3
+ background-color: red !important;
4
+ }
@@ -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,5 @@
1
+ .select {
2
+ select {
3
+ display: inline-flex;
4
+ }
5
+ }
@@ -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
+ }
@@ -0,0 +1,3 @@
1
+ @charset "utf-8";
2
+
3
+ @import 'columns';
@@ -0,0 +1,13 @@
1
+ main.columns {
2
+ margin: 0;
3
+ }
4
+
5
+ main.columns:not(:last-child) {
6
+ margin-bottom: 0;
7
+ }
8
+
9
+ main.columns.container {
10
+ margin-left: auto;
11
+ margin-right: auto;
12
+ width: 100%;
13
+ }
@@ -0,0 +1,5 @@
1
+ @charset "utf-8";
2
+
3
+ @import 'dot';
4
+ @import 'drawable';
5
+ @import 'grid';
@@ -0,0 +1,11 @@
1
+ .has-dot-success:before {
2
+ content: '•';
3
+ color: #48c78e;
4
+ padding-right: 5px;
5
+ }
6
+
7
+ .has-dot-danger:before {
8
+ content: '•';
9
+ color: #f14668;
10
+ padding-right: 5px;
11
+ }