-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
90 lines (65 loc) · 2.28 KB
/
index.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
<?php
require "config.php";
require "src/Partial.php";
require "src/objects/Project.php";
Partial::build('header');
?>
<div class="downArrow" id="downArrow"><a href="#MyWork" title="View Projects"><i class="fa-solid fa-chevron-down"></i></a></div>
<canvas id="threeModel"></canvas>
<!--<canvas class="cropCanvas"></canvas>-->
<img src="assets/img/landingModel.png" id="landingModelImage"></img>
<div id="landingArea">
<div class="row">
<div class="col-50" id="landingText">
<p><?php echo _("Hi, I'm Robert Michels."); ?><br><?php echo _("I design and program"); ?><br><span
class="txt-rotate"
data-period="2000"
data-rotate='["<?php echo _("games.\", \"VR experiences.\", \"mobile apps.\", \"websites."); ?>"]'><?php echo _("digital media."); ?></span></p>
</div>
</div>
</div>
<section class="sectionMedia" id="MyWork">
<?php
$projects = [];
//check if filter set
if(isset($_GET['filter']))
{
// Filter is set
$filter = $_GET['filter'];
$filters [] = $filter;
if (strpos($filter, ',') !== false) {
$filters = explode(',', $filter);
}
$projects = Project::getProjectsByFilter($filters);
//if error in URL, get default
if (isset($projects)) {
if (empty($projects)) {
$projects = Project::getProjects(5);
} else {
//Set cookie
setcookie("visitorFilter", $filter);
}
}
} else {
$projects = Project::getProjects(5);
//Delete cookie if no filter set (in case user manually typed in vanilla url)
setcookie("visitorFilter", "", time() - 3600);
}
foreach ($projects as $project) {
Partial::build('projectTile', ["slug" => $project->getSlug(), "name" => $GLOBALS['english'] ? $project->getName() : $project->getNameDe() , "type" => $GLOBALS['english'] ? $project->getType() : $project->getTypeDe(), "inDevelopment" => $project->getInDevelopment()]);
}
?>
<!-- source: https://codepen.io/fliseno1k/pen/WNboLBy -->
<div class="seeMoreBtn">
<a href="projects">
<span><?php echo _("See More") ?></span>
<div class="liquid"></div>
</a>
</div>
</section>
<script>
console.log("done");
</script>
<?php
Partial::build('footer', ["index" => TRUE]);
?>