-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
173 lines (140 loc) · 90.5 KB
/
index.html
File metadata and controls
173 lines (140 loc) · 90.5 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
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
<!DOCTYPE html>
<html lang="fa">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/styles.css"> <!-- لینک به فایل CSS -->
<head>
<h4> برای جمع کردن سکه روی تصویر زیر بزن</h4>
<img id="clickImage" src="https://imgurl.ir/uploads/r194815__.png" alt="Click to earn coins">
<style>
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 2vh;
background-color: #f9f9f9;
color: black; /\* رنگ متن \*/
}
#clickImage {
width: 300px; /\* اندازه تصویر \*/
cursor: pointer;
margin-bottom: 2px;
}
button {
padding: 10px 10px;
font-size: 16px;
cursor: pointer;
margin: 2px;
background-color: white; /\* رنگ پسزمینه دکمه \*/
color: black; /\* رنگ متن دکمه \*/
border: 2px solid black; /\* رنگ حاشیه \*/
border-radius: 5px;
}
#sCoinDisplay, #profitDisplay {
margin-top: 10px;
font-size: 1.5em;
}
#cornerDisplay {
position: fixed;
top: 10px;
right: 10px;
font-size: 1.5em;
background: rgba(255, 255, 255, 0.8); /\* رنگ سفید هایلایت \*/
padding: 10px;
border-radius: 10px;
color: black; /\* رنگ متن \*/
}
h1 {
margin-bottom: 20px;
}
</style>
</head>
<body>
<div id="cornerDisplay"></div>
<button id="buyCoinButton">خرید پروفیت (10 سکه)</button>
<div id="sCoinDisplay">سکهها: 0</div>
<div id="profitDisplay">پروفیت: 0</div>
<script>
let coins = localStorage.getItem('coins') ? parseInt(localStorage.getItem('coins')) : 0;
let profit = localStorage.getItem('profit') ? parseInt(localStorage.getItem('profit')) : 0;
const sCoinDisplay = document.getElementById('sCoinDisplay');
const profitDisplay = document.getElementById('profitDisplay');
const cornerDisplay = document.getElementById('cornerDisplay');
updateDisplay();
document.getElementById('clickImage').onclick = function() {
coins++;
profit++;
updateDisplay();
saveData();
};
document.getElementById('buyCoinButton').onclick = function() {
if (coins >= 10) {
coins -= 10; // هزینه خرید سکه
profit += 5; // افزودن به پروفیت
updateDisplay();
saveData();
} else {
alert('برای خرید سکه کافی نیست!');
}
};
function updateDisplay() {
sCoinDisplay.innerText = `سکهها: ${coins}`;
profitDisplay.innerText = `پروفیت: ${profit}`;
cornerDisplay.innerText = `سکهها: ${coins} | پروفیت: ${profit}`;
}
function saveData() {
localStorage.setItem('coins', coins);
localStorage.setItem('profit', profit);
}
</script>
<!DOCTYPE html>
<html lang="fa">
<head>
<title>سایت من</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
}
header {
background-color: #333;
color: white;
padding: 990px;
position: fixed; /\* چسباندن به بالای صفحه \*/
top: 0; /\* موقعیت در بالای صفحه \*/
width: 900%; /\* پهنای کامل \*/
z-index: 1000; /\* نمایش در بالای سایر عناصر \*/
}
main {
margin-top: 99999px; /\* فاصله برای محتوای زیر هدر \*/
padding: 20px;
}
</style>
</head>
<body>
<header>
</body>
</html>
</body>
</html>
<script>
const image = document.getElementById('myImage');
image.onclick = function() {
// افزودن کلاس clicked برای انیمیشن بزرگ شدن
image.classList.add('clicked');
// حذف کلاس بعد از 300 میلیثانیه (مدت زمان انیمیشن)
setTimeout(() => {
image.classList.remove('clicked');
}, 300);
};
</script>
</body>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/styles.css"> <!-- لینک به فایل CSS -->
<title>قالب سایت</title>
</head> </html>