|
|
<!DOCTYPE html>
|
|
|
<html lang="ru">
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
<title>Расчет гипсовой смеси</title>
|
|
|
<style>
|
|
|
body {
|
|
|
font-family: Arial, sans-serif;
|
|
|
margin: 20px;
|
|
|
}
|
|
|
.container {
|
|
|
max-width: 400px;
|
|
|
margin: 0 auto;
|
|
|
}
|
|
|
label {
|
|
|
display: block;
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
input, select {
|
|
|
width: 100%;
|
|
|
padding: 8px;
|
|
|
margin-top: 5px;
|
|
|
}
|
|
|
button {
|
|
|
margin-top: 20px;
|
|
|
padding: 10px 20px;
|
|
|
background-color: #28a745;
|
|
|
color: white;
|
|
|
border: none;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
button:hover {
|
|
|
background-color: #218838;
|
|
|
}
|
|
|
.result {
|
|
|
margin-top: 20px;
|
|
|
padding: 10px;
|
|
|
background-color: #f8f9fa;
|
|
|
border: 1px solid #ddd;
|
|
|
}
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="container">
|
|
|
<h1>Расчет гипсовой смеси</h1>
|
|
|
<label for="volume">Объем формы (мл):</label>
|
|
|
<input type="number" id="volume" step="1" min="0" required>
|
|
|
|
|
|
<label for="plasticizerType">Тип пластификатора:</label>
|
|
|
<select id="plasticizerType">
|
|
|
<option value="classic">СВВ-500 Классик</option>
|
|
|
<option value="premium">СВВ-500 Premium</option>
|
|
|
</select>
|
|
|
|
|
|
<label for="plasticizerPercentage">Процент пластификатора:</label>
|
|
|
<select id="plasticizerPercentage">
|
|
|
|
|
|
<option value="1" data-type="classic">1%</option>
|
|
|
<option value="2" data-type="classic">2%</option>
|
|
|
<option value="3" data-type="classic">3%</option>
|
|
|
<option value="4" data-type="classic">4%</option>
|
|
|
|
|
|
<option value="0.3" data-type="premium">0.3%</option>
|
|
|
<option value="0.7" data-type="premium">0.7%</option>
|
|
|
<option value="1.2" data-type="premium">1.2%</option>
|
|
|
<option value="1.6" data-type="premium">1.6%</option>
|
|
|
</select>
|
|
|
|
|
|
<label for="dyePercentage">Процент красителя (0-5%):</label>
|
|
|
<input type="number" id="dyePercentage" min="0" max="5" value="0" required>
|
|
|
|
|
|
<button onclick="calculate()">Рассчитать</button>
|
|
|
|
|
|
<div class="result" id="result">
|
|
|
<h2>Результаты расчета:</h2>
|
|
|
<p>Гипс Г-16: <span id="gypsum"></span> г</p>
|
|
|
<p>Вода: <span id="water"></span> мл</p>
|
|
|
<p>Пластификатор: <span id="plasticizerAmount"></span> г</p>
|
|
|
<p>Краситель: <span id="dye"></span> г</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
const gypsumDensity = 1.6;
|
|
|
|
|
|
const baseWaterRatio = 0.6;
|
|
|
|
|
|
|
|
|
function updatePlasticizerPercentages() {
|
|
|
const plasticizerType = document.getElementById('plasticizerType').value;
|
|
|
const percentageSelect = document.getElementById('plasticizerPercentage');
|
|
|
const options = percentageSelect.options;
|
|
|
|
|
|
for (let i = 0; i < options.length; i++) {
|
|
|
const option = options[i];
|
|
|
if (option.dataset.type === plasticizerType) {
|
|
|
option.hidden = false;
|
|
|
} else {
|
|
|
option.hidden = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
percentageSelect.value = percentageSelect.querySelector('option:not([hidden])').value;
|
|
|
}
|
|
|
|
|
|
|
|
|
document.getElementById('plasticizerType').addEventListener('change', updatePlasticizerPercentages);
|
|
|
updatePlasticizerPercentages();
|
|
|
|
|
|
|
|
|
function calculate() {
|
|
|
|
|
|
const volume = parseFloat(document.getElementById('volume').value);
|
|
|
const plasticizerPercentage = parseFloat(document.getElementById('plasticizerPercentage').value);
|
|
|
const dyePercentage = parseFloat(document.getElementById('dyePercentage').value);
|
|
|
|
|
|
|
|
|
let gypsumAmount;
|
|
|
if (plasticizerPercentage === 1) {
|
|
|
gypsumAmount = volume * 1.37;
|
|
|
} else if (plasticizerPercentage === 2) {
|
|
|
gypsumAmount = volume * 1.53;
|
|
|
} else if (plasticizerPercentage === 3) {
|
|
|
gypsumAmount = volume * 1.63;
|
|
|
} else if (plasticizerPercentage === 4) {
|
|
|
gypsumAmount = volume * 1.67;
|
|
|
} else if (plasticizerPercentage === 0.3) {
|
|
|
gypsumAmount = volume * 1.33;
|
|
|
} else if (plasticizerPercentage === 0.7) {
|
|
|
gypsumAmount = volume * 1.55;
|
|
|
} else if (plasticizerPercentage === 1.2) {
|
|
|
gypsumAmount = volume * 1.6;
|
|
|
} else if (plasticizerPercentage === 1.6) {
|
|
|
gypsumAmount = volume * 1.65;
|
|
|
} else {
|
|
|
gypsumAmount = volume * gypsumDensity;
|
|
|
}
|
|
|
|
|
|
|
|
|
let waterAmount;
|
|
|
if (plasticizerPercentage === 1) {
|
|
|
waterAmount = gypsumAmount * 0.35;
|
|
|
} else if (plasticizerPercentage === 2) {
|
|
|
waterAmount = gypsumAmount * 0.28;
|
|
|
} else if (plasticizerPercentage === 3) {
|
|
|
waterAmount = gypsumAmount * 0.24;
|
|
|
} else if (plasticizerPercentage === 4) {
|
|
|
waterAmount = gypsumAmount * 0.22;
|
|
|
} else if (plasticizerPercentage === 0.3) {
|
|
|
waterAmount = gypsumAmount * 0.375;
|
|
|
} else if (plasticizerPercentage === 0.7) {
|
|
|
waterAmount = gypsumAmount * 0.26;
|
|
|
} else if (plasticizerPercentage === 1.2) {
|
|
|
waterAmount = gypsumAmount * 0.25;
|
|
|
} else if (plasticizerPercentage === 1.6) {
|
|
|
waterAmount = gypsumAmount * 0.23;
|
|
|
} else {
|
|
|
waterAmount = gypsumAmount * baseWaterRatio;
|
|
|
}
|
|
|
|
|
|
|
|
|
const plasticizerAmount = (gypsumAmount * plasticizerPercentage) / 100;
|
|
|
|
|
|
const dyeAmount = (gypsumAmount * dyePercentage) / 100;
|
|
|
|
|
|
|
|
|
document.getElementById('gypsum').textContent = gypsumAmount.toFixed(2);
|
|
|
document.getElementById('water').textContent = waterAmount.toFixed(2);
|
|
|
document.getElementById('plasticizerAmount').textContent = plasticizerAmount.toFixed(2);
|
|
|
document.getElementById('dye').textContent = dyeAmount.toFixed(2);
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|
|
|
</html> |