-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrites.html
More file actions
96 lines (83 loc) · 3.34 KB
/
writes.html
File metadata and controls
96 lines (83 loc) · 3.34 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bit And Byte</title>
<link rel="stylesheet" href="writes.css">
</head>
<body>
<header>
<div class="nav container">
<a href="index.html" class="logo">Bit And Byte</a>
<ul class="nav-menu">
<li class="menu-item users-item"><a href="users.html">Users</a></li>
<li class="menu-item"><a href="writes.html">Write</a></li>
<li class="menu-item"><a href="view.html">View</a></li>
<li class="menu-item"><a href="show.html">Show</a></li>
</ul>
<div class="nav-links">
<a href="login.html" class="login">Login</a>
<a href="register.html" class="signup">Sing up</a>
</div>
</div>
</header>
<br>
<br>
<div class="form-container">
<h2>Edit Blog</h2>
<form id="productForm">
<label for="title">Title</label>
<input type="text" id="title" placeholder="Enter title" required>
<label for="description">Description:</label>
<textarea id="description" placeholder="Enter description" required></textarea>
<label for="image">Upload Image:</label>
<input type="file" id="image" accept="image/*">
<button type="submit">Update Blog</button>
</form>
</div>
<br>
</div>
<script>
// Form Submit İşlemleri
document.getElementById('productForm').addEventListener('submit', function(event) {
event.preventDefault();
// Formdan değerleri al
const title = document.getElementById('title').value;
const description = document.getElementById('description').value;
const image = document.getElementById('image').files[0];
// Ürün kartını güncelle
document.getElementById('productTitle').textContent = title;
document.getElementById('productDescription').textContent = description;
// Eğer bir resim seçilmişse, resmi göster
if (image) {
const reader = new FileReader();
reader.onload = function(e) {
document.getElementById('productImage').src = e.target.result;
};
reader.readAsDataURL(image);
}
});
// Sayfa Yüklendiğinde Scrollbar Stilini Ekle
document.addEventListener("DOMContentLoaded", () => {
const style = document.createElement('style');
style.textContent = `
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: rgb(250, 160, 75);
border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(250, 160, 75, 0.8);
}
`;
document.head.appendChild(style);
});
</script>
</body>
</html>