-
Notifications
You must be signed in to change notification settings - Fork 0
/
dand.html
133 lines (114 loc) · 3.51 KB
/
dand.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Solaced by the Cosmos</title>
<style>
body {
font-family: 'Helvetica', Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-image: url("poembg.jpg");
background-size: cover;
}
.container {
background-color: #fff;
border-radius: 10px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
padding: 30px;
text-align: center;
max-width: 400px;
margin: 20px;
opacity: 0.95;
}
p {
font-size: 24px;
margin: 0 0 20px;
color: #D09493;
font-family: 'Times New Roman', Times, serif;
font-size: 170%;
}
#result{
margin-top: 3%;
}
img {
max-width: 100%;
height: auto;
border-radius: 8px;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
margin-bottom:4% ;
}
@keyframes slideIn {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(0);
}
}
#submitbutton {
text-align: center;
color: #fff;
background-color: #D09493;
border-radius: 4%;
box-shadow: #141413;
cursor: pointer;
border: none;
font-size: 130%;
}
#submitbutton::hover {
background-color: #be6e6b;
}
#comment {
margin-bottom: 4%;
}
.slideIn {
animation-name: slideIn;
animation-duration: 5s;
}
</style>
</head>
<body>
<div class="slideIn">
<div class="container">
<p id="poemname"><b>Dandelion</b></p>
<img src="DANDELION .png" alt="Solaced by the Cosmos">
<textarea id="comment" rows="3" cols="30"></textarea>
<img src="empty.png" onclick="f()" id="like" style="height: 7%; width: 7%; margin-left: 5%;"><br>
<input type="submit" onclick="submitComment()" id="submitbutton">
<p id="result"></p>
</div>
</div>
</body>
<script>
function f() {
var l = document.getElementById("like");
l.src = "filled.jpg";
}
function submitComment() {
var commentText = document.getElementById("comment").value;
var poemname = document.getElementById("poemname").innerHTML;
fetch('1temp.php', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: 'text=' + encodeURIComponent(commentText) + '&name=' + encodeURIComponent(poemname),
})
.then(response => response.text())
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});
document.getElementById("result").innerHTML = "Thank you!";
document.getElementById("comment").value = "";
}
</script>
</html>