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