spina-slider 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,68 @@
1
+ .extras {
2
+ margin-bottom: 10px;
3
+ }
4
+
5
+ .done {
6
+ display: none;
7
+ }
8
+
9
+ .slider-fields {
10
+ padding: 0px 10px 0px 10px;
11
+ display: flex;
12
+ flex-direction: column;
13
+ justify-content: center;
14
+ align-items: center;
15
+
16
+ ul.slider-todo {
17
+ margin: 5px;
18
+ background-color: rgb(240,240,240);
19
+ border: 0px rgb(100,100,100) solid;
20
+ border-radius: 10px;
21
+
22
+ li {
23
+ list-style-type: circle;
24
+ list-style-position: inside;
25
+ margin:10px;
26
+ font-size: 16px;
27
+ color: #6865b4;
28
+ }
29
+ }
30
+
31
+ .slider-preview {
32
+ width: 400px;
33
+ height: auto;
34
+ max-height: 400px;
35
+ padding: 5px;
36
+ margin: 10px 10px 10px 0px;
37
+ border: 1px rgb(100,100,100) solid;
38
+ border-radius: 10px;
39
+ background-color: rgb(240,240,240);
40
+ font-size: 10px;
41
+ overflow-y: scroll;
42
+
43
+ .image-slider {
44
+ font-weight: 700;
45
+ }
46
+ }
47
+
48
+ .slider-markup {
49
+ display: none;
50
+
51
+ .slider-show {
52
+ display: none;
53
+ }
54
+ }
55
+
56
+ .button-group {
57
+ margin-top: 10px;
58
+ }
59
+ }
60
+
61
+ .text-input{
62
+ figure{
63
+ &[data-trix-content-type=image-slider]{
64
+ max-height: 400px;
65
+ overflow: hidden;
66
+ }
67
+ }
68
+ }
@@ -0,0 +1,302 @@
1
+ // 20/20 Class Prefix
2
+ $pluginPrefix: "twentytwenty" !default;
3
+
4
+ // 20/20 Handle Styles
5
+ $twenty20-handle-color: #fff !default;
6
+ $twenty20-handle-stroke: 3px !default;
7
+ $twenty20-handle-circle-width: 38px !default;
8
+ $twenty20-handle-box-shadow: 0px 0px 12px rgba(#333,0.5) !default;
9
+ $twenty20-handle-triangle-color: $twenty20-handle-color !default;
10
+ $twenty20-handle-triangle-size: 6px !default;
11
+ $twenty20-handle-triangle-position: 5px !default;
12
+ $twenty20-handle-radius: 1000px !default;
13
+
14
+ // 20/20 Overlay Styles
15
+ $twenty20-overlay-bg: rgba(#000,0.5) !default;
16
+ $twenty20-overlay-label-color: #fff !default;
17
+ $twenty20-overlay-label-bg: rgba(#fff, .2) !default;
18
+ $twenty20-overlay-label-height: 38px !default;
19
+ $twenty20-overlay-label-width: 90px !default;
20
+ $twenty20-overlay-label-padding: 20px !default;
21
+ $twenty20-overlay-label-font-size: 13px !default;
22
+ $twenty20-overlay-label-letter-spacing: 0.1em !default;
23
+ $twenty20-label-radius: 2px !default;
24
+
25
+ // 20/20 Placeholders
26
+ %handle-content {
27
+ content: " ";
28
+ display: block;
29
+ background: $twenty20-handle-color;
30
+ position: absolute;
31
+ z-index: 30;
32
+ // @include box-shadow($twenty20-handle-box-shadow);
33
+ }
34
+
35
+ %handle-position-horizontal {
36
+ width: $twenty20-handle-stroke;
37
+ height: 9999px;
38
+ left: 50%;
39
+ margin-left: -($twenty20-handle-stroke / 2);
40
+ }
41
+
42
+ %handle-position-vertical {
43
+ width: 9999px;
44
+ height: $twenty20-handle-stroke;
45
+ top: 50%;
46
+ margin-top: -($twenty20-handle-stroke / 2);
47
+ }
48
+
49
+ %absolute-wh-position {
50
+ position: absolute;
51
+ top: 0;
52
+ width: 100%;
53
+ height: 100%;
54
+ }
55
+
56
+ %overlay-transition-duration {
57
+ transition-duration: 0.5s;
58
+ }
59
+
60
+ %label-transition-property {
61
+ transition-property: opacity;
62
+ }
63
+
64
+ %label-text {
65
+ color: $twenty20-overlay-label-color;
66
+ font-size: $twenty20-overlay-label-font-size;
67
+ letter-spacing: $twenty20-overlay-label-letter-spacing;
68
+ }
69
+
70
+ %label-structure {
71
+ position: absolute;
72
+ background: $twenty20-overlay-label-bg;
73
+ line-height: $twenty20-overlay-label-height;
74
+ padding: 0 $twenty20-overlay-label-padding;
75
+ border-radius: $twenty20-label-radius;
76
+ }
77
+
78
+ %label-position-horizontal {
79
+ top: 50%;
80
+ margin-top: -($twenty20-overlay-label-height / 2);
81
+ }
82
+
83
+ %label-position-vertical {
84
+ left: 50%;
85
+ margin-left: -($twenty20-overlay-label-width / 2);
86
+ text-align: center;
87
+ width: $twenty20-overlay-label-width;
88
+ }
89
+
90
+ %css-triangle {
91
+ width: 0;
92
+ height: 0;
93
+ border: $twenty20-handle-triangle-size inset transparent;
94
+ position: absolute;
95
+ }
96
+
97
+ %css-triangle-horizontal {
98
+ @extend %css-triangle;
99
+ top: 50%;
100
+ margin-top: -$twenty20-handle-triangle-size;
101
+ }
102
+
103
+ %css-triangle-vertical {
104
+ @extend %css-triangle;
105
+ left: 50%;
106
+ margin-left: -$twenty20-handle-triangle-size;
107
+ }
108
+
109
+ // 20/20 Container
110
+ .#{$pluginPrefix}-container {
111
+ box-sizing: content-box;
112
+ z-index: 0;
113
+ overflow: hidden;
114
+ position: relative;
115
+ -webkit-user-select: none;
116
+ -moz-user-select: none;
117
+
118
+ img {
119
+ max-width: 100%;
120
+ position: absolute;
121
+ top: 0;
122
+ display: block;
123
+ }
124
+
125
+ &.active .#{$pluginPrefix}-overlay,
126
+ &.active :hover.#{$pluginPrefix}-overlay { background: rgba(#000,0);
127
+
128
+ .#{$pluginPrefix}-before-label,
129
+ .#{$pluginPrefix}-after-label { opacity: 0; }
130
+ }
131
+ * {
132
+ box-sizing: content-box;
133
+ }
134
+ }
135
+
136
+ // 20/20 Before Label
137
+ .#{$pluginPrefix}-before-label {
138
+ @extend %absolute-wh-position;
139
+ @extend %label-transition-property;
140
+ @extend %overlay-transition-duration;
141
+ opacity: 0;
142
+
143
+ &:before {
144
+ @extend %label-structure;
145
+ @extend %label-text;
146
+ content: attr(data-content);
147
+ }
148
+ }
149
+
150
+ // 20/20 After Label
151
+ .#{$pluginPrefix}-after-label {
152
+ @extend %absolute-wh-position;
153
+ @extend %label-transition-property;
154
+ @extend %overlay-transition-duration;
155
+ opacity: 0;
156
+
157
+ &:before {
158
+ @extend %label-structure;
159
+ @extend %label-text;
160
+ content: attr(data-content);
161
+ }
162
+ }
163
+
164
+ // 20/20 Horizontal Labels
165
+ .#{$pluginPrefix}-horizontal .#{$pluginPrefix}-before-label {
166
+
167
+ &:before {
168
+ @extend %label-position-horizontal;
169
+ left: 10px;
170
+ }
171
+ }
172
+
173
+ .#{$pluginPrefix}-horizontal .#{$pluginPrefix}-after-label {
174
+
175
+ &:before {
176
+ @extend %label-position-horizontal;
177
+ right: 10px;
178
+ }
179
+ }
180
+
181
+ // 20/20 Vertical Labels
182
+ .#{$pluginPrefix}-vertical .#{$pluginPrefix}-before-label {
183
+
184
+ &:before {
185
+ @extend %label-position-vertical;
186
+ top: 10px;
187
+ }
188
+ }
189
+
190
+ .#{$pluginPrefix}-vertical .#{$pluginPrefix}-after-label {
191
+
192
+ &:before {
193
+ @extend %label-position-vertical;
194
+ bottom: 10px;
195
+ }
196
+ }
197
+
198
+ // 20/20 Overlay
199
+ .#{$pluginPrefix}-overlay {
200
+ @extend %absolute-wh-position;
201
+ @extend %overlay-transition-duration;
202
+ transition-property: background;
203
+ background: rgba(#000,0);
204
+ z-index: 25;
205
+
206
+ &:hover { background: $twenty20-overlay-bg;
207
+
208
+ .#{$pluginPrefix}-after-label { opacity: 1; }
209
+ .#{$pluginPrefix}-before-label { opacity: 1; }
210
+ }
211
+ }
212
+
213
+ .#{$pluginPrefix}-before { z-index: 20; }
214
+ .#{$pluginPrefix}-after { z-index: 10; }
215
+
216
+ // 20/20 Handle Styles
217
+ .#{$pluginPrefix}-handle {
218
+ height: $twenty20-handle-circle-width;
219
+ width: $twenty20-handle-circle-width;
220
+ position: absolute;
221
+ left: 50%;
222
+ top: 50%;
223
+ margin-left: -($twenty20-handle-circle-width/2) - $twenty20-handle-stroke;
224
+ margin-top: -($twenty20-handle-circle-width/2) - $twenty20-handle-stroke;
225
+ border: $twenty20-handle-stroke solid $twenty20-handle-color;
226
+ border-radius: $twenty20-handle-radius;
227
+ box-shadow: $twenty20-handle-box-shadow;
228
+ z-index: 40;
229
+ cursor: pointer;
230
+ }
231
+
232
+ // 20/20 Horizontal Handle Styles
233
+ .#{$pluginPrefix}-horizontal .#{$pluginPrefix}-handle {
234
+
235
+ &:before {
236
+ @extend %handle-content;
237
+ @extend %handle-position-horizontal;
238
+ bottom: 50%;
239
+ margin-bottom: ($twenty20-handle-circle-width/2) + $twenty20-handle-stroke;
240
+ box-shadow: 0 $twenty20-handle-stroke 0 $twenty20-handle-color, $twenty20-handle-box-shadow;
241
+ }
242
+
243
+ &:after {
244
+ @extend %handle-content;
245
+ @extend %handle-position-horizontal;
246
+ top: 50%;
247
+ margin-top: ($twenty20-handle-circle-width/2) + $twenty20-handle-stroke;
248
+ box-shadow: 0 (-$twenty20-handle-stroke) 0 $twenty20-handle-color, $twenty20-handle-box-shadow;
249
+ }
250
+ }
251
+
252
+ // 20/20 Vertical Handle Styles
253
+ .#{$pluginPrefix}-vertical .#{$pluginPrefix}-handle {
254
+
255
+ &:before {
256
+ @extend %handle-content;
257
+ @extend %handle-position-vertical;
258
+ left: 50%;
259
+ margin-left: ($twenty20-handle-circle-width/2) + $twenty20-handle-stroke;
260
+ box-shadow: $twenty20-handle-stroke 0 0 $twenty20-handle-color, $twenty20-handle-box-shadow;
261
+ }
262
+
263
+ &:after {
264
+ @extend %handle-content;
265
+ @extend %handle-position-vertical;
266
+ right: 50%;
267
+ margin-right: ($twenty20-handle-circle-width/2) + $twenty20-handle-stroke;
268
+ box-shadow: (-$twenty20-handle-stroke) 0 0 $twenty20-handle-color, $twenty20-handle-box-shadow;
269
+ }
270
+ }
271
+
272
+ // 20/20 Left Handle
273
+ .#{$pluginPrefix}-left-arrow {
274
+ border-right: $twenty20-handle-triangle-size solid $twenty20-handle-triangle-color;
275
+ left: 50%;
276
+ margin-left: -($twenty20-handle-triangle-size * 2) - $twenty20-handle-triangle-position;
277
+ @extend %css-triangle-horizontal;
278
+ }
279
+
280
+ // 20/20 Right Handle
281
+ .#{$pluginPrefix}-right-arrow {
282
+ border-left: $twenty20-handle-triangle-size solid $twenty20-handle-triangle-color;
283
+ right: 50%;
284
+ margin-right: -($twenty20-handle-triangle-size * 2) - $twenty20-handle-triangle-position;
285
+ @extend %css-triangle-horizontal;
286
+ }
287
+
288
+ // 20/20 Up Handle
289
+ .#{$pluginPrefix}-up-arrow {
290
+ border-bottom: $twenty20-handle-triangle-size solid $twenty20-handle-triangle-color;
291
+ top: 50%;
292
+ margin-top: -($twenty20-handle-triangle-size * 2) - $twenty20-handle-triangle-position;
293
+ @extend %css-triangle-vertical;
294
+ }
295
+
296
+ // 20/20 Down Handle
297
+ .#{$pluginPrefix}-down-arrow {
298
+ border-top: $twenty20-handle-triangle-size solid $twenty20-handle-triangle-color;
299
+ bottom: 50%;
300
+ margin-bottom: -($twenty20-handle-triangle-size * 2) - $twenty20-handle-triangle-position;
301
+ @extend %css-triangle-vertical;
302
+ }
@@ -0,0 +1,40 @@
1
+ !!!
2
+ %html{lang: I18n.locale}
3
+ %head
4
+ %meta{charset: 'utf-8'}
5
+ %meta{name: 'viewport', content: 'initial-scale=1.0'}
6
+ = csrf_meta_tags
7
+ %meta{name: 'turbolinks-cache-control', content: 'no-preview'}
8
+
9
+ %title Spina
10
+
11
+ / Stylesheet
12
+ = stylesheet_link_tag 'spina/admin/application', data: {turbolinks_track: true}
13
+ = stylesheet_link_tag 'twentytwenty-no-compass'
14
+ = stylesheet_link_tag 'slider'
15
+
16
+ /[if lt IE 9]
17
+ = javascript_include_tag '//html5shiv.googlecode.com/svn/trunk/html5.js', data: {turbolinks_track: true}
18
+
19
+ / JavaScript
20
+ = javascript_include_tag 'spina/admin/application', data: {turbolinks_track: true}
21
+ = javascript_include_tag 'slider'
22
+ = yield(:plugin_stylesheets)
23
+
24
+ / Plugins
25
+ - Spina::Plugin.all.each do |plugin|
26
+ - if current_theme.plugins.include? plugin.name
27
+ - if lookup_context.exists? "spina/admin/hooks/#{ plugin.namespace }/_head"
28
+ = render "spina/admin/hooks/#{ plugin.namespace }/head"
29
+ %body
30
+ = render 'spina/admin/shared/primary_navigation'
31
+
32
+ %section#main
33
+ = yield(:permanent_notice)
34
+
35
+ = render 'spina/admin/shared/notifications'
36
+
37
+ = content_for?(:application) ? yield(:application) : yield
38
+
39
+ = link_to 'http://www.spinacms.com', class: 'spina-logo', target: :blank do
40
+ = image_tag('spina/spina.svg', width: 32, height: 24)
@@ -0,0 +1,58 @@
1
+ .modal.modal-large
2
+ %section{style: "display: flex"}
3
+ .gallery-select-container{data: {controller: "gallery-select"}}
4
+ .gallery-select.gallery.gallery-prepend-image{data: {multiselect: defined?(multiple) && multiple}}
5
+ .item.item-small.item-uploader.new-image-form
6
+ = render partial: 'spina/admin/images/form'
7
+ - if @media_folder.present?
8
+ = link_to spina.admin_media_picker_path(request.query_parameters.merge(media_folder_id: nil)), class: 'item media-folder', data: {remote: true} do
9
+ .media-folder-thumbnail
10
+ = image_tag 'spina/media_folder_placeholder.svg'
11
+ .media-folder-shadow
12
+ .media-folder-name=t "spina.images.back"
13
+ - else
14
+ - @media_folders.each do |media_folder|
15
+ = link_to spina.admin_media_picker_path({media_folder_id: media_folder.id}.merge(request.query_parameters)), class: 'item media-folder', data: {remote: true} do
16
+ .media-folder-thumbnail{data: {badge: media_folder.images.count}}
17
+ - if media_folder.images.any?
18
+ = image_tag variant(media_folder.images.last.file, resize: '144x144^', crop: "144x144+0+0")
19
+ - else
20
+ = image_tag 'spina/media_folder_placeholder.svg'
21
+ .media-folder-shadow
22
+ .media-folder-name= media_folder.name
23
+ .infinite-scroll
24
+ = render partial: 'spina/admin/images/image', collection: @images
25
+ .infinite-pagination{data: { controller: 'infinite-scroll' } }
26
+ = link_to_next_page @images, 'Next', params: params, remote: true,
27
+ data: { target: 'infinite-scroll.link' }
28
+ %span{ data: { target: 'infinite-scroll.link' } }
29
+ .gallery-select-sidebar
30
+ = form_with url: admin_media_picker_path, html: {'data-remote': true} do
31
+ .gallery-select-form-fields
32
+ = hidden_field_tag :image_id, params[:selected_ids]&.first, data: {target: 'gallery-select.singleImage'}
33
+ = hidden_field_tag :image_ids, params[:selected_ids]&.join("-"), data: {target: 'gallery-select.multipleImages'}
34
+ = hidden_field_tag :hidden_field_id, params[:hidden_field_id]
35
+ = hidden_field_tag :trix_toolbar_id, params[:trix_toolbar_id]
36
+ = hidden_field_tag :slider, params[:slider]
37
+ = check_box_tag :multiple, true, defined?(multiple) && multiple, style: 'display: none', data: {target: 'gallery-select.multiple'}
38
+ - if params[:trix_toolbar_id].present?
39
+ .form-group
40
+ .form-label Alt text
41
+ .form-control= text_field_tag :alt, nil, placeholder: "Alt"
42
+ .form-group
43
+ .form-label Link to URL
44
+ .form-control= text_field_tag :link_to_url, nil, placeholder: "URL"
45
+ .gallery-select-action-bar
46
+ = link_to t('spina.cancel'), "#", class: 'button button-link', data: {dismiss: 'modal'}
47
+ = button_tag type: 'submit', class: 'button button-primary button-large', style: 'margin-bottom: 0px' do
48
+
49
+ - if defined?(multiple) && multiple
50
+ = icon('plus')
51
+ = t('spina.images.choose_images')
52
+ %span.gallery-select-counter{data: {target: "gallery-select.counter"}}
53
+ - if params[:selected_ids].try(:any?)
54
+ (#{ params[:selected_ids].count })
55
+ - else
56
+ = icon('check')
57
+ =t 'spina.images.choose_image'
58
+