forked from BuildTheEarth-Italia/Wordpress-Theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
121 lines (104 loc) · 4.73 KB
/
home.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
<?php
//stampo header
get_header();
// Richiedo lo script per il testo mobile
wp_enqueue_script('bte_text_changer');
//ottengo le foto
$photos = get_photos_from_bte_theme_showcase();
if (count($photos) > 0)
//importo script per galleria
wp_enqueue_script('bte_script_gallery');
$discordInvite = get_option('bte_discord_url', 'https://discord.com/invite/dMahHCH');
if (get_option('bte_discord_add_utm'))
$discordInvite .= '?utm_source=bteitalia.it&utm_medium=discord&utm_content=';
$discordWidget = get_option('bte_discord_widget', 'https://discordapp.com/widget?id=686910132017430538&theme=light');
?>
<div class="welcomeCover custom-background lax" data-lax-translate-y="0 0, 600 -80"></div>
<section class="panel welcomePanel lax" data-lax-opacity="80 1, 180 0" data-lax-translate-y="0 -0, 100 -25, 210 -40">
<h1 class="staticText"><?= get_option('bte_main_sentence'); ?></h1>
<h2 class="dynamicText underlined">su Build The Earth Italia</h2>
</section>
<div class="grass"></div>
<section class="panel commonPanel" id="chi-siamo">
<div class="box">
<div class="text">
<h1 class="title">Chi siamo</h1>
<p class="description"><i>Build The Earth Italia</i> è una community che nasce durante il Lockdown <wbr>per gestire il progetto <abbr translate="no" title="Build The Earth">BTE</abbr> nella nostra nazione 🇮🇹.</p>
</div>
<img class="model rounded" src="<?= get_template_directory_uri(); ?>/resources/castelloCornedoSquared.png" alt="Castello di Cornedo in Minecraft" loading="lazy">
</div>
</div>
</section>
<section class="panel commonPanel reverse" id="il-progetto">
<div class="box">
<div class="text">
<h1 class="title">Il nostro progetto</h1>
<p class="description">Noi di <i><abbr translate="no" title="Build The Earth">BTE</abbr> Italia</i> ci occupiamo di portare avanti un ambizioso progetto, <wbr>quello di ricostruire la Terra in scala reale su Minecraft, <wbr>direttamente dal proprio PC!</p>
</div>
<img class="model rounded" src="<?= get_template_directory_uri(); ?>/resources/ponteSquared.png" alt="Ponte in Minecraft" loading="lazy">
</div>
</div>
</section>
<section class="panel commonPanel" id="perche">
<div class="box">
<div class="text">
<h1 class="title">Perché?</h1>
<p class="description">Con l'avvento di Internet possiamo scoprire nuove culture, idee e persone. <wbr>Proprio su questo si basa <i><abbr translate="no" title="Build The Earth">BTE</abbr> Italia</i>, mostrare le bellezze dell'Italia agli altri.</p>
</div>
<img class="model rounded" src="<?= get_template_directory_uri(); ?>/resources/centroCommercialeSquared.png" alt="Centro commerciale in Minecraft" loading="lazy">
</div>
</div>
</section>
<section class="panel textMediaPanel" id="partecipa">
<div class="box">
<div class="text">
<h1 class="title">Partecipa</h1>
<p class="description">Sei interessato? Vuoi partecipare?<br>Tutto quello che devi fare è entrare <wbr>nel server Discord!</p>
</div>
<iframe class="media" loading="lazy" allowtransparency="true" frameborder="0" src="<?= $discordWidget; ?>"></iframe>
<a href="<?= $discordInvite . (get_option('bte_discord_add_utm') ? 'mobile' : ''); ?>" title="Il nostro server Discord" class="discordJoinButton">Unisciti</a>
</div>
</section>
<?php
if (count($photos) > 0) { ?>
<section class="panel galleryPanel" id="galleria">
<div class="box">
<div class="text">
<h1 class="title">Galleria</h1>
</div>
<div class="gallery">
<div class="slider lax animateMargin" data-lax-translate-x="2400 50, 3800 -150">
<?php
//itero liste foto per stamparle in html
foreach ($photos as $id => $photo) {
$path = $photo->path;
// Cambio url in https se la connessione corrente lo è
if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443 || (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'))
$path = str_replace("http://", "https://", $path);
?>
<figure class="media" data-gallery-id="<?= $id ?>">
<img class="image" src="<?= $path ?>" class="media" loading="lazy" alt="<?= $photo->title ?> - <?= $photo->description ?>" draggable="false" />
</figure>
<?php } ?>
</div>
</div>
</div>
</section>
<?php } ?>
<script>
window.sentences = [
<?php
$sentences = str_replace("'", "\\'", get_option('bte_second_sentences'));
$sentences_list = explode("\n", $sentences);
echo str_replace(
array("\r", "\n"),
"",
"'" . implode("', '", $sentences_list) . "'"
);
?>
];
</script>
<?php
//stampo footer
get_footer();
?>