Init 🏁

This commit is contained in:
Alexander Popov 2023-06-03 23:26:52 +03:00
commit 6ba1b0c8b4
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6
5 changed files with 292 additions and 0 deletions

16
.editorconfig Normal file
View File

@ -0,0 +1,16 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[{*.hta}]
indent_style = tab
indent_size = 4
[*.md]
trim_trailing_whitespace = false

160
CalcAverageScore.hta Executable file
View File

@ -0,0 +1,160 @@
<!--
-- Калькулятор среднего балла
-- Author: Alexander Popov
-- License: Public Domain
-- Version: 1.0
-- History: see EOF.
-->
<html>
<head>
<HTA:APPLICATION
applicationName="Калькулятор среднего балла"
version="1.0"
maximizeButton="no"
border="dialog"
innerBorder="no"
scroll="no"
singleInstance="yes"
contextMenu="no"
/>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta charset="utf-8">
<title>Калькулятор среднего балла</title>
<script type="text/javascript">
window.onload = function() {
var w = 340; // Ширина окна
var h = 310; // Высота окна
// Изменение размера окна и размещение по центру
window.resizeTo(w, h);
window.moveTo((window.screen.width - w) / 2, (window.screen.height - h) / 2);
}
/**
* Функция для подсчёта результата среднего балла
*
* Вызывается каждый раз при изменении значения
*/
function calc() {
// Количество проверенных человек, число на колотое делится сумму баллов
var checked = parseInt(document.getElementById('checked').value);
// Элемент для отображения результата
var result = document.getElementById('result');
// Подсчёт баллов
var n5 = parseInt(document.getElementById('5').value);
var n4 = parseInt(document.getElementById('4').value);
var n3 = parseInt(document.getElementById('3').value);
var n2 = parseInt(document.getElementById('2').value);
var total = (((n5 * 5) + (n4 * 4) + (n3 * 3) + (n2 * 2)) / checked).toFixed(2);
// Подсчёт среднего балла
if ((n5 + n4 + n3 + n2) != checked) {
result.value = 'Ошибка суммы значений';
}
else {
if (total >= 4.6) {
result.value = total + ' Отлично';
}
else if (total >= 3.6) {
result.value = total + ' Хорошо';
}
else if (total >= 2.6) {
result.value = total + ' Удовлетворительно';
}
else {
result.value = total + ' Неудовлетворительно';
}
}
}
</script>
<style>
* { margin: 0; padding: 0; }
body { font-family: 'Segoe UI'; font-size: 14px; }
p.hero {
background-color: #000; color: #fff;
font-weight: bold; text-align: center;
padding: 8px; margin-bottom: 8px;
}
div.footer {
margin-top: 8px; padding: 8px;
background-color: #000; color: #fff;
font-weight: bold;
}
div.line { margin: 8px; }
p.line-title {
display: inline-block; width: 165px;
font-weight: bold;
margin-right: 8px;
}
p.line-total {
font-weight: bold;
display: inline-block; width: 48px;
margin-right: 8px;
}
input {
border: 1px solid #000;
font-family: 'Segoe UI'; font-size: 14px;
width: 110px;
padding: 0 8px;
}
input:focus {
background-color: #7f0000; color: #fff;
border-color: #ff0;
}
input.input-total {
width: 240px;
padding: 0 8px;
background-color: #444; color: #fff;
}
.text-right { text-align: right; }
</style>
</head>
<body>
<p class="hero">Калькулятор среднего балла</p>
<div class="line text-right">
<p class="line-title">Всего личного состава:</p>
<input id="total" type="text" onchange="calc();" value="1">
</div>
<div class="line text-right">
<p class="line-title">Всего проверено л/с:</p>
<input id="checked" type="text" onchange="calc();" value="1">
</div>
<div class="line text-right">
<p class="line-title">Оценок «5»:</p>
<input id="5" type="text" onchange="calc();" value="1">
</div>
<div class="line text-right">
<p class="line-title">Оценок «4»:</p>
<input id="4" type="text" onchange="calc();" value="0">
</div>
<div class="line text-right">
<p class="line-title">Оценок «3»:</p>
<input id="3" type="text" onchange="calc();" value="0">
</div>
<div class="line text-right">
<p class="line-title">Оценок «2»:</p>
<input id="2" type="text" onchange="calc();" value="0">
</div>
<div class="line">
<p class="line-total">Итого:</p>
<input id="result" class="input-total" type="text" value="Измените значения">
</div>
<div class="footer">
<p>Version: 1.0 || by iiiypuk</p>
</div>
</body>
</html>
<!--
VERSION 1.0
- Init version
-->

24
LICENSE Normal file
View File

@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>

10
README.md Normal file
View File

@ -0,0 +1,10 @@
# 🗜️ Коллекция HTA приложений
## 📄 Содержание
- [rgbToHex](#rgbToHex)
- [Калькулятор среднего балла](#Калькулятор_среднего_балла)
## ↔️ rgbToHex
## 🧮 Калькулятор среднего балла

82
rgbToHex.hta Executable file
View File

@ -0,0 +1,82 @@
<!--
-- rgbToHex
-- Author: Alexander Popov
-- License: Public Domain
-- Version: 1.0
-- History: see EOF.
-->
<html>
<head>
<HTA:APPLICATION
applicationName="rgbToHex"
version="1.0"
maximizeButton="no"
border="dialog"
innerBorder="no"
scroll="no"
singleInstance="yes"
contextMenu="no"
/>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta charset="utf-8">
<title>rgbToHex</title>
<script type="text/javascript">
window.onload = function() {
var w = 340; // Ширина окна
var h = 310; // Высота окна
// Изменение размера окна и размещение по центру
window.resizeTo(w, h);
window.moveTo((window.screen.width - w) / 2, (window.screen.height - h) / 2);
}
/**
* Функция для перевода rbg цвета в hex
*/
function rgbToHex(r, g, b) {
return '#' + (1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1);
}
function rgbCalc() {
var rgb = document.getElementById('rgb-text');
var rgbValue = rgb.value.split(',');
r = parseInt(rgbValue[0]);
g = parseInt(rgbValue[1]);
b = parseInt(rgbValue[2]);
rgb.value = rgbToHex(r, g, b);
}
</script>
<style>
* { margin: 0; padding: 0; }
body { font-family: 'Segoe UI'; font-size: 14px; }
p.hero {
background-color: #000; color: #fff;
font-weight: bold; text-align: center;
padding: 8px; margin-bottom: 8px;
}
div.footer {
margin-top: 8px; padding: 8px;
background-color: #000; color: #fff;
font-weight: bold;
}
</style>
</head>
<body>
<p class="hero">rgbToHex</p>
<div>
<input id="rgb-text" value="R, G, B">
<button onclick="rgbCalc();">RGB > HEX</button>
</div>
<div class="footer">
<p>Version: 1.0 || by iiiypuk</p>
</div>
</body>
</html>
<!--
VERSION 1.0
- Init version
-->