-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
115 lines (107 loc) · 3.3 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kode PHP</title>
<style>
.container {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
.card {
border: 1px solid #ccc;
border-radius: 5px;
padding: 20px;
margin: 10px;
cursor: pointer;
width: 30%;
box-sizing: border-box;
text-align: center; /* Center the text */
overflow: hidden; /* Hide overflow content */
transition: height 0.3s ease; /* Smooth transition for height */
}
.content {
display: none;
margin-top: 10px;
overflow: auto; /* Ensure content can be scrolled */
}
</style>
</head>
<body>
<div class="container">
<!-- Existing cards -->
<!-- ... existing code ... -->
<!-- New cards for each PHP file -->
<div class="card" onclick="toggleContent('content4', this)">
<h3>Operator</h3>
<div id="content4" class="content">
<pre>
<?php include 'operator.php'; ?>
</pre>
</div>
</div>
<div class="card" onclick="toggleContent('content5', this)">
<h3>Operator 1</h3>
<div id="content5" class="content">
<pre>
<?php include 'operator1.php'; ?>
</pre>
</div>
</div>
<div class="card" onclick="toggleContent('content6', this)">
<h3>Operator 2</h3>
<div id="content6" class="content">
<pre>
<?php include 'operator2.php'; ?>
</pre>
</div>
</div>
<div class="card" onclick="toggleContent('content7', this)">
<h3>Tipe Data</h3>
<div id="content7" class="content">
<pre>
<?php include 'tipe_data.php'; ?>
</pre>
</div>
</div>
<div class="card" onclick="toggleContent('content8', this)">
<h3>Tipe Data (2)</h3>
<div id="content8" class="content">
<pre>
<?php include 'tipedata.php'; ?>
</pre>
</div>
</div>
<div class="card" onclick="toggleContent('content9', this)">
<h3>Variabel</h3>
<div id="content9" class="content">
<pre>
<?php include 'variabel.php'; ?>
</pre>
</div>
</div>
<div class="card" onclick="toggleContent('content10', this)">
<h3>Variable 1</h3>
<div id="content10" class="content">
<pre>
<?php include 'variable1.php'; ?>
</pre>
</div>
</div>
</div>
<script>
function toggleContent(id, card) {
var content = document.getElementById(id);
if (content.style.display === "none" || content.style.display === "") {
content.style.display = "block";
card.style.height = card.scrollHeight + "px";
} else {
content.style.display = "none";
card.style.height = "auto";
}
}
</script>
</body>
</html>