-
Notifications
You must be signed in to change notification settings - Fork 0
/
front-page.php
267 lines (176 loc) · 10.8 KB
/
front-page.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<?php
// Don't load directly
if ( ! defined( 'ABSPATH' ) ) {
die;
}
get_header();
the_post();
if ( get_field( 'home_hero_image' ) ) :
$hero_image = wp_get_attachment_image_src( get_field( 'home_hero_image' ), 'hero-image' );
?>
<section id="home-hero" class="hero-image" style="background-image: url( '<?php echo $hero_image[0];?>' ); height: <?php echo $hero_image[2]; ?>px;">
<div class="row collapse">
<div class="small-12 medium-6 medium-offset-6 columns text-center animate-on-scroll slide-in-right">
<div class="hero-copy">
<div class="vertical-align">
<h1><?php the_field( 'home_hero_header' ); ?></h1>
<a class="secondary large button with-arc" href="#"><?php the_field( 'home_hero_button_text' ); ?></a>
</div>
</div>
</div>
</div>
</section>
<?php endif; ?>
<section id="mini-nav" class="page-icons">
<div class="row">
<div class="small-12 medium-6 medium-centered columns">
<div class="row">
<div class="small-12 medium-4 columns text-center animate-on-scroll scale-in-up">
<a href="/customers/">
<span class="als-icon-stack als-icon-4x">
<span class="als-icon als-icon-stack-2x als-icon-circle"></span>
<span class="als-icon als-icon-stack als-icon-inverse als-icon-customers"></span>
</span><br />
<h6>Customers</h6>
</a>
</div>
<div class="small-12 medium-4 columns text-center animate-on-scroll scale-in-up">
<a href="/carriers/">
<span class="als-icon-stack als-icon-4x">
<span class="als-icon als-icon-stack-2x als-icon-circle"></span>
<span class="als-icon als-icon-stack als-icon-inverse als-icon-carriers"></span>
</span><br />
<h6>Carriers</h6>
</a>
</div>
<div class="small-12 medium-4 columns text-center animate-on-scroll scale-in-up">
<a href="/careers/">
<span class="als-icon-stack als-icon-4x">
<span class="als-icon als-icon-stack-2x als-icon-circle"></span>
<span class="als-icon als-icon-stack als-icon-inverse als-icon-careers"></span>
</span><br />
<h6>Careers</h6>
</a>
</div>
</div>
</div>
</div>
</section>
<section id="home-timeline">
<?php if ( have_rows( 'home_timeline' ) ) :
$index = 0; ?>
<div class="container">
<div class="row">
<div class="timeline-dot"></div>
</div>
<?php if ( $home_timeline_video = get_field( 'home_timeline_video' ) ) : ?>
<div class="row animate-on-scroll fade-in">
<div class="small-12 medium-6 columns text-right">
<div class="queued-animation scale-in-up mui-enter">
<?php echo wp_oembed_get( $home_timeline_video ); ?>
</div>
</div>
<div class="timeline-dot"></div>
<div class="small-12 medium-6 columns text-left">
<h3><?php the_field( 'home_timeline_video_header_text' ); ?></h3>
<?php echo apply_filters( 'the_content', get_field( 'home_timeline_video_content' ) ); ?>
<?php if ( $button_link = get_field( 'home_timeline_video_button_link' ) ) : ?>
<a class="secondary tiny button with-arc" href="<?php echo $button_link; ?>"><?php the_field( 'home_timeline_video_button_text' ); ?></a>
<?php endif; ?>
</div>
</div>
<?php
$index++;
endif; ?>
<?php while ( have_rows( 'home_timeline' ) ) : the_row(); ?>
<div class="row animate-on-scroll fade-in">
<div class="small-12 medium-6 columns text-right">
<?php if ( $index % 2 == 0 ) :
if ( get_sub_field( 'image' ) ) :
echo wp_get_attachment_image( get_sub_field( 'image' ), 'timeline-image', false, array( 'class' => 'queued-animation scale-in-up mui-enter' ) );
endif;
else : ?>
<h3><?php echo get_sub_field( 'title' ); ?></h3>
<?php echo apply_filters( 'the_content', get_sub_field( 'main_text' ) ); ?>
<a class="secondary tiny button with-arc" href="<?php echo get_sub_field( 'button_link' ); ?>"><?php echo get_sub_field( 'button_text' ); ?></a>
<?php endif; ?>
</div>
<div class="timeline-dot"></div>
<div class="small-12 medium-6 columns text-left">
<?php if ( $index % 2 == 0 ) : ?>
<h3><?php echo get_sub_field( 'title' ); ?></h3>
<?php echo apply_filters( 'the_content', get_sub_field( 'main_text' ) ); ?>
<a class="secondary tiny button with-arc" href="<?php echo get_sub_field( 'button_link' ); ?>"><?php echo get_sub_field( 'button_text' ); ?></a>
<?php else :
if ( get_sub_field( 'image' ) ) :
echo wp_get_attachment_image( get_sub_field( 'image' ), 'timeline-image', false, array( 'class' => 'queued-animation scale-in-up mui-enter' ) );
endif;
endif; ?>
</div>
</div>
<?php
$index++;
endwhile; ?>
<div class="row">
<div class="timeline-dot"></div>
</div>
</div>
<?php endif; ?>
</section>
<?php if ( have_rows( 'home_row_sections' ) ) :
$index = 0;
// Create styles dynamically
$styles = '';
while ( have_rows( 'home_row_sections' ) ) : the_row();
// Don't show sections without Hero Images.
if ( ( get_sub_field( 'hero_image' ) && ( get_sub_field( 'hero_image' ) !== '' ) ) ) :
$hero_image = wp_get_attachment_image_src( get_sub_field( 'hero_image' ), 'hero-image' );
$button_size = get_sub_field( 'button_size' );
if ( $button_size == 'default' ) $button_size = '';
$styles .= "#home-footer-hero-$index { color:";
$styles .= get_sub_field( 'text_color' ) . '; }';
$styles .= "#home-footer-hero-$index h1, #home-footer-hero-$index h2, #home-footer-hero-$index h3, #home-footer-hero-$index h4, #home-footer-hero-$index h5, #home-footer-hero-$index h6 { color:";
$styles .= get_sub_field( 'header_color' ) . '; }';
?>
<section id="home-footer-hero-<?php echo $index; ?>" class="home-footer-hero hero-image" style="background-image: url( '<?php echo ( ( $index % 2 == 1 ) ? $hero_image[0] : '' ); ?>' ); height: <?php echo $hero_image[2]; ?>px;">
<?php if ( $index % 2 == 0 ) : ?>
<div class="row collapse">
<div class="small-12 medium-6 columns animate-on-scroll scale-in-up text-center">
<div class="hero-copy" style="height: <?php echo $hero_image[2]; ?>px">
<div class="vertical-align">
<?php echo wp_get_attachment_image( get_sub_field( 'hero_image' ), 'timeline-image' ); ?>
</div>
</div>
</div>
<div class="small-12 medium-6 animate-on-scroll slide-in-right columns text-center">
<div class="hero-copy text" style="height: <?php echo $hero_image[2]; ?>px">
<div class="vertical-align">
<?php echo apply_filters( 'the_content', get_sub_field( 'hero_text' ) ); ?>
<a class="secondary <?php echo ( ( $button_size !== '' ) ? $button_size . ' ' : '' ); ?>button with-arc" href="<?php echo get_sub_field( 'button_link' ); ?>"><?php echo html_entity_decode( get_sub_field( 'button_text' ) ); ?></a>
</div>
</div>
</div>
</div>
<?php else : ?>
<div class="row collapse">
<div class="small-12 medium-6 columns text-center animate-on-scroll slide-in-left">
<div class="hero-copy" style="height: <?php echo $hero_image[2]; ?>px">
<div class="vertical-align">
<?php echo apply_filters( 'the_content', get_sub_field( 'hero_text' ) ); ?>
<a class="secondary <?php echo ( ( $button_size !== '' ) ? $button_size . ' ' : '' ); ?>button with-arc" href="<?php echo get_sub_field( 'button_link' ); ?>"><?php echo html_entity_decode( get_sub_field( 'button_text' ) ); ?></a>
</div>
</div>
</div>
</div>
<?php endif; ?>
</section>
<?php
// Only increment if the section was shown
$index++;
endif;
endwhile; ?>
<style type="text/css">
<?php echo $styles; ?>
</style>
<?php endif;
get_footer();