frontview 2.1.3 → 2.2.3.pre.beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,214 +4,41 @@ module Frontview
4
4
  def write_in_main_file
5
5
  File.open("app/javascript/packs/main.js", "w+") {
6
6
  |file| file.puts(
7
- "(function ($)
8
- { \"use strict\"
9
-
10
- /* Proloder */
11
- $(window).on('load', function () {
12
- $('#preloader-active').delay(450).fadeOut('slow');
13
- $('body').delay(450).css({
14
- 'overflow': 'visible'
15
- });
16
- });
17
-
18
- /* slick Nav */
19
- // mobile_menu
20
- var menu = $('ul#navigation');
21
- if(menu.length){
22
- menu.slicknav({
23
- prependTo: \".mobile_menu\",
24
- closedSymbol: '+',
25
- openedSymbol:'-'
26
- });
27
- };
28
-
29
- /* MainSlider-1 */
30
- function mainSlider() {
31
- var BasicSlider = $('.slider-active');
32
- BasicSlider.on('init', function (e, slick) {
33
- var $firstAnimatingElements = $('.single-slider:first-child').find('[data-animation]');
34
- doAnimations($firstAnimatingElements);
35
- });
36
- BasicSlider.on('beforeChange', function (e, slick, currentSlide, nextSlide) {
37
- var $animatingElements = $('.single-slider[data-slick-index=\"' + nextSlide + '\"]').find('[data-animation]');
38
- doAnimations($animatingElements);
39
- });
40
- BasicSlider.slick({
41
- autoplay: false,
42
- autoplaySpeed: 10000,
43
- dots: false,
44
- fade: true,
45
- arrows: false,
46
- prevArrow: '<button type=\"button\" class=\"slick-prev\"><i class=\"ti-shift-left\"></i></button>',
47
- nextArrow: '<button type=\"button\" class=\"slick-next\"><i class=\"ti-shift-right\"></i></button>',
48
- responsive: [{
49
- breakpoint: 1024,
50
- settings: {
51
- slidesToShow: 1,
52
- slidesToScroll: 1,
53
- infinite: true,
54
- }
55
- },
56
- {
57
- breakpoint: 991,
58
- settings: {
59
- slidesToShow: 1,
60
- slidesToScroll: 1,
61
- arrows: false
62
- }
63
- },
64
- {
65
- breakpoint: 767,
66
- settings: {
67
- slidesToShow: 1,
68
- slidesToScroll: 1,
69
- arrows: false
70
- }
71
- }
72
- ]
73
- });
74
-
75
- function doAnimations(elements) {
76
- var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
77
- elements.each(function () {
78
- var $this = $(this);
79
- var $animationDelay = $this.data('delay');
80
- var $animationType = 'animated ' + $this.data('animation');
81
- $this.css({
82
- 'animation-delay': $animationDelay,
83
- '-webkit-animation-delay': $animationDelay
84
- });
85
- $this.addClass($animationType).one(animationEndEvents, function () {
86
- $this.removeClass($animationType);
87
- });
88
- });
89
- }
90
- }
91
- mainSlider();
92
-
93
- /* Applic App */
94
- var client_list = $('.app-active');
95
- if(client_list.length){
96
- client_list.owlCarousel({
97
- slidesToShow: 3,
98
- slidesToScroll: 1,
99
- loop: true,
100
- autoplay:true,
101
- speed: 3000,
102
- smartSpeed:2000,
103
- dots: false,
104
- margin: 15,
105
- nav : false,
106
- navText : [\"<i class='fas fa-arrow-left'></i>\",\"<i class='fas fa-arrow-right'></i>\"],
107
- autoplayHoverPause: true,
108
- responsive : {
109
- 0 : {
110
- items: 1
111
- },
112
- 768 : {
113
- items: 2
114
- },
115
- 992 : {
116
- items: 2
117
- },
118
- 1200:{
119
- items: 4
120
- }
121
- }
122
- });
123
- }
124
-
125
- // Pop Up Window
126
- $(window).load(function () {
127
- $(\".trigger_popup_fricc\").click(function(){
128
- $('.hover_bkgr_fricc').show();
129
- });
130
- $('.hover_bkgr_fricc').click(function(){
131
- $('.hover_bkgr_fricc').hide();
132
- });
133
- $('.popupCloseButton').click(function(){
134
- $('.hover_bkgr_fricc').hide();
135
- });
136
- });
137
-
138
- $(window).load(function () {
139
- $(\".trigger_popup_fricc2\").click(function(){
140
- $('.hover_bkgr_fricc2').show();
141
- });
142
- $('.hover_bkgr_fricc2').click(function(){
143
- $('.hover_bkgr_fricc2').hide();
144
- });
145
- $('.popupCloseButton').click(function(){
146
- $('.hover_bkgr_fricc2').hide();
147
- });
148
- });
149
-
150
- $(window).load(function () {
151
- $(\".trigger_popup_fricc3\").click(function(){
152
- $('.hover_bkgr_fricc3').show();
153
- });
154
- $('.hover_bkgr_fricc3').click(function(){
155
- $('.hover_bkgr_fricc3').hide();
156
- });
157
- $('.popupCloseButton').click(function(){
158
- $('.hover_bkgr_fricc3').hide();
159
- });
160
- });
161
-
162
- /* Nice Selectorp */
163
- var nice_Select = $('select');
164
- if(nice_Select.length){
165
- nice_Select.niceSelect();
166
- }
167
-
168
- /* Custom Sticky Menu */
169
- $(window).on('scroll', function () {
170
- var scroll = $(window).scrollTop();
171
- if (scroll < 245) {
172
- $(\".header-sticky\").removeClass(\"sticky-bar\");
7
+ "// Sticky Header
8
+ $(window).scroll(function() {
9
+ if ($(window).scrollTop() > 100) {
10
+ $('.main_h').addClass('sticky');
173
11
  } else {
174
- $(\".header-sticky\").addClass(\"sticky-bar\");
12
+ $('.main_h').removeClass('sticky');
175
13
  }
176
14
  });
177
15
 
178
- $(window).on('scroll', function () {
179
- var scroll = $(window).scrollTop();
180
- if (scroll < 245) {
181
- $(\".header-sticky\").removeClass(\"sticky\");
16
+ // Mobile Navigation
17
+ $('.mobile-toggle').click(function() {
18
+ if ($('.main_h').hasClass('open-nav')) {
19
+ $('.main_h').removeClass('open-nav');
182
20
  } else {
183
- $(\".header-sticky\").addClass(\"sticky\");
21
+ $('.main_h').addClass('open-nav');
184
22
  }
185
23
  });
186
24
 
187
- /* sildeBar scroll */
188
- $.scrollUp({
189
- scrollName: 'scrollUp',
190
- topDistance: '300',
191
- topSpeed: 300,
192
- animation: 'fade',
193
- animationInSpeed: 200,
194
- animationOutSpeed: 200,
195
- scrollText: \"↑\",
196
- activeOverlay: false,
25
+ $('.main_h li a').click(function() {
26
+ if ($('.main_h').hasClass('open-nav')) {
27
+ $('.navigation').removeClass('open-nav');
28
+ $('.main_h').removeClass('open-nav');
29
+ }
197
30
  });
198
31
 
199
- /* data-background */
200
- $(\"[data-background]\").each(function () {
201
- $(this).css(\"background-image\", \"url(\" + $(this).attr(\"data-background\") + \")\")
202
- });
203
-
204
- // Pop Up Img
205
- var popUp = $('.single_gallery_part, .img-pop-up');
206
- if(popUp.length){
207
- popUp.magnificPopup({
208
- type: 'image',
209
- gallery:{
210
- enabled:true
211
- }
212
- });
213
- }
214
- })(jQuery);"
32
+ // navigation scroll
33
+ $('nav a').click(function(event) {
34
+ var id = $(this).attr(\"href\");
35
+ var offset = 70;
36
+ var target = $(id).offset().top - offset;
37
+ $('html, body').animate({
38
+ scrollTop: target
39
+ }, 500);
40
+ event.preventDefault();
41
+ });"
215
42
  )
216
43
  }
217
44
  end