-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample_website.html
More file actions
90 lines (81 loc) · 2.79 KB
/
Copy pathexample_website.html
File metadata and controls
90 lines (81 loc) · 2.79 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CursorScript Server Example</title>
<style>
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
background-color: #0f172a;
color: #f8fafc;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
text-align: center;
}
h1 {
font-size: 3rem;
margin-bottom: 0.5rem;
background: linear-gradient(to right, #38bdf8, #818cf8);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
}
p {
font-size: 1.2rem;
color: #94a3b8;
max-width: 600px;
}
.card {
background-color: #1e293b;
padding: 2rem;
border-radius: 1rem;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
border: 1px solid #334155;
margin-top: 2rem;
}
button {
background-color: #3b82f6;
color: white;
border: none;
padding: 0.75rem 1.5rem;
font-size: 1rem;
border-radius: 0.5rem;
cursor: pointer;
transition: background-color 0.2s;
margin-top: 1rem;
font-weight: bold;
}
button:hover {
background-color: #2563eb;
}
</style>
</head>
<body>
<div class="card">
<h1>Hello from CursorScript! 🚀</h1>
<p>This beautiful, responsive webpage is being served entirely by the custom <b>ServerLib</b> running inside
your new programming language!</p>
<button id="pingBtn">Ping the Server API</button>
<p id="result" style="margin-top: 1rem; color: #34d399; font-weight: bold; font-size: 1rem;"></p>
</div>
<script>
document.getElementById('pingBtn').addEventListener('click', async () => {
const resultEl = document.getElementById('result');
resultEl.innerText = 'Pinging...';
try {
const response = await fetch('/api/data');
const data = await response.json();
resultEl.innerText = 'Server says: ' + data.message + ' (Time: ' + new Date(data.time).toLocaleTimeString() + ')';
} catch (err) {
resultEl.innerText = 'Error checking API.';
resultEl.style.color = '#ef4444';
}
});
</script>
</body>
</html>