This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
169 lines (148 loc) · 6.15 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
$(window).on('load', function () {
var $preloader = $('#page-preloader'),
$spinner = $preloader.find('.spinner');
$spinner.fadeOut();
$preloader.delay(350).fadeOut('slow');
var wow = new WOW(
{
boxClass: 'wow', // animated element css class (default is wow)
animateClass: 'animated', // animation css class (default is animated)
offset: 20, // distance to the element when triggering the animation (default is 0)
mobile: true, // trigger animations on mobile devices (default is true)
live: true, // act on asynchronously loaded content (default is true)
callback: function(box) {
// the callback is fired every time an animation is started
// the argument that is passed in is the DOM node being animated
},
scrollContainer: null // optional scroll container selector, otherwise use window
}
);
wow.init();
$.fn.scrollView = function () {
return this.each(function () {
$('html, body').animate({
scrollTop: $(this).offset().top - 100
}, 1000);
});
}
$('#about-us').click(function () {
$('.about-wrapper').scrollView();
});
$('#formats').click(function () {
$('.formats-wrapper').scrollView();
});
$('#portfolio').click(function () {
$('.portfolio-wrapper').scrollView();
});
$('#additional').click(function () {
$('.additional-wrapper').scrollView();
});
$('#contact').click(function () {
$('.contacts-wrapper').scrollView();
});
$('#video').css('min-height', $(window).height() + 'px');
$('.video-wrapper').css('min-height', $(window).height() + 'px');
$(window).resize(function () {
$('#video').css('min-height', $(window).height() + 'px');
$('.video-wrapper').css('min-height', $(window).height() + 'px');
});
windowWidth = $(window).width();
transformWidth = windowWidth * 0.275 - 30;
windowHeight = $(window).height();
transformHeight = windowHeight * 0.465 - 35;
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
var lastScrollTop = 0;
$(window).scroll(function(event){
var st = $(this).scrollTop();
if (st > lastScrollTop){
transformHeight = windowHeight * 0.465;
} else {
transformHeight = windowHeight * 0.465 - 35;
}
lastScrollTop = st;
});
}
clicked = false
$('.navbar-toggle').click(function () {
clicked = !clicked;
if (clicked) {
$('.header').height(250);
} else {
$('.header').height(30);
}
});
percentageMail = 189 + windowWidth * 0.03;
$(document).scroll(function () {
if ($(window).scrollTop() > 10) {
$('.header').addClass('header-fixed');
$('.mail').css('transform','translate(' + percentageMail + 'px, -17px)');
$('.phone').addClass('header-contact-phone');
$('.logotype-wrapper').addClass('logotype-wrapper-fixed');
$('.logotype-wrapper').css( '-webkit-transform', 'translate(-' + transformWidth + 'px,-' + transformHeight + 'px)');
$('.logotype-wrapper').css( '-moz-transform', 'translate(-' + transformWidth + 'px,-' + transformHeight + 'px)');
$('.logotype-wrapper').css( '-ms-transform', 'translate(-' + transformWidth + 'px,-' + transformHeight + 'px)');
$('.logotype-wrapper').css( 'transform', 'translate(-' + transformWidth + 'px,-' + transformHeight + 'px)');
$('.logotype-label').hide();
} else {
$('.header').removeClass('header-fixed');
$('.mail').css('-webkit-transform','none');
$('.mail').css('-ms-transform','none');
$('.mail').css('transform','none');
$('.phone').removeClass('header-contact-phone');
$('.logotype-wrapper').removeClass('logotype-wrapper-fixed');
$('.logotype-wrapper').css( '-webkit-transform', 'none');
$('.logotype-label').show();
}
});
$('.portfolio-image-wrapper').click(function () {
var link = jQuery(this).children('.video-link').html();
$('#portfolio-video').attr('src', link);
$('.portfolio-video-wrapper').show();
$('.video-close').show();
$('.blackout').show();
$('body').css('overflow-y','hidden');
});
$('.video-close').click(function () {
$(this).hide();
$('#portfolio-video').attr('src', "");
$('.portfolio-video-wrapper').hide();
$('.blackout').hide();
$('body').css('overflow-y','visible');
});
feedbackCounter = 0;
feedbacksAmount = $('.feedback-text-wrapper').length;
$('.arrow-right').click(function () {
if (feedbackCounter < feedbacksAmount - 1) {
$('.feedback-text-wrapper').each(function () {
var left = parseInt($(this).css('left'));
var elWidth = $(this).width();
$(this).css('left', left - elWidth);
});
feedbackCounter++;
} else {
$('.feedback-text-wrapper').each(function () {
var left = parseInt($(this).css('left'));
var elWidth = $(this).width();
$(this).css('left', left + (elWidth*(feedbackCounter)));
});
feedbackCounter = 0;
}
});
$('.arrow-left').click(function () {
if (feedbackCounter != 0) {
$('.feedback-text-wrapper').each(function () {
var left = parseInt($(this).css('left'));
var elWidth = $(this).width();
$(this).css('left', left + elWidth);
});
feedbackCounter--;
} else {
$('.feedback-text-wrapper').each(function () {
var left = parseInt($(this).css('left'));
var elWidth = $(this).width();
$(this).css('left', left + (elWidth*(feedbackCounter)));
});
feedbackCounter = 0;
}
});
});