@widelab-nc/widelab 1.1.8 → 1.1.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widelab-nc/widelab",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "Widelab starter template based on Finsweet template + add-ons.",
5
5
  "homepage": "https://widelab.co",
6
6
  "license": "ISC",
package/src/index.js CHANGED
@@ -18,6 +18,25 @@ function customGsapEasing() {
18
18
 
19
19
  // Functions definitions
20
20
 
21
+ // Contact form open animation
22
+ let contactFormOpen;
23
+ function contactFormOpenAnimation() {
24
+ const contactFormWrapper = document.querySelector('.contact-modal_main-wrapper');
25
+ const contactForm = document.querySelector('.contact-modal_content-wrapper');
26
+ contactFormOpen = gsap.timeline({paused: true});
27
+ contactFormOpen.to(contactFormWrapper, {
28
+ autoAlpha: 1,
29
+ duration: 0.2,
30
+ ease: 'loader2',
31
+ })
32
+ contactFormOpen.from(contactForm, {
33
+ x: '100%',
34
+ duration: 0.3,
35
+ ease: 'loader2',
36
+ }, '-=0.1')
37
+ }
38
+
39
+
21
40
  //Smooth scroll init
22
41
  const lenis = new Lenis({
23
42
  duration: 1.2,
@@ -980,13 +999,13 @@ window.updateScrollTrigger = function() {
980
999
 
981
1000
  // Custom checkboxes
982
1001
  window.changeCheckboxLabelColor = function() {
983
- var checkboxInputs = document.querySelectorAll('.w-checkbox-input');
1002
+ let checkboxInputs = document.querySelectorAll('.w-checkbox-input');
984
1003
 
985
- var callback = function(mutationsList, observer) {
986
- for(var mutation of mutationsList) {
1004
+ let callback = function(mutationsList, observer) {
1005
+ for(let mutation of mutationsList) {
987
1006
  if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
988
- var isChecked = mutation.target.classList.contains('w--redirected-checked');
989
- var siblingLabel = mutation.target.parentElement.querySelector('.form-checkbox_label');
1007
+ let isChecked = mutation.target.classList.contains('w--redirected-checked');
1008
+ let siblingLabel = mutation.target.parentElement.querySelector('.form-checkbox_label');
990
1009
 
991
1010
  if (isChecked && siblingLabel && !siblingLabel.classList.contains('is-active')) {
992
1011
  siblingLabel.classList.add('is-active');
@@ -998,13 +1017,24 @@ window.changeCheckboxLabelColor = function() {
998
1017
  };
999
1018
 
1000
1019
  checkboxInputs.forEach(function(checkboxInput) {
1001
- var config = { attributes: true, attributeFilter: ['class'] };
1002
- var observer = new MutationObserver(callback);
1020
+ let config = { attributes: true, attributeFilter: ['class'] };
1021
+ let observer = new MutationObserver(callback);
1003
1022
  observer.observe(checkboxInput, config);
1004
1023
  });
1005
1024
 
1006
1025
  }
1007
1026
 
1027
+ // Contact modal open animation
1028
+ window.openContactModal = function() {
1029
+ contactFormOpen.play();
1030
+ }
1031
+
1032
+ // Contact modal close animation
1033
+ window.closeContactModal = function() {
1034
+ contactFormOpen.timeScale(1.5).reverse();;
1035
+ }
1036
+
1037
+
1008
1038
  // !!!!!!!!! Keep this Alpine init at the end !!!!!!!!!
1009
1039
  window.Webflow ||= [];
1010
1040
  window.Webflow.push(() => {
@@ -1025,7 +1055,8 @@ window.changeCheckboxLabelColor = function() {
1025
1055
  pageLoadAnimation();
1026
1056
  pageTransitionAnimation();
1027
1057
  customCursorOnClick();
1058
+ contactFormOpenAnimation();
1028
1059
  if (window.innerWidth < 992) {
1029
1060
  disableScrollMenu();
1030
- }
1061
+ };
1031
1062
  });