@widelab-nc/widelab 1.0.4 → 1.0.5
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.
- package/dist/index.js +3 -124
- package/dist/index.js.map +4 -4
- package/dist/style.css +1 -0
- package/package.json +15 -18
- package/src/index.js +8 -232
package/dist/style.css
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
html.lenis{height:auto}.hero_headline.is-cta{text-wrap:balance}#homeHeroHeading{pointer-events:none}.hero_headline-span{pointer-events:auto;z-index:-1}.hero-line-mask:first-of-type{z-index:2}.hero_headline-span{aspect-ratio:65/23}.clients_collection_item_wrapper{aspect-ratio:1/1}.start_diagram_step_path-mask{aspect-ratio:2/1}.splide__track{overflow:visible}.splide__pagination__page.reviews-page,.splide__pagination__page.facts-page{height:.625rem;width:.625rem;background:#b2b2b2;opacity:.5;margin:.25rem}.splide__pagination__page.reviews-page.is-active,.splide__pagination__page.facts-page.is-active{height:.625rem;width:.625rem;background:#000;opacity:1;transform:none}.footer_logo-svg{aspect-ratio:1286/185}address{font-style:normal}.bottom-wrapper_footer-spacer,.whats-next_links_item_image-wrapper,.reel-modal_player{pointer-events:none}.skills_item_hover-track.is-design{white-space:nowrap;will-change:transform;animation:marquee-horizontal 12s linear infinite}.skills_item_hover-track.is-branding,.skills_item_hover-track.is-nocode{white-space:nowrap;will-change:transform;animation:marquee-horizontal 5s linear infinite}@keyframes marquee-horizontal{0%{transform:translate(0)}to{transform:translate(-50%)}}.splide__pagination.facts-pagination{padding:0;align-items:start;justify-content:left}.hero-line-mask,.stats-line-mask,.facts-line-mask,.cs-line-mask{clip-path:polygon(0 0,100% 0,100% 110%,0 110%)}@media only screen and (min-width: 992px){#csSingleFooter{position:static}#csItemTransformWrapper,#csItemNotTransformWrapper{padding-left:2.5rem;padding-right:2.5rem}.portfolio_item_image-wrapper.is-portrait{aspect-ratio:31/32}.portfolio_item_image-wrapper{aspect-ratio:4/3}.portfolio_wrapper.is-2-col>.portfolio_item:first-child .portfolio_item_content,.portfolio_item.is-1-left .portfolio_item_content{padding-left:2.5rem}.splide__pagination.reviews-pagination{bottom:-3.625rem}.splide__pagination.facts-pagination{bottom:2.25rem;left:0;right:0}#stickyNavbar{padding:1rem 2.5rem}.button_small .link,.portfolio_item .is-p-l.is-link,.cookies-button{position:relative;text-decoration:none;background-image:linear-gradient(currentColor,currentColor);background-position:0 100%;background-repeat:no-repeat;background-size:100% .08em;transition:background-size .2s cubic-bezier(.65,0,.35,1)}.button_small:hover .link,.button_small:focus .link,.portfolio_item:hover .is-p-l.is-link,.portfolio_item:active .is-p-l.is-link,.cookies-button:hover,.cookies-button:active{background-size:0% .08em}.button_small .button_small_icon_circle,.cta_link .cta_link_icon-wrapper{position:relative}.button_small .button_small_icon_circle:after,.cta_link .cta_link_icon-wrapper:after{background-color:inherit;border-radius:50%;content:"";position:absolute;inset:0;z-index:-1;transition:.3s cubic-bezier(.83,0,.17,1)}.button_small:hover .button_small_icon_circle:after,.cta_link:hover .cta_link_icon-wrapper:after{scale:1.2}.navbar_menu_link,.footer_menu_link,.is-link,.cta_link .is-h4{position:relative;text-decoration:none;background-image:linear-gradient(currentColor,currentColor);background-position:0 100%;background-repeat:no-repeat;background-size:0% .08em;transition:background-size .2s cubic-bezier(.65,0,.35,1)}.navbar_menu_link:hover,.navbar_menu_link:focus,.footer_menu_link:hover,.footer_menu_link:focus,.is-link:hover,.is-link_link:focus,.cta_link:hover .is-h4,.cta_link:focus .is-h4{background-size:100% .08em}}@media only screen and (max-width: 1180px) and (min-width: 992px){.stats-content_wrapper{padding-right:4vw}}@media only screen and (max-width: 1280px) and (min-width: 992px){.section.is-cs-2col{padding-left:2.5rem;padding-right:2.5rem}}@media only screen and (max-width: 991px){.navbar .button_small .button_small_icon_circle{display:none}#csItemTransformWrapper{padding-left:1.75rem;padding-right:1.75rem}.portfolio_item_image-wrapper{aspect-ratio:6/5}.button_small .link,.portfolio_item .is-p-l.is-link,.cta_link.is-mobile-nav .is-p-l,.cookies-button{position:relative;text-decoration:none;background-image:linear-gradient(currentColor,currentColor);background-position:0 100%;background-repeat:no-repeat;background-size:100% .08em}.splide__pagination.reviews-pagination{bottom:-3.5rem}.splide__pagination.facts-pagination{top:15.25rem;left:0;right:0}.splide__list.team_collection_list{overflow:visible}}@media only screen and (max-width: 767px){#csItemTransformWrapper{padding-left:1.375rem;padding-right:1.375rem}.reel_prev_mask{aspect-ratio:19/22}.splide__pagination.facts-pagination{top:13.5rem;left:0;right:0}.portfolio_item_image-wrapper{aspect-ratio:95/79}.splide__pagination.reviews-pagination{bottom:-3rem}}.background-video{height:100%;position:relative;overflow:hidden}.background-video>video{width:100%;height:100%;object-fit:cover;z-index:-100;background-position:50%;background-size:cover;margin:auto;position:absolute;inset:-100%}.background-video>video::-webkit-media-controls-start-playback-button{-webkit-appearance:none;display:none!important}.background-video--control{background-color:#0000;padding:0;position:absolute;bottom:1em;right:1em}.background-video--control>[hidden]{display:none!important}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@widelab-nc/widelab",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Widelab starter template based on Finsweet template + add-ons.",
|
|
5
5
|
"homepage": "https://widelab.co",
|
|
6
6
|
"license": "ISC",
|
|
@@ -19,6 +19,18 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "cross-env NODE_ENV=development node ./bin/build.js",
|
|
24
|
+
"build": "cross-env NODE_ENV=production node ./bin/build.js",
|
|
25
|
+
"lint": "eslint --ignore-path .gitignore ./src && prettier --check ./src",
|
|
26
|
+
"lint:fix": "eslint --ignore-path .gitignore ./src --fix",
|
|
27
|
+
"check": "tsc --noEmit",
|
|
28
|
+
"format": "prettier --write ./src",
|
|
29
|
+
"test": "pnpm playwright test",
|
|
30
|
+
"test:headed": "pnpm playwright test --headed",
|
|
31
|
+
"release": "changeset publish",
|
|
32
|
+
"update": "pnpm update -i -L -r"
|
|
33
|
+
},
|
|
22
34
|
"devDependencies": {
|
|
23
35
|
"@changesets/changelog-git": "^0.1.14",
|
|
24
36
|
"@changesets/cli": "^2.26.0",
|
|
@@ -38,22 +50,7 @@
|
|
|
38
50
|
"typescript": "^4.9.5"
|
|
39
51
|
},
|
|
40
52
|
"dependencies": {
|
|
41
|
-
"@splidejs/splide": "^4.1.4",
|
|
42
|
-
"@studio-freight/lenis": "^1.0.25",
|
|
43
53
|
"alpinejs": "^3.13.0",
|
|
44
|
-
"gsap": "npm:@gsap/business@^3.12.2"
|
|
45
|
-
"lozad": "^1.16.0"
|
|
46
|
-
},
|
|
47
|
-
"scripts": {
|
|
48
|
-
"dev": "cross-env NODE_ENV=development node ./bin/build.js",
|
|
49
|
-
"build": "cross-env NODE_ENV=production node ./bin/build.js",
|
|
50
|
-
"lint": "eslint --ignore-path .gitignore ./src && prettier --check ./src",
|
|
51
|
-
"lint:fix": "eslint --ignore-path .gitignore ./src --fix",
|
|
52
|
-
"check": "tsc --noEmit",
|
|
53
|
-
"format": "prettier --write ./src",
|
|
54
|
-
"test": "pnpm playwright test",
|
|
55
|
-
"test:headed": "pnpm playwright test --headed",
|
|
56
|
-
"release": "changeset publish",
|
|
57
|
-
"update": "pnpm update -i -L -r"
|
|
54
|
+
"gsap": "npm:@gsap/business@^3.12.2"
|
|
58
55
|
}
|
|
59
|
-
}
|
|
56
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,227 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import Lenis from '@studio-freight/lenis';
|
|
3
|
-
import { gsap } from 'gsap';
|
|
4
|
-
import { CustomEase } from 'gsap/CustomEase';
|
|
5
|
-
import { ScrollToPlugin } from 'gsap/ScrollToPlugin';
|
|
6
|
-
import { ScrollTrigger } from 'gsap/ScrollTrigger';
|
|
7
|
-
import { SplitText } from 'gsap/SplitText';
|
|
8
|
-
import lozad from 'lozad';
|
|
9
|
-
import Splide from '@splidejs/splide';
|
|
10
|
-
import { DrawSVGPlugin } from 'gsap/DrawSVGPlugin';
|
|
1
|
+
import {initAlpine} from "./init";
|
|
11
2
|
|
|
12
|
-
//
|
|
13
|
-
|
|
3
|
+
// Before you start:
|
|
4
|
+
// 1. Change name and URL in package.json file
|
|
5
|
+
// 2. Build and release to npm
|
|
6
|
+
// 3. Replace the npm path in Webflow site custom footer code
|
|
7
|
+
// 4. Remove these comments
|
|
14
8
|
|
|
15
|
-
// Define smooth scroll
|
|
16
|
-
const lenis = new Lenis({
|
|
17
|
-
duration: 1.2,
|
|
18
|
-
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t))
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// Lenis scroll start function
|
|
22
|
-
function lenisScroll() {
|
|
23
|
-
function raf(time) {
|
|
24
|
-
lenis.raf(time);
|
|
25
|
-
requestAnimationFrame(raf);
|
|
26
|
-
}
|
|
27
|
-
requestAnimationFrame(raf);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Lazy load library init
|
|
31
|
-
function lazyLoad() {
|
|
32
|
-
const observer = lozad('img, video:not(#fullReel)', {
|
|
33
|
-
loaded: function (el) {
|
|
34
|
-
// Custom code to run when an image or video is loaded
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
observer.observe();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Custom ease for GSAP
|
|
41
|
-
function customGsapEasing(){
|
|
42
|
-
CustomEase.create('loader', '0.83, 0, 0.17, 1');
|
|
43
|
-
CustomEase.create('loader2', '0.77, 0, 0.175, 1');
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Reload page on browser back action
|
|
47
|
-
function reloadOnBack() {
|
|
48
|
-
window.addEventListener('pageshow', function (event) {
|
|
49
|
-
if (event.persisted) {
|
|
50
|
-
window.location.reload();
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Page load animation
|
|
56
|
-
const loaderAnimationIn = gsap.timeline({});
|
|
57
|
-
loaderAnimationIn.add(function() {
|
|
58
|
-
history.scrollRestoration = 'manual';
|
|
59
|
-
gsap.to(window, { duration: 0.05, scrollTo: 0 });
|
|
60
|
-
lenis.scrollTo(0);
|
|
61
|
-
});
|
|
62
|
-
loaderAnimationIn.add(function() {
|
|
63
|
-
lenis.stop();
|
|
64
|
-
}, '>');
|
|
65
|
-
loaderAnimationIn.to(
|
|
66
|
-
'.loader_ract',
|
|
67
|
-
{
|
|
68
|
-
delay: 0.2,
|
|
69
|
-
duration: 0.8,
|
|
70
|
-
width: 0,
|
|
71
|
-
ease: 'loader2',
|
|
72
|
-
},
|
|
73
|
-
'>'
|
|
74
|
-
);
|
|
75
|
-
loaderAnimationIn.add(function() {
|
|
76
|
-
lenis.start();
|
|
77
|
-
}, '>');
|
|
78
|
-
loaderAnimationIn.to('.loader_wrapper', { display: 'none', duration: 0.1 }, '>');
|
|
79
|
-
|
|
80
|
-
// Page transition animation
|
|
81
|
-
function transitionLinksRule() {
|
|
82
|
-
const transitionLinks = document.querySelectorAll(
|
|
83
|
-
'a:not([href^="#"]):not([href^="javascript:"]):not([href=""]):not([href^="mailto:"]):not([href^="tel:"])'
|
|
84
|
-
);
|
|
85
|
-
transitionLinks.forEach((link) => {
|
|
86
|
-
if (link.getAttribute('target') !== '_blank') {
|
|
87
|
-
link.addEventListener('click', (e) => {
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
|
|
90
|
-
const loaderAnimationOut = gsap.timeline({
|
|
91
|
-
onComplete: () => {
|
|
92
|
-
window.location.href = link.href;
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
loaderAnimationOut.to('.unloader_wrapper', { display: 'flex', duration: 0.05 });
|
|
96
|
-
loaderAnimationOut.from('.unloader_ract', {
|
|
97
|
-
duration: 0.4,
|
|
98
|
-
width: '0%',
|
|
99
|
-
ease: 'loader2',
|
|
100
|
-
}),
|
|
101
|
-
'>';
|
|
102
|
-
// play the timeline
|
|
103
|
-
loaderAnimationOut.play();
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// Reset loader display on screen resize
|
|
110
|
-
function onScreenResize() {
|
|
111
|
-
window.addEventListener('resize', function () {
|
|
112
|
-
setTimeout(function () {
|
|
113
|
-
gsap.set('.loader_wrapper', { display: 'none' });
|
|
114
|
-
}, 50);
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// Hero move to reveal footer
|
|
119
|
-
function revealFooter() {
|
|
120
|
-
gsap.to('#heroSection', {
|
|
121
|
-
scrollTrigger: {
|
|
122
|
-
trigger: '#bottomWrapper',
|
|
123
|
-
start: 'top bottom',
|
|
124
|
-
toggleActions: 'restart none none reverse',
|
|
125
|
-
},
|
|
126
|
-
y: '-100%',
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Custom cursor on mousedown and mouse up
|
|
131
|
-
function customCursorOnClick() {
|
|
132
|
-
const cursorElements = document.querySelectorAll('[wide="customCursor"]');
|
|
133
|
-
const customCursor = document.querySelector('.custom_cursor');
|
|
134
|
-
cursorElements.forEach((element) => {
|
|
135
|
-
element.addEventListener('mousedown', function () {
|
|
136
|
-
customCursor.style.transform = 'scale3d(0.8, 0.8, 1)';
|
|
137
|
-
});
|
|
138
|
-
element.addEventListener('mouseup', function () {
|
|
139
|
-
customCursor.style.transform = 'scale3d(1, 1, 1)';
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// Custom cursor copy change on hover
|
|
145
|
-
function customCursorChangeCopy() {
|
|
146
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
147
|
-
const customCursorElements = document.querySelectorAll('[wideCursorText]');
|
|
148
|
-
customCursorElements.forEach(function (element) {
|
|
149
|
-
element.addEventListener('mouseenter', () => {
|
|
150
|
-
const wideCursorTextValue = element.getAttribute('wideCursorText');
|
|
151
|
-
const customCursorTextElement = document.querySelector('.custom_cursor_text');
|
|
152
|
-
customCursorTextElement.innerHTML = wideCursorTextValue;
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Header animations
|
|
159
|
-
const showHideHeader = gsap.from('.navbar', {
|
|
160
|
-
y: '-100%',
|
|
161
|
-
paused: true,
|
|
162
|
-
duration: 0.2,
|
|
163
|
-
ease: 'loader2',
|
|
164
|
-
})
|
|
165
|
-
.progress(1);
|
|
166
|
-
|
|
167
|
-
// Header animation on scroll
|
|
168
|
-
function headeronScroll() {
|
|
169
|
-
ScrollTrigger.create({
|
|
170
|
-
start: 'top top',
|
|
171
|
-
endTrigger: '.bottom-wrapper',
|
|
172
|
-
end: 'bottom top+=100px',
|
|
173
|
-
onUpdate: (self) => {
|
|
174
|
-
self.direction === -1 ? showHideHeader.play() : showHideHeader.reverse();
|
|
175
|
-
},
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// Page load animation
|
|
180
|
-
const homeLoadAnimation = gsap.timeline({}),
|
|
181
|
-
homeHeroHeading = new SplitText('#homeHeroHeading', {
|
|
182
|
-
type: 'lines',
|
|
183
|
-
linesClass: 'hero-line',
|
|
184
|
-
}),
|
|
185
|
-
homeHeroHeadingMask = new SplitText('#homeHeroHeading', {
|
|
186
|
-
type: 'lines',
|
|
187
|
-
linesClass: 'hero-line-mask',
|
|
188
|
-
});
|
|
189
|
-
homeLoadAnimation.add(loaderAnimationIn.play());
|
|
190
|
-
homeLoadAnimation.from('.navbar', {
|
|
191
|
-
opacity: 0,
|
|
192
|
-
duration: 0.6,
|
|
193
|
-
ease: 'loader2',
|
|
194
|
-
}),
|
|
195
|
-
'>-2';
|
|
196
|
-
homeLoadAnimation.from(
|
|
197
|
-
'.hero-line',
|
|
198
|
-
{
|
|
199
|
-
duration: 1.2,
|
|
200
|
-
y: '100%',
|
|
201
|
-
stagger: 0.2,
|
|
202
|
-
ease: 'loader2',
|
|
203
|
-
},
|
|
204
|
-
'>-0.5'
|
|
205
|
-
);
|
|
206
|
-
homeLoadAnimation.to(
|
|
207
|
-
'.hero_headline_ract-mask',
|
|
208
|
-
{
|
|
209
|
-
width: '0%',
|
|
210
|
-
duration: 0.6,
|
|
211
|
-
ease: 'loader2',
|
|
212
|
-
},
|
|
213
|
-
'>-0.6'
|
|
214
|
-
);
|
|
215
|
-
homeLoadAnimation.from(
|
|
216
|
-
'#heroSubtitle',
|
|
217
|
-
{
|
|
218
|
-
opacity: 0,
|
|
219
|
-
duration: 1,
|
|
220
|
-
ease: 'loader2',
|
|
221
|
-
},
|
|
222
|
-
'>-0.4'
|
|
223
|
-
);
|
|
224
9
|
|
|
10
|
+
// -----> Write your functions here
|
|
225
11
|
|
|
226
12
|
|
|
227
13
|
|
|
@@ -232,15 +18,5 @@ homeLoadAnimation.from(
|
|
|
232
18
|
// !!!!!!!!! Keep this Alpine init at the end !!!!!!!!!
|
|
233
19
|
window.Webflow ||= [];
|
|
234
20
|
window.Webflow.push(() => {
|
|
235
|
-
|
|
236
|
-
lenisScroll();
|
|
237
|
-
customGsapEasing();
|
|
238
|
-
lazyLoad();
|
|
239
|
-
reloadOnBack();
|
|
240
|
-
transitionLinksRule();
|
|
241
|
-
onScreenResize();
|
|
242
|
-
revealFooter();
|
|
243
|
-
customCursorOnClick();
|
|
244
|
-
customCursorChangeCopy();
|
|
245
|
-
headeronScroll();
|
|
21
|
+
initAlpine();
|
|
246
22
|
});
|