PageSourceSearch

https://www.pasticceriacioccolateria.it/wp-content/plugins/breakda…/image-comparison.js?bd_ver=2.5.2

js pasticceriacioccolateria.it collected 2026-10-08 23:12:51 UTC 2,829 bytes, 106 lines download raw bytes

1(function () {
2  const { mergeObjects } = BreakdanceFrontend.utils;
3
4  class BreakdanceImageComparison {
5    options = {
6      settings: {
7        auto_animation: false,
8        starting_point_percent: 1,
9        vertical_mode: false,
10        start_on_hover: false,
11        initial_position: 0.4,
12        animation_speed: 1,
13      },
14    };
15
16    constructor(selector, options) {
17      this.selector = selector;
18      this.wrap = document.querySelector(`${this.selector}`);
19      this.element = document.querySelector(
20        `${this.selector} .js-comparison-container`
21      );
22      this.imagesContainer = document.querySelector(
23        `${this.selector} .js-image-container`
24      );
25
26      this.clone = this.element.cloneNode(true);
27      this.options = mergeObjects(this.options, {
28        ...options.content,
29        ...options.design,
30      });
31
32      this.init();
33    }
34
35    show() {
36      const { settings } = this.options;
37
38      const pluginSettings = {
39        orientation:
40          settings.vertical_mode === true ? "vertical" : "horizontal",
41        initialPosition: settings.initial_position,
42        width: "100%",
43        backgroundColor: "none",
44        onPointerDown: settings.start_on_hover ? false : true,
45        cursor: "ew-resize",
46        dividingLine: "none",
47        followEasingFactor: 0,
48        interactive: true,
49        autoAnimation: settings.auto_animation ? true : false,
50        autoAnimationSpeed: settings.animation_speed
51          ? settings.animation_speed
52          : 5,
53        autoAnimationPause: 1,
54        autoAnimationEasing: "inOutCubic",
55        controlOthers: false,
56        controlledByOthers: false,
57        controlledReverse: false,
58        group: "",
59        groupSync: false,
60        loading: "lazy",
61        viewportOffset: "100px",
62        sleepMode: true,
63        onReady: function () {},
64      };
65
66      this.comparison = new AnyImageComparisonSlider(
67        this.element,
68        pluginSettings
69      );
70    }
71
72    replaceLabels() {
73      const beforeLabel = this.wrap.dataset.beforeLabel;
74      const afterLabel = this.wrap.dataset.afterLabel;
75
76      document.querySelector(`${this.selector} .label-before`).innerHTML =
77        beforeLabel;
78      document.querySelector(`${this.selector} .label-after`).innerHTML =
79        afterLabel;
80    }
81
82    // Methods
83    destroy() {
84      if (!this.element) return;
85      this.element.parentNode.replaceChild(this.clone, this.element);
86      this.replaceLabels();
87      this.element = null;
88      this.comparison = null;
89    }
90
91    update(options) {
92      this.options = mergeObjects(this.options, {
93        ...options.content,
94        ...options.design,
95      });
96      this.destroy();
97      this.init();
98    }
99
100    init() {
101      this.show();
102    }
103  }
104
105  window.BreakdanceImageComparison = BreakdanceImageComparison;
106})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.