Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. (function ($) {
  2. "use strict";
  3. // Searching & Expand Menu Popup
  4. var searchToggle = $(".search-toggle"),
  5. closeA = $(".scale"),
  6. closeB = $(".searching button"),
  7. cBody = $("body"),
  8. closeScale = closeA.add(closeB);
  9. if (searchToggle.length > 0) {
  10. searchToggle.on("click", function () {
  11. cBody.toggleClass("open");
  12. return false;
  13. });
  14. }
  15. if (closeScale.length > 0) {
  16. closeScale.on("click", function () {
  17. cBody.removeClass("open");
  18. return false;
  19. });
  20. }
  21. $(".close").on("click", function () {
  22. $("body").removeClass("open");
  23. });
  24. /*-----------------------------main slider active---------------------------- */
  25. const $mainSlider = $(".main-slider");
  26. $mainSlider.slick({
  27. autoplay: true,
  28. autoplaySpeed: 6000,
  29. speed: 400,
  30. slidesToShow: 1,
  31. slidesToScroll: 1,
  32. dots: true,
  33. fade: true,
  34. arrows: true,
  35. prevArrow: '<button class="slick-prev"><i class="fa fa-chevron-left"></i></button>',
  36. nextArrow: '<button class="slick-next"><i class="fa fa-chevron-right"></i></button>',
  37. responsive: [{
  38. breakpoint: 767,
  39. settings: {
  40. dots: true,
  41. arrows: false
  42. }
  43. }, ],
  44. })
  45. .slickAnimation();
  46. /*-------------------------- product slider init ---------------------------- */
  47. const $productSliderInit = $(".product-slider-init");
  48. $productSliderInit.slick({
  49. autoplay: false,
  50. autoplaySpeed: 10000,
  51. dots: true,
  52. infinite: false,
  53. arrows: true,
  54. speed: 1000,
  55. slidesToShow: 1,
  56. slidesToScroll: 1,
  57. infinite: true,
  58. prevArrow: '<button class="slick-prev"><i class="fa fa-chevron-left"></i></button>',
  59. nextArrow: '<button class="slick-next"><i class="fa fa-chevron-right"></i></button>',
  60. responsive: [{
  61. breakpoint: 1199,
  62. settings: {
  63. slidesToShow: 1,
  64. slidesToScroll: 1,
  65. infinite: true,
  66. dots: true,
  67. },
  68. },
  69. {
  70. breakpoint: 1024,
  71. settings: {
  72. slidesToShow: 1,
  73. slidesToScroll: 1,
  74. arrows: true,
  75. autoplay: true,
  76. infinite: true,
  77. dots: true,
  78. },
  79. },
  80. {
  81. breakpoint: 768,
  82. settings: {
  83. slidesToShow: 1,
  84. slidesToScroll: 1,
  85. arrows: false,
  86. autoplay: true,
  87. infinite: true,
  88. dots: true,
  89. },
  90. },
  91. {
  92. breakpoint: 480,
  93. settings: {
  94. slidesToShow: 1,
  95. slidesToScroll: 1,
  96. arrows: false,
  97. autoplay: true,
  98. infinite: true,
  99. dots: true,
  100. },
  101. },
  102. // You can unslick at a given breakpoint now by adding:
  103. // settings: "unslick"
  104. // instead of a settings object
  105. ],
  106. });
  107. /*--------------------------popular-slider-init---------------------------- */
  108. const $popularSlider = $(".popular-slider-init");
  109. $popularSlider.slick({
  110. autoplay: true,
  111. autoplaySpeed: 10000,
  112. dots: true,
  113. infinite: true,
  114. arrows: true,
  115. speed: 1000,
  116. slidesToShow: 3,
  117. slidesToScroll: 1,
  118. prevArrow: '<button class="slick-prev"><i class="fa fa-chevron-left"></i></button>',
  119. nextArrow: '<button class="slick-next"><i class="fa fa-chevron-right"></i></button>',
  120. responsive: [{
  121. breakpoint: 1280,
  122. settings: {
  123. slidesToShow: 3,
  124. slidesToScroll: 1,
  125. infinite: false,
  126. dots: true,
  127. },
  128. },
  129. {
  130. breakpoint: 991,
  131. settings: {
  132. slidesToShow: 2,
  133. slidesToScroll: 1,
  134. arrows: false,
  135. autoplay: true,
  136. },
  137. },
  138. {
  139. breakpoint: 768,
  140. settings: {
  141. slidesToShow: 2,
  142. slidesToScroll: 1,
  143. arrows: false,
  144. autoplay: true,
  145. },
  146. },
  147. {
  148. breakpoint: 480,
  149. settings: {
  150. slidesToShow: 1,
  151. slidesToScroll: 1,
  152. arrows: false,
  153. autoplay: true,
  154. },
  155. },
  156. // You can unslick at a given breakpoint now by adding:
  157. // settings: "unslick"
  158. // instead of a settings object
  159. ],
  160. });
  161. /*-------------------------- featured-init ---------------------------- */
  162. const $featuredSlider = $(".featured-init");
  163. $featuredSlider.slick({
  164. autoplay: false,
  165. autoplaySpeed: 10000,
  166. dots: false,
  167. infinite: false,
  168. arrows: true,
  169. speed: 1000,
  170. slidesToShow: 4,
  171. slidesToScroll: 1,
  172. prevArrow: '<button class="slick-prev"><i class="fa fa-chevron-left"></i></button>',
  173. nextArrow: '<button class="slick-next"><i class="fa fa-chevron-right"></i></button>',
  174. responsive: [{
  175. breakpoint: 1280,
  176. settings: {
  177. slidesToShow: 3,
  178. slidesToScroll: 1,
  179. infinite: false,
  180. dots: false,
  181. },
  182. },
  183. {
  184. breakpoint: 991,
  185. settings: {
  186. slidesToShow: 2,
  187. slidesToScroll: 1,
  188. arrows: true,
  189. autoplay: true,
  190. },
  191. },
  192. {
  193. breakpoint: 768,
  194. settings: {
  195. slidesToShow: 2,
  196. slidesToScroll: 1,
  197. arrows: true,
  198. autoplay: true,
  199. },
  200. },
  201. {
  202. breakpoint: 480,
  203. settings: {
  204. slidesToShow: 1,
  205. slidesToScroll: 1,
  206. arrows: false,
  207. autoplay: true,
  208. },
  209. },
  210. // You can unslick at a given breakpoint now by adding:
  211. // settings: "unslick"
  212. // instead of a settings object
  213. ],
  214. });
  215. /*--------------------------
  216. product ctry slider init
  217. ---------------------------- */
  218. const $productCtry = $(".product-ctry-init");
  219. $productCtry.slick({
  220. autoplay: false,
  221. autoplaySpeed: 10000,
  222. dots: false,
  223. infinite: false,
  224. arrows: true,
  225. speed: 1000,
  226. slidesToShow: 1,
  227. slidesToScroll: 1,
  228. prevArrow: '<button class="slick-prev"><i class="fa fa-chevron-left"></i></button>',
  229. nextArrow: '<button class="slick-next"><i class="fa fa-chevron-right"></i></button>',
  230. responsive: [{
  231. breakpoint: 1024,
  232. settings: {
  233. slidesToShow: 1,
  234. slidesToScroll: 1,
  235. infinite: true,
  236. dots: false,
  237. },
  238. },
  239. {
  240. breakpoint: 992,
  241. settings: {
  242. slidesToShow: 2,
  243. slidesToScroll: 1,
  244. arrows: true,
  245. autoplay: true,
  246. },
  247. },
  248. {
  249. breakpoint: 767,
  250. settings: {
  251. slidesToShow: 1,
  252. slidesToScroll: 1,
  253. arrows: true,
  254. autoplay: true,
  255. },
  256. },
  257. // You can unslick at a given breakpoint now by adding:
  258. // settings: "unslick"
  259. // instead of a settings object
  260. ],
  261. });
  262. /*---------------------------
  263. countdown-syncing
  264. ---------------------------- */
  265. $(".countdown-sync-init").slick({
  266. slidesToShow: 1,
  267. slidesToScroll: 1,
  268. infinite: true,
  269. draggable: false,
  270. arrows: false,
  271. dots: false,
  272. fade: true,
  273. asNavFor: ".countdown-sync-nav",
  274. });
  275. $(".countdown-sync-nav").slick({
  276. dots: false,
  277. arrows: false,
  278. infinite: true,
  279. prevArrow: '<button class="slick-prev"><i class="fas fa-arrow-left"></i></button>',
  280. nextArrow: '<button class="slick-next"><i class="fas fa-arrow-right"></i></button>',
  281. slidesToShow: 3,
  282. slidesToScroll: 1,
  283. asNavFor: ".countdown-sync-init",
  284. focusOnSelect: true,
  285. draggable: false,
  286. });
  287. /*---------------------------
  288. product-syncing
  289. ---------------------------- */
  290. $(".product-sync-init").slick({
  291. slidesToShow: 1,
  292. slidesToScroll: 1,
  293. infinite: true,
  294. draggable: false,
  295. arrows: false,
  296. dots: false,
  297. fade: true,
  298. asNavFor: ".product-sync-nav",
  299. });
  300. $(".product-sync-nav").slick({
  301. dots: false,
  302. arrows: false,
  303. infinite: true,
  304. prevArrow: '<button class="slick-prev"><i class="fas fa-arrow-left"></i></button>',
  305. nextArrow: '<button class="slick-next"><i class="fas fa-arrow-right"></i></button>',
  306. slidesToShow: 4,
  307. slidesToScroll: 1,
  308. asNavFor: ".product-sync-init",
  309. focusOnSelect: true,
  310. draggable: false,
  311. });
  312. /*--------------------------
  313. tooltip
  314. ---------------------------- */
  315. var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
  316. var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
  317. return new bootstrap.Tooltip(tooltipTriggerEl)
  318. })
  319. // slider-range
  320. $("#slider-range").slider({
  321. range: true,
  322. min: 0,
  323. max: 800,
  324. values: [200, 600],
  325. slide: function (event, ui) {
  326. $("#amount").val("€" + ui.values[0] + " - €" + ui.values[1]);
  327. },
  328. });
  329. $("#amount").val(
  330. "€" +
  331. $("#slider-range").slider("values", 0) +
  332. " - €" +
  333. $("#slider-range").slider("values", 1)
  334. );
  335. // slider-range end
  336. /*----------------------------------------
  337. fixed issue in bootstrap tabs problem
  338. ----------------------------------------- */
  339. $('a[data-bs-toggle="pill"]').on("shown.bs.tab", function (e) {
  340. e.target;
  341. e.relatedTarget;
  342. $(".slick-slider").slick("setPosition");
  343. });
  344. /*-----------------------------------
  345. fixed issue in bs modal problem
  346. ---------------------------------- */
  347. $(".modal").on("shown.bs.modal", function (e) {
  348. $(".slick-slider").slick("setPosition");
  349. });
  350. /*--------------------------
  351. comment scroll down
  352. ---------------------------- */
  353. $("#write-comment").on("click", function (e) {
  354. e.preventDefault();
  355. $("html, body").animate({
  356. scrollTop: $(".btn-dark ").offset().top + 750
  357. },
  358. 500,
  359. "linear"
  360. );
  361. });
  362. /*--------------------------
  363. counter
  364. -------------------------- */
  365. $(".count").each(function () {
  366. var count = $(this),
  367. input = count.find('input[type="number"]'),
  368. increament = count.find(".increment"),
  369. decreament = count.find(".decrement"),
  370. minValue = input.attr("min"),
  371. maxValue = input.attr("max");
  372. increament.on("click", function () {
  373. var oldValue = parseFloat(input.val());
  374. if (oldValue >= maxValue) {
  375. var newVal = oldValue;
  376. } else {
  377. var newVal = oldValue + 1;
  378. }
  379. count.find("input").val(newVal);
  380. count.find("input").trigger("change");
  381. });
  382. decreament.on("click", function () {
  383. var oldValue = parseFloat(input.val());
  384. if (oldValue <= minValue) {
  385. var newVal = oldValue;
  386. } else {
  387. var newVal = oldValue - 1;
  388. }
  389. count.find("input").val(newVal);
  390. count.find("input").trigger("change");
  391. });
  392. });
  393. /*-------------------------
  394. Create an account toggle
  395. --------------------------*/
  396. $(".checkout-toggle2").on("click", function () {
  397. $(".open-toggle2").slideToggle(1000);
  398. });
  399. $(".checkout-toggle").on("click", function () {
  400. $(".open-toggle").slideToggle(1000);
  401. });
  402. /*--------------------------
  403. SscrollUp
  404. ---------------------------- */
  405. $.scrollUp({
  406. scrollName: "scrollUp", // Element ID
  407. scrollDistance: 400, // Distance from top/bottom before showing element (px)
  408. scrollFrom: "top", // 'top' or 'bottom'
  409. scrollSpeed: 800, // Speed back to top (ms)
  410. easingType: "linear", // Scroll to top easing (see http://easings.net/)
  411. animation: "fade", // Fade, slide, none
  412. animationSpeed: 400, // Animation speed (ms)
  413. scrollTrigger: false, // Set a custom triggering element. Can be an HTML string or jQuery object
  414. scrollTarget: false, // Set a custom target element for scrolling to. Can be element or number
  415. scrollText: '<i class="fas fa-arrow-up"></i>', // Text for element, can contain HTML
  416. scrollTitle: false, // Set a custom <a> title if required.
  417. scrollImg: false, // Set true to use image
  418. activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
  419. zIndex: 214, // Z-Index for the overlay
  420. });
  421. })(jQuery);