-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.html
More file actions
127 lines (115 loc) · 3.81 KB
/
main.html
File metadata and controls
127 lines (115 loc) · 3.81 KB
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
<!DOCTYPE html>
<html lang="fa">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="apple-touch-icon" href="icon.jpg">
<title>فهرست مطالب</title>
<style>
@font-face {
font-family: 'ANafis';
src: url('fonts/ANafis.ttf') format('truetype');
}
h2, button {
font-family: 'ANafis';
}
body {
background-color: #f4f4f9;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
direction: rtl;
}
.container {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: #fff;
}
h2 {
color: #2B4D8D;
margin-bottom: 15px;
}
#searchBox {
user-select: none;
width: 90%;
max-width: 400px;
padding: 10px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 8px;
margin-bottom: 15px;
outline: none;
transition: 0.3s;
}
#searchBox:focus {
border-color: #2B4D8D;
box-shadow: 0 0 5px rgba(43, 77, 141, 0.5);
}
.btn {
display: block;
user-select: none;
width: 90%;
max-width: 400px;
background-color: #2B4D8D;
color: #fff;
border-radius: 8px;
border: none;
padding: 12px;
margin: 10px 0;
font-size: 16px;
cursor: pointer;
transition: all 0.3s;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
position: relative;
}
.btn:hover {
background-color: #1B3E70;
transform: translateY(-3px);
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}
.btn:active {
transform: translateY(1px);
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}
.hidden {
display: none;
}
</style>
</head>
<body>
<div class="container">
<h2>فهرست مطالب</h2>
<input type="text" id="searchBox" placeholder="جستجو کنید...">
<button class="btn" data-link="dastan/python.html">داستان ممد و امیر | یادگیری پایتون</button>
<button class="btn" data-link="dastan/website.html">داستان ممد و امیر | راهاندازی وبسایت</button>
<button class="btn" data-link="https://example.com/test">مطالب آزمایشی</button>
<button class="btn" data-link="dastan/program.html">داستان ممد و کینگ آلفا | شروع برنامع نویسی</button>
</div>
<script>
// جستجوی لحظهای
document.getElementById("searchBox").addEventListener("input", function() {
let searchValue = this.value.toLowerCase();
let buttons = document.querySelectorAll(".btn");
buttons.forEach(button => {
if (button.innerText.toLowerCase().includes(searchValue)) {
button.classList.remove("hidden");
} else {
button.classList.add("hidden");
}
});
});
// هدایت به لینک هنگام کلیک روی دکمه
document.querySelectorAll(".btn").forEach(button => {
button.addEventListener("click", function() {
let link = this.getAttribute("data-link");
window.location.href = link; // هدایت کاربر به لینک مربوطه
});
});
</script>
</body>
</html>