Skip to content

Commit

Permalink
NBBIB-414 Prototype implementation no-module with siema.js
Browse files Browse the repository at this point in the history
  • Loading branch information
camilocodes committed May 29, 2024
1 parent 7425507 commit 95799e3
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 77 deletions.
3 changes: 2 additions & 1 deletion build/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
"package": {
"dist": {
"type": "zip",
"url": "https://github.com/pawelgrzybek/siema/releases/tag/v1.5.1"
"url": "https://github.com/pawelgrzybek/siema/archive/refs/tags/v1.5.1.zip"
},
"name": "pawelgrzybek/siema",
"type": "drupal-library",
Expand Down Expand Up @@ -225,6 +225,7 @@
"harvesthq/chosen": "^1",
"malsup/jquery.cycle": "^1",
"oomphinc/composer-installers-extender": "^2",
"pawelgrzybek/siema": "1.5.1",
"simeydotme/jquery-ui-slider-pips": "^1",
"unb-libraries/composer-drupal-scaffold": "^10",
"unb-libraries/saml_features": "dev-10.x-1.x"
Expand Down
78 changes: 2 additions & 76 deletions configuration/views.view.nbbib_slideshow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- image
- node
- user
- views_slideshow
id: nbbib_slideshow
label: 'NBBIB Slideshow'
module: views
Expand Down Expand Up @@ -159,84 +158,11 @@ display:
value:
nbbib_slide: nbbib_slide
style:
type: slideshow
type: default
options:
grouping: { }
row_class: d-inline-block
default_row_class: true
slideshow_skin: default
slideshow_type: views_slideshow_cycle
widgets:
top:
views_slideshow_controls:
enable: false
weight: '1'
hide_on_single_slide: '0'
type: views_slideshow_controls_text
views_slideshow_slide_counter:
enable: false
weight: '1'
hide_on_single_slide: '0'
views_slideshow_pager:
enable: false
weight: '1'
hide_on_single_slide: '0'
type: views_slideshow_pager_fields
views_slideshow_pager_fields:
views_slideshow_pager_fields_fields:
field_image: 0
views_slideshow_pager_fields_hover: 0
views_slideshow_pager_bullets:
views_slideshow_pager_bullets_hover: 0
bottom:
views_slideshow_controls:
enable: false
weight: '1'
hide_on_single_slide: '0'
type: views_slideshow_controls_text
views_slideshow_slide_counter:
enable: false
weight: '1'
hide_on_single_slide: '0'
views_slideshow_pager:
enable: false
weight: '1'
hide_on_single_slide: '0'
type: views_slideshow_pager_fields
views_slideshow_pager_fields:
views_slideshow_pager_fields_fields:
field_image: 0
views_slideshow_pager_fields_hover: 0
views_slideshow_pager_bullets:
views_slideshow_pager_bullets_hover: 0
views_slideshow_cycle:
effect: scrollLeft
transition_advanced: 1
timeout: '0'
speed: '40000'
delay: '-40000'
sync: 1
random: 0
pause: 0
pause_on_click: 1
action_advanced: 1
start_paused: 0
remember_slide: 0
remember_slide_days: '1'
pause_when_hidden: 0
pause_when_hidden_type: full
amount_allowed_visible: ''
nowrap: 1
fixed_height: 0
items_per_slide: '6'
items_per_slide_first: 0
items_per_slide_first_number: '1'
wait_for_image_load: 1
wait_for_image_load_timeout: ''
cleartype: 0
cleartypenobg: 0
advanced_options_choices: '0'
advanced_options_entry: ''
advanced_options: '{"continuous":"TRUE"}'
row:
type: fields
options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ global-styling:
global-scripts:
js:
dist/js/fancy-text-box.js: {}
dist/js/slideshow.js: {}
/libraries/siema/dist/siema.min.js: {}
dependencies:
- core/drupal
- core/jquery
Expand Down
21 changes: 21 additions & 0 deletions custom/themes/bs5_nbbib_lib_unb_ca/src/js/slideshow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(function($) {
'use strict';

Drupal.behaviors.slideshow = {
attach: function (context, settings) {
$(document).ready( function() {
const mySiema = new Siema({
duration: 10000,
loop: true,
easing: 'linear',
perPage: 6,
});

// listen for keydown event
mySiema.next();0
setInterval(() => mySiema.next(), 10000)
});
},
};
})(jQuery);

Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@
{% if count == 1 %}
<div class="view-content">
{% else %}
{% if id == 'nbbib_slideshow' %}
<div class="view-content multicol siema">
{% else %}
<div class="view-content multicol">
{% endif %}
{% endif %}
{{ rows }}
</div>
Expand Down

0 comments on commit 95799e3

Please sign in to comment.