PageSourceSearch

https://teatrpushkin.ru/layout/js/animations.js

js teatrpushkin.ru collected 2026-09-24 20:44:01 UTC 4,325 bytes, 233 lines download raw bytes

1if ($("#mobile-indicator").css("display") == "none") {
2
3  var is_mobile = true;
4
5} else {
6
7  var is_mobile = true;
8
9}
10
11function animateAll() {
12
13  if ($("#mobile-indicator").css("display") == "none" && !$("body").hasClass("animated")) {
14
15    $("body").addClass("animated");
16
17    var controller = new ScrollMagic.Controller();
18
19    TweenLite.set(".troupe-pic", {
20      scale: 3
21    });
22
23    TweenLite.set(".troupe-pic-shadow", {
24      opacity: .7
25    });
26
27    var aboutPicTween = new TimelineMax();
28
29    aboutPicTween.to(".troupe-pic", 1.5, {
30      scale: 1
31    });
32
33    var aboutShadowTween = new TimelineMax();
34
35    aboutShadowTween.to(".troupe-pic-shadow", 1.5, {
36      opacity: 0
37    });
38
39    var aboutPicScene = new ScrollMagic.Scene({
40      triggerElement: ".about-wrapper",
41      duration: $(".about-wrapper").outerHeight() - $(window).height()
42    })
43      .setTween(aboutPicTween)
44      .addTo(controller);
45
46    var aboutShadowScene = new ScrollMagic.Scene({
47      triggerElement: ".chamber-tmb",
48      duration: $(".chamber-tmb").outerHeight(),
49      triggerHook: "onLeave"
50    })
51      .setTween(aboutShadowTween)
52      .addTo(controller);
53
54    // controller.destroy(true);
55    // controller = null;
56    // aboutPicScene.destroy(true);
57    // aboutPicScene = null;
58    // aboutShadowScene.destroy(true);
59    // aboutShadowScene = null;
60
61    window.addEventListener("resize", function () {
62
63      // controller.destroy(reset);
64      // controller = null;
65      // aboutPicScene.destroy(reset);
66      // aboutPicScene = null;
67      // aboutShadowScene.destroy(reset);
68      // aboutShadowScene = null;
69      // aboutPicTween = null;
70      // aboutShadowTween = null;
71      //
72      // $("body").removeClass("animated");
73      //
74      // animateAll();
75
76    });
77
78    $(window).on("resize", function (controller, aboutPicScene, aboutShadowScene) {
79
80      //console.log(controller);
81
82
83
84    });
85
86  } else {
87
88    $("body").removeClass("animated");
89
90  }
91
92}
93
94
95
96
97
98
99// About
100
101
102// About END
103
104
105
106$(document).ready(function () {
107
108  setParallax();
109
110});
111
112$(window).on("resize", function () {
113
114  //animateAll();
115
116});
117
118$(window).on("resize scroll", function () {
119
120  setParallax();
121
122});
123
124$(document).ready(function () {
125
126  animateAll();
127
128});
129
130function setParallax() {
131
132  if ($("#md-indicator").css("display") == "block") {
133
134    var prlxOffset = 50;
135
136  } else {
137
138    var prlxOffset = 100;
139
140  }
141  
142  $(".page-pic").filter(function () {
143
144    return !$(this).find(".play-slider").length
145
146  }).find("img").prlx($("body"), -prlxOffset, prlxOffset, true);
147
148  $(".play-slider img").prlx($("body"), -50, 50, true);
149
150
151  $(".history-header-year-back").each(function () {
152
153    var pTrigger = $(this).closest(".history-section-header");
154
155    $(this).prlx(pTrigger, -50, 150, false);
156
157
158  });
159
160
161  $(".history-section-bg").each(function () {
162
163    var pTrigger = $(this).closest(".history-section-content");
164
165    $(this).prlx(pTrigger, 0, 100, false);
166
167
168  });
169
170
171}
172
173(function( $ ) {
174  $.fn.prlx = function(pTrigger, yStart, yFinish, fromTop) {
175
176    if (!is_mobile) {
177
178      var obj = $(this);
179
180      var yPos;
181
182      if (fromTop) {
183
184        if ($(window).scrollTop() <= pTrigger.offset().top) {
185
186          yPos = yStart;
187
188        } else if ($(window).scrollTop() > pTrigger.offset().top + $(window).height()) {
189
190          yPos = yFinish;
191
192        } else {
193
194          var percentOffset = (pTrigger.offset().top + $(window).height() - $(window).scrollTop()) / ($(window).height());
195
196          var yRange = yStart - yFinish,
197            posInRange = yRange * percentOffset,
198            yPos = posInRange + yFinish;
199
200          obj.attr("percentOffset", percentOffset);
201
202        }
203
204      } else {
205
206        if ($(window).scrollTop() <= pTrigger.offset().top - $(window).height()) {
207
208          yPos = yStart;
209
210        } else if ($(window).scrollTop() > pTrigger.offset().top + $(window).height()) {
211
212          yPos = yFinish;
213
214        } else {
215
216          var percentOffset = (pTrigger.offset().top + $(window).height() - $(window).scrollTop()) / ($(window).height() * 2);
217
218          var yRange = yStart - yFinish,
219            posInRange = yRange * percentOffset,
220            yPos = posInRange + yFinish;
221
222          obj.attr("percentOffset", percentOffset);
223
224        }
225
226      }
227
228      TweenMax.to(obj, .7, {y: yPos, ease:Linear.ease});
229
230    }
231
232  };
233})( jQuery );

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.