-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-iispmun_editions.php
210 lines (179 loc) · 6.78 KB
/
single-iispmun_editions.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
<?php get_header( null, ['title' => 'IISP Model United Nations ' . get_the_title() . ' - IISP MUN'] );
global $post;
global $edition;
$edition = $post;
?>
<section id="countdown">
<img src="<?php echo get_template_directory_uri();?>/images/iisp-adminblock-1.jpeg">
<div class="countdown-container">
<div class="countdown-title">IISP MUN Countdown!</div>
<div id="countdown-timer">
<div class="timer">
<div class="timer-number">
<div id="days0"><?php the_field("start_date");?></div>
<div id="days1"></div>
<div id="days2"></div>
</div>
<div class="timer-subtitle">Days</div>
</div>
<div class="colon">
<div></div>
<div></div>
</div>
<div class="timer">
<div class="timer-number">
<div id="hours0"></div>
<div id="hours1"></div>
</div>
<div class="timer-subtitle">Hours</div>
</div>
<div class="colon">
<div></div>
<div></div>
</div>
<div class="timer">
<div class="timer-number">
<div id="minutes0"></div>
<div id="minutes1"></div>
</div>
<div class="timer-subtitle">Minutes</div>
</div>
</div>
<div class="countdown-dates">
<span>
<?php echo DateTime::createFromFormat('M j, Y g:i', get_field("start_date") )->format( "D, F j" );?>
</span>
<span class="to">to</span>
<span class="hyphen"> - </span>
<span><?php the_field("end_date");?></span>
</div>
<div class="countdown-text"><?php the_field("short_description");?></div>
<script>
const countDownDate = new Date(document.getElementById("days0").innerHTML).getTime();
function updateCountdown() {
let now = new Date().getTime();
let distance = countDownDate - now;
let days = Math.floor(distance / (1000 * 60 * 60 * 24));
let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
days = String(days).padStart(3, '0');
hours = String(hours).padStart(2, '0');
minutes = String(minutes).padStart(2, '0');
if (days.at(0) === "0") {
document.getElementById("days0").hidden = true;
}
document.getElementById("days0").innerHTML = days.at(0)
document.getElementById("days1").innerHTML = days.at(1)
document.getElementById("days2").innerHTML = days.at(2)
document.getElementById("hours0").innerHTML = hours.at(0)
document.getElementById("hours1").innerHTML = hours.at(1)
document.getElementById("minutes0").innerHTML = minutes.at(0)
document.getElementById("minutes1").innerHTML = minutes.at(1)
if (distance < 0) {
clearInterval(x);
document.getElementById("demo").innerHTML = "EXPIRED";
}
}
updateCountdown()
const x = setInterval(updateCountdown, 60000);
</script>
</div>
</section>
<section id="theme">
<h1>
<?php
$theme = explode( " ", get_field( "theme" ) );
foreach ( $theme as $word ) {
echo "<span>" . $word . " </span>";
}?>
</h1>
<div class="theme-container">
<div class="logo">
<?php
$custom_logo_id = get_theme_mod( 'custom_logo' );
if ( $custom_logo_id ) {
echo wp_get_attachment_image( $custom_logo_id, 'full', false, array( 'loading' => false ) );
}?>
</div>
<div class="theme-description"><p><?php the_field( "theme_description" );?></p></div>
</div>
<div><p><?php the_field( "long_description" );?></p></div>
<h1><span>IISP MUN</span> Committees</h1>
</section>
<?php
get_template_part( 'template-parts/template', 'all-committees' );
echo do_shortcode("[instagram-feed feed=1]");?>
<section id="letters">
<?php
$people = array();
foreach ( get_field( "letters", $edition ) as $person ) {
$post = $person;
setup_postdata( $post );
$people[] = $person;?>
<div class="letter-container" style="display: none">
<div class="letter-dp">
<a href="<?php the_permalink();?>">
<img src="<?php the_field( "profile_picture" );?>">
</a>
</div>
<div class="letter-text">
<a href="<?php the_permalink();?>">
<span class="name"><?php the_title();?></span>
</a>
<span class="position"><?php the_field( "position" );?></span>
<p class="letter"><?php the_field( "letter" );?></p>
</div>
</div>
<?php
} ?>
<div class="people-list">
<?php
$i = 0;
foreach ( $people as $post ) {
?>
<a class="dp-container">
<div>
<img src="<?php the_field( "profile_picture", $post );?>" onclick="showLetter(<?php echo $i;?>)">
</div>
</a>
<?php
$i++;
} ?>
</div>
<script>
const letters = document.getElementsByClassName("letter-container")
function showLetter(n) {
for (let i = 0; i < letters.length; i++) {
if (i === n) {
letters[i].style.display = "flex";
}
else {
letters[i].style.display = "none";
}
}
}
showLetter(0)
</script>
</section>
<?php
$query = new WP_Query( array( "numberposts" => 1, "posts_per_page" => 1, "post_status" => "publish" ) );
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
get_template_part( 'template-parts/template', 'post-preview' );
} } ?>
<section id="countries">
<h2>Countries Represented at Indus</h2>
<div class="flags-container">
<?php
$images = acf_photo_gallery( "countries", $edition->ID );
foreach ( $images as $image ) {?>
<div class="flag">
<img src="<?php echo $image['full_image_url'];?>">
</div>
<?php
}
?>
</div>
</section>
<?php get_footer();?>