@total_onion/onion-library 2.0.98 → 2.0.100

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.
@@ -63,7 +63,7 @@ function scrollingbannerJs(block) {
63
63
  const inner = bannerElement.querySelector(
64
64
  '.scrolling-banner-v3__inner'
65
65
  );
66
- const speed = bannerElement.dataset.speed ?? 5;
66
+ const speed = bannerElement.dataset.speed ?? 3;
67
67
 
68
68
  const wrapperWidth = wrapper.clientWidth;
69
69
  const innerContentWidth = inner.clientWidth;
@@ -82,28 +82,34 @@ function scrollingbannerJs(block) {
82
82
  newTickerContainer.classList.add('clone');
83
83
  wrapper.appendChild(newTickerContainer);
84
84
 
85
- const animation = [
86
- {transform: `translateX(0%)`},
87
- {transform: `translateX(-200%)`}
85
+ const animation1 = [
86
+ { transform: 'translateX(0%)' },
87
+ { transform: 'translateX(-100%)' }
88
+ ];
89
+ const animation2 = [
90
+ { transform: 'translateX(100%)' },
91
+ { transform: 'translateX(0%)' }
88
92
  ];
89
93
 
90
94
  const time = 100000 / speed;
91
95
 
92
96
  let timing = {
93
97
  duration: time,
94
- iterations: Infinity
95
- };
96
- let timing2 = {
97
- duration: time,
98
- delay: time / 2,
99
- iterations: Infinity
98
+ iterations: Infinity,
99
+ fill: 'both'
100
100
  };
101
+ let timing2 = timing;
101
102
  const containers = bannerElement.querySelectorAll(
102
103
  '.scrolling-banner-v3__container'
103
104
  );
104
-
105
- const anim1 = containers[0].animate(animation, timing);
106
- const anim2 = containers[1].animate(animation, timing2);
105
+ // Ensure initial positions are applied so content is visible immediately
106
+ containers[0].style.transform = 'translateX(0%)';
107
+ containers[1].style.transform = 'translateX(100%)';
108
+ // Force style application before animations start
109
+ void containers[0].offsetWidth;
110
+
111
+ const anim1 = containers[0].animate(animation1, timing);
112
+ const anim2 = containers[1].animate(animation2, timing2);
107
113
 
108
114
  // set as initialized and store animation for a possible cleanup
109
115
  initializedBanners.set(bannerElement, {anim1, anim2});
@@ -8,7 +8,7 @@
8
8
  grid-area: var(--image-grid-area, main);
9
9
  position: var(--image-position, relative);
10
10
  inset: 0;
11
- min-height: 100%;
11
+ min-height: 0;
12
12
  display: flex;
13
13
  z-index: var(--image-z-index);
14
14
  border: core-functions-v3.fluidSize(var(--image-border-width), 'static')
package/createNewBlock.js CHANGED
@@ -1,6 +1,6 @@
1
1
  require('dotenv').config();
2
2
  const fs = require('fs');
3
- const { globSync } = require('glob');
3
+ const {globSync} = require('glob');
4
4
  const yargs = require('yargs');
5
5
  const {exec} = require('child_process');
6
6
  const swiperTemplates = require('./new-block-templates/template-swiper');
@@ -55,13 +55,14 @@ templateOptions.forEach((option) => {
55
55
  }
56
56
  });
57
57
 
58
- const dynamicEntryPoints = globSync(`${themePath}/assets/js/blocks/*.js`)
59
- .map((path) => {
58
+ const dynamicEntryPoints = globSync(`${themePath}/assets/js/blocks/*.js`).map(
59
+ (path) => {
60
60
  const assetKey = path
61
61
  .replace('assets/js/blocks/', '')
62
62
  .replace('.js', '');
63
63
  return assetKey;
64
- });
64
+ }
65
+ );
65
66
  const newBlockName = process.argv[2]?.toLowerCase();
66
67
  const blockType = process.argv[3];
67
68
 
@@ -126,10 +127,7 @@ fs.writeFileSync(
126
127
  if (!fs.existsSync(`${themePath}/assets/scss/blocks/${newBlockName}`)) {
127
128
  fs.mkdirSync(`${themePath}/assets/scss/blocks/${newBlockName}`);
128
129
  }
129
- fs.writeFileSync(
130
- `${themePath}/assets/scss/blocks/${newBlockName}/${newBlockName}-extra.scss`,
131
- defaultTemplates.defaultextrascss(newBlockName)
132
- );
130
+
133
131
  fs.writeFileSync(
134
132
  `${themePath}/views/blocks/${newBlockName}.twig`,
135
133
  templateData
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@total_onion/onion-library",
3
- "version": "2.0.98",
3
+ "version": "2.0.100",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,7 +9,7 @@
9
9
  right: 0;
10
10
  bottom: 0;
11
11
  left: 0;
12
- min-height: 100%;
12
+ min-height: 0;
13
13
  display: flex;
14
14
  z-index: var(--image-z-index);
15
15
  border: calc(var(--image-border-width) / var(--desktop-design-reference) * var(--screen-width-static)) var(--image-border-style) var(--image-border-colour);
@@ -1,3 +1,7 @@
1
+ .social-networks-v3 {
2
+ display: flex;
3
+ gap: 10px;
4
+ }
1
5
  .social-networks-v3 .component-social-networks-v3 {
2
6
  display: flex;
3
7
  width: 100%;
@@ -107,7 +107,19 @@
107
107
  clip-path: polygon(0 100%, 100% 100%, 100% 0, 0 0);
108
108
  }
109
109
  }
110
- .sub-group-container-v3 .cmpl-block-animations.loaded {
110
+ @keyframes reveal-up-and-slide {
111
+ from {
112
+ opacity: 1;
113
+ transition: -100%;
114
+ clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0% 100%);
115
+ }
116
+ 100% {
117
+ opacity: 1;
118
+ transition: 0%;
119
+ clip-path: polygon(0 100%, 100% 100%, 100% 0, 0 0);
120
+ }
121
+ }
122
+ .sub-group-container-v3 .cmpl-block-animations.trigger-animation {
111
123
  animation: var(--animation-name) var(--animation-duration) var(--animation-delay) var(--animation-easing) var(--animation-repeat) var(--animation-fill-mode) var(--animation-direction);
112
124
  animation-timeline: var(--animation-timeline);
113
125
  }