-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakanankhas.php
207 lines (180 loc) · 8.29 KB
/
makanankhas.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
<!DOCTYPE html>
<html lang="en" data-bs-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Makanan Khas</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
<script src="https://kit.fontawesome.com/25b07c5e9c.js" crossorigin="anonymous"></script>
<style>
/* makanankhas.php saja */
.hover-shadow {
border: 0;
background-color: var(--bs-tertiary-bg);
}
.hover-shadow:hover {
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);
-webkit-transform: scale(1.03);
transform: scale(1.03);
}
.image-container {
position: relative;
width: 100%;
/* Mengatur aspek rasio menjadi 16:9 */
padding-top: 56.25%;
/* 9 / 16 * 100% */
/* Jika Anda ingin menggunakan padding-bottom, gunakan properti ini: */
/* padding-bottom: 56.25%; */
}
.image-container img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
</style>
</head>
<body>
<!-- Navbar -->
<?php include 'navbar.php'; ?>
<!-- End navbar -->
<!-- Header -->
<div>
<img src="img/makanan/header.jpeg" class="w-100">
</div>
<!-- End Header -->
<!-- Makanan-makanan khas di Wonosobo -->
<div class="container my-5">
<div class="text-center mb-5">
<h1>Makanan Khas di Wonosobo</h1>
</div>
<div class="row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4">
<?php
include 'connect.php';
$query = "SELECT * FROM tabel_makanan_khas ORDER BY makanan_khas_id DESC";
$datas = $conn->query($query);
foreach ($datas as $data) :
?>
<div class="col">
<div class="card h-100 rounded-4 hover-shadow">
<a type="button" class="link-body-emphasis text-decoration-none" data-bs-toggle="modal" data-bs-target="#exampleModal<?= $data['makanan_khas_id'] ?>">
<div class="image-container">
<img src="<?= $data['img_makanan_khas'] ?>" class="card-img-top rounded-top-4" alt="...">
</div>
<div class="card-body">
<h5 class="card-title"><?= $data['nama_makanan_khas'] ?></h5>
</div>
</a>
</div>
</div>
<!-- Detail Makanan khas -->
<div class="modal fade" id="exampleModal<?= $data['makanan_khas_id'] ?>" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content rounded-4">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel"><?= $data['nama_makanan_khas'] ?></h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<img src="<?= $data['img_makanan_khas'] ?>" class="rounded-4 w-100">
<h2 class="my-4"><?= $data['nama_makanan_khas'] ?></h2>
<p style="text-align: justify;"><?= $data['deskripsi_makanan_khas'] ?></p>
</div>
</div>
</div>
</div>
<!-- End Detail Makanan khas -->
<?php endforeach ?>
</div>
</div>
<!-- End Makanan-makanan khas di Wonosobo -->
<!-- Footer -->
<?php include 'footer.php'; ?>
<!-- End Footer -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
<script>
/*!
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors
* Licensed under the Creative Commons Attribution 3.0 Unported License.
*/
(() => {
'use strict'
const getStoredTheme = () => localStorage.getItem('theme')
const setStoredTheme = theme => localStorage.setItem('theme', theme)
const getPreferredTheme = () => {
const storedTheme = getStoredTheme()
if (storedTheme) {
return storedTheme
}
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
}
const setTheme = theme => {
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark')
} else {
document.documentElement.setAttribute('data-bs-theme', theme)
}
}
setTheme(getPreferredTheme())
const showActiveTheme = (theme, focus = false) => {
const themeSwitcher = document.querySelector('#bd-theme')
if (!themeSwitcher) {
return
}
const themeSwitcherText = document.querySelector('#bd-theme-text')
const activeThemeIcon = document.querySelector('.theme-icon-active')
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`)
const iconOfActiveBtn = btnToActive.querySelector('i').dataset.themeIcon
document.querySelectorAll('[data-bs-theme-value]').forEach(element => {
element.classList.remove('active')
element.setAttribute('aria-pressed', 'false')
})
btnToActive.classList.add('active')
btnToActive.setAttribute('aria-pressed', 'true')
activeThemeIcon.classList.remove(activeThemeIcon.dataset.themeIconActive)
activeThemeIcon.classList.add(iconOfActiveBtn)
activeThemeIcon.dataset.iconActive = iconOfActiveBtn
const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`
themeSwitcher.setAttribute('aria-label', themeSwitcherLabel)
if (focus) {
themeSwitcher.focus()
}
}
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
const storedTheme = getStoredTheme()
if (storedTheme !== 'light' && storedTheme !== 'dark') {
setTheme(getPreferredTheme())
}
})
window.addEventListener('DOMContentLoaded', () => {
showActiveTheme(getPreferredTheme())
document.querySelectorAll('[data-bs-theme-value]')
.forEach(toggle => {
toggle.addEventListener('click', () => {
const theme = toggle.getAttribute('data-bs-theme-value')
setStoredTheme(theme)
setTheme(theme)
showActiveTheme(theme, true)
})
})
})
})()
</script>
<script>
$(window).scroll(function() {
var navbar = $(".navbar");
var scroll = $(window).scrollTop();
if (scroll > 0) {
navbar.addClass("navbar-scrolled");
} else {
navbar.removeClass("navbar-scrolled");
}
});
</script>
</body>
</html>