Order sending
This commit is contained in:
+50
-21
@@ -19,14 +19,17 @@
|
|||||||
background: linear-gradient(to bottom, #1a1a2e, #16213e);
|
background: linear-gradient(to bottom, #1a1a2e, #16213e);
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding-top: 0px;
|
padding-top: 0px;
|
||||||
padding-bottom: 2rem;
|
padding-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav {
|
nav {
|
||||||
margin-bottom: 32px;
|
margin-bottom: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav ul {
|
nav ul {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -36,6 +39,7 @@
|
|||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav a {
|
nav a {
|
||||||
color: white;
|
color: white;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -44,18 +48,22 @@
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
transition: background-color 0.3s;
|
transition: background-color 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav a:hover {
|
nav a:hover {
|
||||||
background-color: rgba(255, 255, 255, 0.1);
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
nav a.brand {
|
nav a.brand {
|
||||||
font-family: 'Space Grotesk', monospace;
|
font-family: 'Space Grotesk', monospace;
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #e94560;
|
color: #e94560;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav a.brand:hover {
|
nav a.brand:hover {
|
||||||
color: #ff6b81;
|
color: #ff6b81;
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
padding: 2rem 0;
|
padding: 2rem 0;
|
||||||
background: rgba(255, 255, 255, 0.05);
|
background: rgba(255, 255, 255, 0.05);
|
||||||
@@ -63,15 +71,18 @@
|
|||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
backdrop-filter: blur(5px);
|
backdrop-filter: blur(5px);
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 1rem 0;
|
padding: 1rem 0;
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2 {
|
h1, h2 {
|
||||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
|
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.specs-table {
|
.specs-table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
@@ -80,18 +91,22 @@
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.specs-table th, .specs-table td {
|
.specs-table th, .specs-table td {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.specs-table th {
|
.specs-table th {
|
||||||
background: rgba(233, 69, 96, 0.2);
|
background: rgba(233, 69, 96, 0.2);
|
||||||
color: #e94560;
|
color: #e94560;
|
||||||
}
|
}
|
||||||
|
|
||||||
.specs-table tr:last-child td {
|
.specs-table tr:last-child td {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.request-form {
|
.request-form {
|
||||||
background: rgba(233, 69, 96, 0.1);
|
background: rgba(233, 69, 96, 0.1);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@@ -102,11 +117,13 @@
|
|||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.request-form h3 {
|
.request-form h3 {
|
||||||
color: #e94560;
|
color: #e94560;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.request-form input,
|
.request-form input,
|
||||||
.request-form textarea,
|
.request-form textarea,
|
||||||
.request-form select {
|
.request-form select {
|
||||||
@@ -120,19 +137,23 @@
|
|||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.request-form input:focus,
|
.request-form input:focus,
|
||||||
.request-form textarea:focus,
|
.request-form textarea:focus,
|
||||||
.request-form select:focus {
|
.request-form select:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
border-color: #e94560;
|
border-color: #e94560;
|
||||||
}
|
}
|
||||||
|
|
||||||
.request-form select {
|
.request-form select {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.request-form select option {
|
.request-form select option {
|
||||||
background: #1a1a2e;
|
background: #1a1a2e;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.request-form button {
|
.request-form button {
|
||||||
background: #e94560;
|
background: #e94560;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -143,9 +164,11 @@
|
|||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
transition: background-color 0.3s;
|
transition: background-color 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.request-form button:hover {
|
.request-form button:hover {
|
||||||
background: #ff6b81;
|
background: #ff6b81;
|
||||||
}
|
}
|
||||||
|
|
||||||
.terms-section h3 {
|
.terms-section h3 {
|
||||||
color: #e94560;
|
color: #e94560;
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
@@ -212,22 +235,24 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="index.html" class="brand">Micialware</a></li>
|
<li><a href="index.html" class="brand">Micialware</a></li>
|
||||||
<li><a href="flagships.html">Флагманы</a></li>
|
<li><a href="flagships.html">Флагманы</a></li>
|
||||||
<li><a href="index.html#projects">Другие проекты</a></li>
|
<li><a href="index.html#projects">Другие проекты</a></li>
|
||||||
<li><a href="services.html">Услуги</a></li>
|
<li><a href="services.html">Услуги</a></li>
|
||||||
<li><a href="https://github.com/YaslePoy" class="github-link" target="_blank"><img src="img/github-mark-white.svg" alt="GitHub">GitHub</a></li>
|
<li><a href="https://github.com/YaslePoy" class="github-link" target="_blank"><img
|
||||||
|
src="img/github-mark-white.svg" alt="GitHub">GitHub</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<h1>Условия использования простого хостинга</h1>
|
<h1>Условия использования простого хостинга</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<h2>Оборудование</h2>
|
<h2>Оборудование</h2>
|
||||||
<p>Для простого хостинга используется Raspberry Pi 5 - это одноплатный компьютер, который представляет собой полноценную вычислительную систему размером с банковскую карту.</p>
|
<p>Для простого хостинга используется Raspberry Pi 5 - это одноплатный компьютер, который представляет собой
|
||||||
|
полноценную вычислительную систему размером с банковскую карту.</p>
|
||||||
|
|
||||||
<h3>Характеристики используемой модели:</h3>
|
<h3>Характеристики используемой модели:</h3>
|
||||||
<table class="specs-table">
|
<table class="specs-table">
|
||||||
@@ -307,12 +332,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<p style="margin-top: 1rem; font-style: italic;">* Каждый слот представляет собой изолированное окружение с гарантированными ресурсами.<br>
|
<p style="margin-top: 1rem; font-style: italic;">* Каждый слот представляет собой изолированное окружение с
|
||||||
|
гарантированными ресурсами.<br>
|
||||||
** При недельной аренде предоставляется полный доступ к серверу на 7 дней.</p>
|
** При недельной аренде предоставляется полный доступ к серверу на 7 дней.</p>
|
||||||
|
|
||||||
<div class="request-form">
|
<div class="request-form">
|
||||||
<h3>Оставить заявку</h3>
|
<h3>Оставить заявку</h3>
|
||||||
<form action="#" method="POST">
|
<form action="#" method="POST" onsubmit="order(event); this.reset(); return false;">
|
||||||
<div>
|
<div>
|
||||||
<label for="name">Ваше имя:</label>
|
<label for="name">Ваше имя:</label>
|
||||||
<input type="text" id="name" name="name" required>
|
<input type="text" id="name" name="name" required>
|
||||||
@@ -345,37 +371,40 @@
|
|||||||
<label for="message">Опишите ваш проект:</label>
|
<label for="message">Опишите ваш проект:</label>
|
||||||
<textarea id="message" name="message" rows="4" required></textarea>
|
<textarea id="message" name="message" rows="4" required></textarea>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" onclick="order()">Отправить заявку</button>
|
<button type="submit">Отправить заявку</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
async function order() {
|
async function order(event) {
|
||||||
let currentOrder = {
|
event.preventDefault();
|
||||||
|
|
||||||
|
const currentOrder = {
|
||||||
name: document.getElementById("name").value,
|
name: document.getElementById("name").value,
|
||||||
email: document.getElementById("email").value,
|
email: document.getElementById("email").value,
|
||||||
slots: parseInt(document.getElementById("slots").value),
|
slots: parseInt(document.getElementById("slots").value),
|
||||||
period: parseInt(document.getElementById("period").value),
|
rent_type: parseInt(document.getElementById("period").value),
|
||||||
server_type: 0,
|
server_type: 0,
|
||||||
project: document.getElementById("message").value,
|
project: document.getElementById("message").value,
|
||||||
}
|
};
|
||||||
alert(JSON.stringify(currentOrder))
|
|
||||||
await fetch("http://api.micialware.ru/order", {
|
|
||||||
method: "POST",
|
await fetch('http://localhost:81/order', {
|
||||||
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json;charset=utf-8'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify(currentOrder)
|
body: JSON.stringify(currentOrder)
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<p>© 2025 Моя страница. Все права защищены. <span id="random-emoji"></span></p>
|
<p>© 2025 Моя страница. Все права защищены. <span id="random-emoji"></span></p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|
||||||
<script src="scripts.js"></script>
|
<script src="scripts.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+31
-3
@@ -301,7 +301,7 @@
|
|||||||
|
|
||||||
<div class="request-form">
|
<div class="request-form">
|
||||||
<h3>Оставить заявку</h3>
|
<h3>Оставить заявку</h3>
|
||||||
<form action="#" method="POST">
|
<form action="#" method="POST" onsubmit="order(event); this.reset(); return false;">
|
||||||
<div>
|
<div>
|
||||||
<label for="name">Ваше имя:</label>
|
<label for="name">Ваше имя:</label>
|
||||||
<input type="text" id="name" name="name" required>
|
<input type="text" id="name" name="name" required>
|
||||||
@@ -332,8 +332,8 @@
|
|||||||
<label for="period">Период аренды:</label>
|
<label for="period">Период аренды:</label>
|
||||||
<select id="period" name="period" required>
|
<select id="period" name="period" required>
|
||||||
<option value="">Выберите период</option>
|
<option value="">Выберите период</option>
|
||||||
<option value="week">Неделя (200₽/слот)</option>
|
<option value="0">Неделя (200₽/слот)</option>
|
||||||
<option value="month">Месяц (400₽/слот)</option>
|
<option value="1">Месяц (400₽/слот)</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -342,6 +342,34 @@
|
|||||||
</div>
|
</div>
|
||||||
<button type="submit">Отправить заявку</button>
|
<button type="submit">Отправить заявку</button>
|
||||||
</form>
|
</form>
|
||||||
|
<script>
|
||||||
|
async function order(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
const currentOrder = {
|
||||||
|
name: document.getElementById("name").value,
|
||||||
|
email: document.getElementById("email").value,
|
||||||
|
slots: parseInt(document.getElementById("slots").value),
|
||||||
|
rent_type: parseInt(document.getElementById("period").value),
|
||||||
|
server_type: 1,
|
||||||
|
project: document.getElementById("message").value,
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
await fetch('http://micialware.ru:81/order', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify(currentOrder)
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}catch (e){
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user