-
Notifications
You must be signed in to change notification settings - Fork 1
/
footer.php
198 lines (162 loc) · 5.26 KB
/
footer.php
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
</section>
<footer id="colophon" class="site-footer">
<div class="footer-thumb">
<?php
$footerThumb = get_field('footer_image','options');
echo wp_get_attachment_image($footerThumb['ID'], 'thumbnail');
?>
</div>
<div class="footer-disclaimer">
<p><?php the_field('footer_discalimer', 'options'); ?> <a href="<?php the_field('footer_privacy_link','options'); ?>"><?php the_field('footer_privacy_link_text','options'); ?></a></p>
</div>
<?php
if( have_rows('social_media_links', 'options') ):
echo '<div class="footer-socials">';
while ( have_rows('social_media_links', 'options') ) : the_row();
$socialThumb = get_sub_field('icon');
echo '<a href="'.get_sub_field('link_to_social_media').'" target="_blank" rel="nofollow">';
echo wp_get_attachment_image($socialThumb['ID'], 'thumbnail');
echo '</a>';
endwhile;
echo '</div>';
endif;
?>
</footer><!-- #colophon -->
<div class="cookies">
<div class="cookie-con">
<div class="cookie-content">
<h3><?php the_field('cookie_headline', 'options'); ?></h3>
<?php the_field('cookie_text', 'options'); ?>
</div>
<div class="cookie-bar">
<div class="cookie-links">
<?php
if( have_rows('cookie_links', 'options') ):
while ( have_rows('cookie_links', 'options') ) : the_row();
echo '<a href="'.get_sub_field('cookie_link').'">'.get_sub_field('link_text').'</a>';
endwhile;
endif;
?>
</div>
<div class="cookie-btn">
<p><?php the_field('cookie_accept_text', 'options'); ?></p>
</div>
</div>
</div>
</div>
</div><!-- #page -->
<script type="text/javascript">
jQuery(document).ready(function($) {
if(typeof(Storage)!=="undefined") {
if (localStorage.wookie != "n") {
var cHeight = $('.cookies').innerHeight();
$('.cookies').css('top','calc( 100% - '+cHeight+'px )');
}
}
$('.footer-thumb').click(function() {
localStorage.wookie = "o";
var cHeight = $('.cookies').innerHeight();
$('.cookies').css('top','calc( 100% - '+cHeight+'px )');
})
$('.cookies .cookie-btn').click( function() {
localStorage.wookie = "n";
$('.cookies').css('top','100%');
});
$('.res-btn').click(function() {
$('.menu-main-menu-container').toggleClass('res-open');
});
});
</script>
<?php if($GLOBALS['galvar'] > 0) { ?>
<lightbox lightboxnum="<?php echo $GLOBALS['galvar']; ?>">
<div class="scrubber">
<div class="scrubber-ikon"></div>
<h4>Henter Billede</h4>
</div>
<div class="lightbox-img-con">
</div>
<div class="nav-btn lightbox-close">X</div>
<?php if($GLOBALS['galvar'] > 1) { ?>
<div class="nav-btn nav-btn-prev lightbox-prev"><</div>
<div class="nav-btn nav-btn-next lightbox-next">></div>
<?php } ?>
<p></p>
</lightbox>
<script type="text/javascript">
jQuery(document).ready(function($) {
var loadedimgurl = "";
var loadedimgtext = "";
var relnum = 0;
var relmax = 0;
var btn_act = 0;
$('#main figure').click(function() {
loadedimgurl = $(this).attr('galurl');
loadedimgtext = $(this).find('figcaption').text();
relnum = parseInt($(this).attr('galnum'));
relmax = parseInt($('lightbox').attr('lightboxnum'));
$('lightbox').fadeIn(1000, function() {
imgloader(loadedimgurl);
});
});
$('.lightbox-close').click(function() {
$('lightbox').fadeOut(1000, function() {
$('.lightbox-img-con').css('display','none');
$('lightbox p').css('display','none');
});
});
$(document).keyup(function(e) {
if (e.keyCode == 27) { // escape key maps to keycode `27`
$('lightbox').fadeOut(1000, function() {
$('.lightbox-img-con').css('display','none');
$('lightbox p').css('display','none');
});
}
});
$('.lightbox-next').click(function() {
if(btn_act == 0) {
btn_act = 1;
$('lightbox p').fadeOut(500);
$('.lightbox-img-con').fadeOut(1000, function() {
relnum++;
if(relnum>relmax) { relnum = 1; }
loadedimgurl = $('figure[galnum="'+relnum+'"]').attr('galurl');
loadedimgtext = $('figure[galnum="'+relnum+'"]').find('figcaption').text();
imgloader(loadedimgurl);
});
}
});
$('.lightbox-prev').click(function() {
if(btn_act == 0) {
btn_act = 1;
$('lightbox p').fadeOut(500);
$('.lightbox-img-con').fadeOut(1000, function() {
relnum--;
if(relnum < 1) { relnum = relmax; }
loadedimgurl = $('figure[galnum="'+relnum+'"]').attr('galurl');
loadedimgtext = $('figure[galnum="'+relnum+'"]').find('figcaption').text();
imgloader(loadedimgurl);
});
}
});
function imgloader(filename) {
$.ajax({
url: filename,
type: 'GET',
dataType: 'html',
success: function(data, textStatus, xhr) {
btn_act = 0;
//$('lightbox img').attr('src',filename);
$('.lightbox-img-con').css('background-image', 'url('+filename+')')
$('lightbox p').text(loadedimgtext);
$('.lightbox-img-con').fadeIn(500);
//$('lightbox img').fadeIn(500);
$('lightbox p').delay(500).fadeIn(500);
}
});
}
})
</script>
<?php } ?>
<?php wp_footer(); ?>
</body>
</html>