diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-12 23:57:48 +0200 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-12 23:57:48 +0200 |
| commit | 7aa203150fc1a2ec79c681c13f0d486d531746eb (patch) | |
| tree | f09ba9f69ccd434e9c7fdeb41807fc8008784d8a /html/content/js/Products | |
| parent | 221af3a2e035bd6689294509feb52f286d3bd5be (diff) | |
| download | classroom-7aa203150fc1a2ec79c681c13f0d486d531746eb.tar.gz classroom-7aa203150fc1a2ec79c681c13f0d486d531746eb.tar.bz2 classroom-7aa203150fc1a2ec79c681c13f0d486d531746eb.zip | |
error pages; js system to support back/front-end
Diffstat (limited to 'html/content/js/Products')
| -rw-r--r-- | html/content/js/Products/productHeader.js | 21 | ||||
| -rw-r--r-- | html/content/js/Products/productImageModal.js | 47 | ||||
| -rw-r--r-- | html/content/js/Products/productattr.js | 11 |
3 files changed, 0 insertions, 79 deletions
diff --git a/html/content/js/Products/productHeader.js b/html/content/js/Products/productHeader.js deleted file mode 100644 index 3e12eee..0000000 --- a/html/content/js/Products/productHeader.js +++ /dev/null @@ -1,21 +0,0 @@ -$$plugins.define('productHeader', function (element, options) {
- const el = document.querySelector('#addToCartButton');
- const header = document.querySelector(".productHeader");
-
- const observer = new window.IntersectionObserver(([entry]) => {
- if (entry.isIntersecting) {
- header.classList.remove("active");
- return
- }
- if (entry.boundingClientRect.top > 0) {
- header.classList.remove("active");
- } else {
- header.classList.add("active");
- }
- }, {
- root: null,
- threshold: 0,
- })
-
- observer.observe(el)
-});
diff --git a/html/content/js/Products/productImageModal.js b/html/content/js/Products/productImageModal.js deleted file mode 100644 index 9873bed..0000000 --- a/html/content/js/Products/productImageModal.js +++ /dev/null @@ -1,47 +0,0 @@ -$$plugins.define('productImageModal', ['swiper-bundle', 'domHelper'], function (element, options, Swiper, $) {
- var $productImg = $('.productPage__image'),
- thumbs = document.querySelector('.productThumbs'),
- sliderModal = document.querySelector('.productSliderModal'),
- $image;
-
- var swiperThumbs = new Swiper(".productThumbs", {
- direction: "vertical",
- freeMode: true,
- init: false,
- slidesPerView: 'auto',
- spaceBetween: 8,
- speed: 800,
- watchSlidesProgress: true,
- breakpoints: {
- 0: {
- direction: "horizontal",
- },
- 640: {
- direction: "vertical",
- }
- }
- });
-
- var swiperMain = new Swiper(".productMainImg", {
- init: false,
- loop: true,
- navigation: {
- nextEl: ".swiper-button-next",
- prevEl: ".swiper-button-prev",
- },
- speed: 800,
- thumbs: {
- swiper: swiperThumbs,
- },
- });
-
- $productImg.on('click', function () {
- if (!thumbs.classList.contains('swiper-initialized')) {
- swiperThumbs.init();
- swiperMain.init();
- }
- sliderModal.classList.add('open');
- $image = $(this).parents('.productPage__image');
- swiperMain.slideTo($image.index() + 1, 0);
- })
-});
diff --git a/html/content/js/Products/productattr.js b/html/content/js/Products/productattr.js deleted file mode 100644 index d28c0a7..0000000 --- a/html/content/js/Products/productattr.js +++ /dev/null @@ -1,11 +0,0 @@ -$$plugins.define('productattr', function (element, options) {
- const selected = element.querySelector('.productAttr__selected');
- element.querySelectorAll('.radiobutton__input').forEach(input => {
- if (input.checked) {
- selected.innerHTML = input.parentElement.querySelector('.radiobutton__text').innerText;
- }
- input.addEventListener('change', function (event) {
- selected.innerHTML = event.target.parentElement.querySelector('.radiobutton__text').innerText;
- });
- })
-});
|
