PageSourceSearch

https://gsprom.ru/layout2/js/animations.js

js gsprom.ru collected 2026-09-29 21:51:48 UTC 4,282 bytes, 158 lines download raw bytes

1let is_mobile = false;
2
3if( $('#mobile-indicator').css('display')=='block') {
4	is_mobile = true;
5}
6
7$(document).ready(function () {
8
9	// $(".main-slider-item-info-item-num, .main-promo-block-num, .directions-info-num, .page-header-numbers-num span").wrapNumbers();
10
11	addClassForAnimation();
12
13	animateAll();
14	// animateNumbers();
15
16	mainBlockSize();
17
18});
19
20$(window).on("resize", function () {
21
22	animateAll();
23	// animateNumbers();
24
25	mainBlockSize();
26
27});
28
29function animMainMenu() {
30
31	let menuItem = $(".main-menu-sections .header-bottom-links-row > li");
32
33	TweenMax.to(menuItem, 0, {
34		opacity: 0,
35		y: -50
36	});
37
38	menuItem.each(function () {
39
40		let element = $(this);
41
42		TweenMax.to(element, .75, {
43			opacity: 1,
44			y: 0,
45			delay: element.prevAll().length * .25 + .75
46		});
47
48	});
49
50
51}
52
53(function($) {
54	$.fn.wrapNumbers = function() {
55		return this.each(function() {
56
57			let el = $(this);
58
59			let rxp = new RegExp("(\s*[0-9]+\s*)+", "gm");
60
61			el.each(function(){
62				var $this = $(this);
63				var content = $this.html().replace(/\s/g, '');
64				$this.html(content.replace(rxp, "<span class='easyNumAnimate' data-num='$1'>0</span>"));
65			});
66
67		});
68	};
69
70})(jQuery);
71
72var controller = new ScrollMagic.Controller();
73
74function animateAll() {
75
76	if (!is_mobile && !$("body").hasClass("animated")) {
77
78		$("body").addClass("animated");
79
80		$.each( $(".block-animated"), function( index, element ) {
81
82			$(element).each(function () {
83
84				var actionTmb = $(this);
85
86				var actionTween = new TweenMax.to(actionTmb, .5, {
87					opacity: 1,
88					transform: "translate(0, 0)"
89				});
90
91				var actionScene = new ScrollMagic.Scene({triggerElement: element, reverse: false})
92					.offset(-500)
93					.setTween(actionTween)
94					.addTo(controller);
95			});
96
97		});
98
99	}
100
101}
102
103function addClassForAnimation() {
104
105	$(".section-header, .section-subheader, .projects-item, .main-promo-block-desc, .main-promo-block-num-wrapper, .section:not(.section-main, .section-tenders-preview) .tenders-item, .tenders-preview-wrapper .tenders-list, .main-media-over-wrapper, .directions-over-wrapper, .main-find-jobs-list, .main-career-news-wrapper, .main-news-wrapper, .section:not(.section-main) .people-item, .section-main .people-list, .career-links-list, .tenders-for-partners, .for-partners-links-item, .invite-partners-inner-wrapper, .subscribe-form-wrapper, .section:not(.section-history, .section-company-alt) .article-content:not(.two-col), .history-section, .proj-item, .photo-list-over-wrapper, .about-list-over-wrapper, .news-over-wrapper, .section-appeal .section-content, .section-appeal-long .section-content, .three-col-item, .section-certificates .section-content, .directions-item, .tiser-list, .tiser-main-pic-over-wrapper, .teh-cat-item, .doc-list-tiles .row > div, .section-trust-line .section-content, .news-tmb, .glossary-section, .section-contact-us, .search-tmb, .page-nav, .program-section, .project-infographic-list-over-wrapper, .page-header-descr, .main-slider-item-desc > div, .main-slider-nav-item, .about-tenders-links-list, .proj-item-parts, .filter-wrapper, .footer-top, .footer-bottom, .section-about-organisation .section-content, .projects-gallery-over-wrapper, .banner-over-wrapper, .hire-subttl, .hire-pic, .vacancy-list, .hire-phone, .section-about-organisation, .section-company-alt .project-infographic-item, .section-company-alt .col-r").addClass("block-animated");
106
107}
108
109function animateNumbers() {
110
111	$(".easyNumAnimate").each(function (index, element) {
112
113		const el = $(this);
114
115		let elScene = new ScrollMagic.Scene({
116			triggerElement: element,
117			triggerHook: 1,
118			offset: 50,
119			reverse: false
120		})
121			.on("enter", function () {
122
123				animateNumEl(el);
124
125			})
126			.addTo(controller);
127
128	});
129
130
131}
132
133function animateNumEl (el) {
134	const elNum = el.data("num");
135
136	el.easy_number_animate({
137		start_value: 0,
138		end_value: elNum,
139		duration: 2000,
140		delimiter:' '
141	});
142}
143
144function mainBlockSize() {
145
146	$(".main-promo-block-people .main-promo-block-header").css({
147		minHeight: $(".main-promo-block-people").width() * 0.4977
148	});
149
150	$(".main-promo-block-career .main-promo-block-header").css({
151		minHeight: $(".main-promo-block-career").width() * 0.4977
152	});
153
154	$(".main-promo-block-projects .main-promo-block-header").css({
155		minHeight: $(".main-promo-block-projects").width() * 0.4977
156	});
157
158}

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.