-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
53 lines (50 loc) · 2.16 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
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Home - Loja Virtual</title>
<link rel="stylesheet" href="css/css.css">
</head>
<body>
<header>
<h1 class="header-logo"><a href="#"><img src="http://fakeimg.pl/200x80/1C140D/CBE86B/?text=LOGO+200x80&font_size=30&font=roboto" /></a></h1>
<?php
$menuUrl = "json/menu.json";
$arrMenu = json_decode(file_get_contents($menuUrl), true);
echo "<nav class=\"top-menu\"><ul>";
foreach ($arrMenu["menu"] as $option) {
echo "<li><a href=\"#\" class=\"" . $option["slug"] . "\">" . $option["titulo"] . "</a></li>";
}
echo "</ul></nav>";
?>
</header>
<section class="container">
<?php
$productsUrl = "json/products.json";
$arrProducts = json_decode(file_get_contents($productsUrl), true);
echo "<ul class=\"product-list\">";
foreach ($arrProducts["produtos"] as $item) {
echo "<li class=\"item " . $item["slug"] . "\">
<a href=\"#\">
<span class=\"image-container\"><img class=\"image\" src=\"" . $item["thumbnail"] . "\" /></span>
<span class=\"name\">" . $item["nome"] . "</span>
<span class=\"price-container\"><span class=\"currency\">R$</span> <span class=\"price\">" . $item["preco"] . "</span></span>
</a>
</li>";
}
echo "</ul>";
?>
</section>
<footer>
<a href="#" class="footer-logo"><img src="http://fakeimg.pl/200x80/d8d8d8/999/?text=LOGO+200x80&font_size=30&font=roboto" /></a>
<?php
echo "<nav class=\"bottom-menu\"><ul>";
foreach ($arrMenu["menu"] as $option) {
echo "<li><a href=\"#\" class=\"" . $option["slug"] . "\">" . $option["titulo"] . "</a></li>";
}
echo "</ul></nav>";
?>
</footer>
</body>
</html>