mirror of
https://github.com/rjNemo/rust-web
synced 2026-06-06 02:46:41 +00:00
client
This commit is contained in:
parent
96e2f42cfe
commit
16db93d3fa
1 changed files with 56 additions and 0 deletions
56
public/index.html
Normal file
56
public/index.html
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
max-width: 650px;
|
||||
margin: 40px auto;
|
||||
padding: 0 10px;
|
||||
font: 18px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
color: #444
|
||||
}
|
||||
|
||||
h1, h2, h3 {
|
||||
line-height: 1.2
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
color: white;
|
||||
background: #444
|
||||
}
|
||||
|
||||
a:link {
|
||||
color: #5bf
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #ccf
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<meta charset="UTF-8">
|
||||
<title>Rust client</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Rust client</h1>
|
||||
<pre id="result"></pre>
|
||||
</body>
|
||||
<script>
|
||||
const consoleSignatureStyle = "font-size: 16px;" +
|
||||
"background: linear-gradient(to right, #e66465, #9198e5);" +
|
||||
"color: white;" +
|
||||
"text-align: center;" +
|
||||
"padding: 10px 15px;" +
|
||||
"width: 100%;" +
|
||||
"border-radius: 20px;";
|
||||
|
||||
const welcomeMessage = "Welcome to Rust client ⚙️"
|
||||
console.log(`%c ${welcomeMessage}`, consoleSignatureStyle)
|
||||
|
||||
let data = document.querySelector("#result")
|
||||
fetch("http://localhost:8000/")
|
||||
.then(res => res.json())
|
||||
.then(json => data.innerHTML = JSON.stringify(json, null, 2))
|
||||
</script>
|
||||
</html>
|
||||
Loading…
Reference in a new issue