48 Commits

Author SHA1 Message Date
df21df0fff lectures fix 2026-01-09 19:35:08 +10:00
d10f15a34a longer lectures 2026-01-03 22:59:02 +10:00
f982d05a54 lectures done 2026-01-03 15:32:33 +10:00
b6776f93fd duplicated solutions in loops to match themes 2026-01-03 13:44:33 +10:00
e6806a2366 js lec 1 added 2026-01-03 13:40:15 +10:00
cca7d57569 lec 3 done 2026-01-03 01:21:46 +10:00
1c50d7ce0e finished up to bootstrap 2026-01-01 23:38:59 +10:00
b00d7fb34d added readme for lectures lec2 done 2026-01-01 20:05:31 +10:00
7818949863 lec 1 added 2026-01-01 18:08:32 +10:00
5d7ecb1f13 math fixed 2026-01-01 15:57:09 +10:00
9fef1e5b0d finishing touches 2026-01-01 15:24:08 +10:00
c09b7b5769 images fixed 2026-01-01 15:05:20 +10:00
cf80fd251e small refactor 2026-01-01 14:37:53 +10:00
46e3696d85 reset bug fixed 2026-01-01 14:17:34 +10:00
9e5950490a values checking added 2026-01-01 14:04:53 +10:00
26bc727758 tooltip for output fields added 2026-01-01 13:52:51 +10:00
04db81b55a math fixed 2025-12-31 22:13:22 +10:00
4ab5967abe basic structure created 2025-12-31 20:42:21 +10:00
63af3ed7b4 prettify 2025-12-29 14:06:51 +10:00
b2c005e22c transpose + reverse + index fix in lab6 2025-12-29 14:05:04 +10:00
4cf2f56749 jab6 bad rotation 2025-12-29 13:58:34 +10:00
b0c3660f16 moved files (again?) 2025-12-29 12:46:23 +10:00
b47e479b95 moved files 2025-12-29 12:46:22 +10:00
eb509fb846 Merge branch 'hw3' 2025-12-29 12:42:10 +10:00
9870335263 Merge branch 'lab6' 2025-12-29 12:25:45 +10:00
7cc781c0b9 gitignore added 2025-12-29 00:27:39 +10:00
8eaf1ed628 Merge branch 'hw3' 2025-12-29 00:18:51 +10:00
7b1c5b0a50 lab 6 done 2025-12-29 00:12:40 +10:00
4316ac1636 finished table controls 2025-12-29 00:12:40 +10:00
a4f511cb45 table added 2025-12-29 00:12:39 +10:00
dd9002a61b added table controls 2025-12-29 00:12:38 +10:00
e142436ed3 details BEM 2025-12-29 00:12:38 +10:00
38e70189b8 details page in progress 2025-12-29 00:12:38 +10:00
39d023d50b stylus mixins 2025-12-29 00:12:37 +10:00
05b624120d BEM naming 2025-12-29 00:12:37 +10:00
7a83c54165 main page working 2025-12-29 00:12:36 +10:00
c495c26320 added stylus template 2025-12-29 00:12:36 +10:00
3982a97dce updating styles 2025-12-29 00:12:36 +10:00
8f89dbe429 adding pages 2025-12-29 00:12:35 +10:00
98b74ae77d aboba mv node 2025-12-29 00:12:34 +10:00
bdc5a9d55c starting hw 2025-12-29 00:11:33 +10:00
8900cf3228 gitignore fix 2025-12-29 00:09:07 +10:00
5f692a4708 gitignore added 2025-12-11 18:22:29 +10:00
b98abb94cc aboba commit 2025-12-10 12:31:34 +10:00
2f44691a98 added lecture 3 2025-12-10 10:21:18 +10:00
36fb1653d3 lab5 finished 2025-11-28 12:01:09 +10:00
0bdaa800f6 nfww that was a fake 2025-11-28 11:05:07 +10:00
ebe6566b87 updated styling for lab 2025-11-28 10:52:14 +10:00
133 changed files with 8699 additions and 123 deletions

5
.gitignore vendored
View File

@@ -1,2 +1,3 @@
node_modules
to_reform
**node_modules
**to_reform
.vscode

View File

Before

Width:  |  Height:  |  Size: 198 KiB

After

Width:  |  Height:  |  Size: 198 KiB

View File

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 159 KiB

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

Before

Width:  |  Height:  |  Size: 229 KiB

After

Width:  |  Height:  |  Size: 229 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

Before

Width:  |  Height:  |  Size: 347 KiB

After

Width:  |  Height:  |  Size: 347 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

View File

Before

Width:  |  Height:  |  Size: 5.2 MiB

After

Width:  |  Height:  |  Size: 5.2 MiB

View File

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 MiB

After

Width:  |  Height:  |  Size: 3.9 MiB

View File

Before

Width:  |  Height:  |  Size: 4.4 MiB

After

Width:  |  Height:  |  Size: 4.4 MiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

112
hw/hw6/hw6.js Normal file
View File

@@ -0,0 +1,112 @@
let templates = [
[
"X--X----",
"-XXX-X--",
"----X---",
"----X---",
"------XX",
"----XX--",
"X-------",
"-XX--X--"
],
[
"---XX---",
"----X-X-",
"---XX---",
"---X----",
"-X------",
"X----X-X",
"--X--X--",
"-X----XX"
],
[
"-X-X----",
"---X-X--",
"X-XX--X-",
"--X-X---",
"------X",
"--------",
"X-----X-",
"-X-X---X"
],
[
"-XX-X---",
"-----X--",
"----X---",
"-----X-X",
"-X-X--X-",
"-XX----X",
"-X------",
"XX------"
], [
"----XX-X",
"X-------",
"--------",
"-----XX-",
"---X-X--",
"-X---XX-",
"-X-X----",
"----XXX-"
], [
"XX------",
"-----X--",
"-------X",
"-X-X----",
"X-X----X",
"-X-X-X-X",
"----X-X-",
"-X------"
],
];
const squareSize = templates[0].length;
//convert to arrays for mutability
let temp = []
for (let n = 0; n < templates.length; n++) {
temp.push([])
for (let i = 0; i < squareSize; i++) {
temp[n].push([]);
for (let j = 0; j < squareSize; j++) {
temp[n][i].push(templates[n][i][j] == "X" ? 1 : 0);
}
}
}
templates = temp;
const encodedMsg = "Р_НАЙА_СЛЗДЕОСЖСТОИКНОЛЬЛЬТКУЮО__КЗАЕВАОКАЧОЖЗ_УЧАСМОДУ_ТЮЖЕ";
function rotateTemplate(template) {
for (let i = 0; i < squareSize; i++) {
for (let j = 0; j < i; j++) {
let temp = template[i][j];
template[i][j] = template[j][i];
template[j][i] = temp;
}
}
for (let i = 0; i < squareSize; i++) {
for (let j = 0; j < squareSize / 2; j++) {
let temp = template[i][j];
template[i][j] = template[i][(squareSize - 1) - j];
template[i][(squareSize - 1) - j] = temp;
}
}
}
for (let n = 0; n < templates.length; n++) {
let out = ""
for (let rot = 0; rot < 4; rot++) {
for (let i = 0; i < squareSize; i++) {
for (let j = 0; j < squareSize; j++) {
if (templates[n][i][j]) {
out += encodedMsg[i * squareSize + j];
}
}
}
rotateTemplate(templates[n]);
}
console.log(out);
console.log("=======");
}

BIN
hw/hw7/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

108
hw/hw7/hw7.css Normal file
View File

@@ -0,0 +1,108 @@
.desctription-heading{
font-size: medium;
text-align: center;
}
.main-container {
display: flex;
gap: 20px;
align-items: flex-start;
}
.scheme-image{
flex: 1;
max-width: 400px;
height: auto;
object-fit: contain;
}
.controls-container {
display: flex;
flex-direction: column;
gap: 20px;
flex: 1;
min-width: 300px;
max-width: 400px;
}
.inputs{
min-width: 300px;
}
.outputs{
min-width: 300px;
}
.radio-label{
display: inline-block;
}
p{
line-height: 0;
}
.max-w{
width: 100%;
}
.bad-input-tooltip {
display: block;
background: #ffffff;
color: #721c24;
border: 1px solid #8f0c19;
padding: 4px 8px;
max-width: 220px;
white-space: normal;
}
.bad-input-highlight {
outline: 2px solid #990917;
}
.hidden{
display: none;
}
body{
display: flex;
flex-direction: column;
gap: 20px;
}
table {
width: 100%;
border-collapse: collapse;
margin: 16px 0;
}
th, td {
border: 1px solid #ccc;
text-align: left;
}
th {
background-color: #f5f5f5;
font-weight: bold;
}
tr:nth-child(even) {
background-color: #fafafa;
}
@media (max-width: 800px) {
.main-container {
flex-direction: column;
align-items: center;
}
.scheme-image {
max-width: 100%;
width: 100%;
}
.controls-container {
width: 100%;
max-width: none;
}
.inputs, .outputs {
min-width: unset;
width: 100%;
}
}

71
hw/hw7/hw7.html Normal file
View File

@@ -0,0 +1,71 @@
<html>
<head>
<title>калькулятор равнобедренного треугольника</title>
<link rel="stylesheet" href="./hw7.css">
<link rel="icon" href="favicon.ico">
<link rel="stylesheet" href="https://unpkg.com/xp.css/dist/98.css"
>
</head>
<body>
<h3 class="desctription-heading">калькулятор равнобедренного треугольника</h3>
<div class="main-container">
<div class="image-container">
<img src="./imgs/type1.png" class="scheme-image" id="schemeImageA">
<img src="./imgs/type2.png" class="scheme-image hidden" id="schemeImageB">
</div>
<div class="controls-container">
<div class="inputs" id="inputsForm">
<p>Выберете варинат входных данных:</p>
<input type="radio" name="input-type" id="radioButtonA" checked>
<label class="radio-label" for="radioButtonA">
<span>боковая сторона и угол при основании</span>
</label><br>
<input type="radio" name="input-type" id="radioButtonB">
<label class="radio-label" for="radioButtonB">
<span>основание и прилежащий к нему угол</span>
</label>
<form>
<fieldset id="inputTypeFieldsetA">
<legend>входные данные</legend>
<label for="equalSideLength">Длина боковой стороны B:<span class="bad-input-tooltip hidden" id="equalSideLengthErr"></span></label><br>
<input class="max-w" type="number" min="0" id="equalSideLength">
<br>
<label for="baseAngle">Угол при основании α (в градусах):<span class="bad-input-tooltip hidden" id="baseAngleErr"></span></label><br>
<input class="max-w" type="number" min="0" max="180" id="baseAngle">
</fieldset>
<fieldset id="inputTypeFieldsetB" class="hidden">
<legend>входные данные</legend>
<label for="baseSideLength">Длина основания A:<span class="bad-input-tooltip hidden" id="baseSideLengthErr"></span></label><br>
<input class="max-w" type="number" min="0" id="baseSideLength">
<br>
<label for="baseAdjacentAngle">Угол прилежащий основанию β:<span class="bad-input-tooltip hidden" id="baseAdjacentAngleErr"></span></label><br>
<input class="max-w" type="number" min="0" max="180" id="baseAdjacentAngle">
</fieldset>
<fieldset id="outputsFieldset">
<legend>что вычислить</legend>
<span class="bad-input-tooltip hidden" id="outputValuesErr"><br></span>
<input type="checkbox" name="output-valuesR" id="outputValuesR" checked>
<label for="outputValuesR">радиус вписанной окружности</label><br>
<input type="checkbox" name="output-valuesH" id="outputValuesH" checked>
<label for="outputValuesH">высоты треугольника</label><br>
<input type="checkbox" name="output-valuesL" id="outputValuesL" checked>
<label for="outputValuesL">длины сторон треугольника</label><br>
</fieldset>
<button id="calculateButton" disabled>Вычислить</button>
<button id="clearButton">Отчислить</button>
</form>
</div>
<table class="outputs hidden" id="outputsTable">
</table>
</div>
</div>
</body>
<script src="./hw7.js">
</script>
</html>

357
hw/hw7/hw7.js Normal file
View File

@@ -0,0 +1,357 @@
let elements = {
radioA: document.getElementById('radioButtonA'),
radioB: document.getElementById('radioButtonB'),
fieldsetA: document.getElementById('inputTypeFieldsetA'),
fieldsetB: document.getElementById('inputTypeFieldsetB'),
imageA: document.getElementById('schemeImageA'),
imageB: document.getElementById('schemeImageB'),
inputsForm: document.getElementById('inputsForm'),
equalSideLength: document.getElementById('equalSideLength'),
equalSideLengthErr: document.getElementById('equalSideLengthErr'),
baseAngle: document.getElementById('baseAngle'),
baseAngleErr: document.getElementById('baseAngleErr'),
baseSideLength: document.getElementById('baseSideLength'),
baseSideLengthErr: document.getElementById('baseSideLengthErr'),
baseAdjacentAngle: document.getElementById('baseAdjacentAngle'),
baseAdjacentAngleErr: document.getElementById('baseAdjacentAngleErr'),
outputsFieldset: document.getElementById('outputsFieldset'),
outputValuesErr: document.getElementById('outputValuesErr'),
outputR: document.getElementById('outputValuesR'),
outputH: document.getElementById('outputValuesH'),
outputL: document.getElementById('outputValuesL'),
calculateButton: document.getElementById('calculateButton'),
clearButton: document.getElementById('clearButton'),
outputsTable: document.getElementById('outputsTable')
}
console.log("loaded js!");
let currentModeIsA = true;
let outputFields = {};
let inputsA = {
l: null,
angle: null
};
let inputsB = {
l: null,
angle: null
};
function highlightErrorElement(errorFieldIndex, add = true) {
let fields = [
elements.equalSideLength,
elements.baseAngle,
elements.baseSideLength,
elements.baseAdjacentAngle,
outputsFieldset
];
if (fields[errorFieldIndex]) {
if (add) {
fields[errorFieldIndex].classList.add("bad-input-highlight");
}
else {
fields[errorFieldIndex].classList.remove("bad-input-highlight");
}
}
}
function setErrTooltip(errorFieldIndex, tooltip) {
let errElem = [
elements.equalSideLengthErr,
elements.baseAngleErr,
elements.baseSideLengthErr,
elements.baseAdjacentAngleErr,
elements.outputValuesErr
][errorFieldIndex];
if (errElem) {
highlightErrorElement(errorFieldIndex, tooltip !== "");
if (tooltip !== "") {
errElem.classList.remove("hidden");;
}
else {
errElem.classList.add("hidden");;
}
if (errorFieldIndex == 4) {
tooltip += "<br>"
}
errElem.innerHTML = tooltip;
}
}
function deg2rad(degrees) {
return degrees * (Math.PI / 180);
}
function getCalculations() {
let heights = [];//base related, side realted
let lengths = [];// base side
let radius = 0;
let baseAngle = 0;
let sideAngle = 0;
if (currentModeIsA) {
lengths[0] = 2 * Math.sin(deg2rad(inputsA.angle) / 2) * inputsA.l;
lengths[1] = inputsA.l;
baseAngle = inputsA.angle;
sideAngle = (180 - baseAngle) / 2;
}
else {
lengths[0] = inputsB.l;
lengths[1] = inputsB.l / (2 * Math.cos(deg2rad(inputsB.angle)));
sideAngle = inputsB.angle;
baseAngle = 180 - 2 * sideAngle;
}
let a = lengths[0];
let b = lengths[1];
let p = (a + b + b) / 2;
radius = Math.sqrt((p - a) * (p - b) * (p - b) / p);
heights[0] = lengths[1] * Math.sin(deg2rad(sideAngle));
heights[1] = lengths[0] * Math.sin(deg2rad(baseAngle));
return {
radius: radius,
heights: heights,
lengths: lengths
};
}
function updateCheckboxes() {
outputFields["radius"] = elements.outputR.checked;
outputFields["heights"] = elements.outputH.checked;
outputFields["lengths"] = elements.outputL.checked;
let ret = !outputFields.radius && !outputFields.heights && !outputFields.lengths;
if (ret) {
setErrTooltip(4, "Выберите хотя бы один параметр для вывода.");
} else {
setErrTooltip(4, "");
}
updateCalculateButton();
}
function updateCalculateButton() {
let ret = false;
if (currentModeIsA) {
ret = inputsA["l"] !== null && inputsA["angle"] !== null
}
else {
ret = inputsB["l"] !== null && inputsB["angle"] !== null
}
ret &= elements.outputR.checked || elements.outputH.checked || elements.outputL.checked;
elements.calculateButton.disabled = !ret;
}
function switchInputs(selectA) {
if (selectA) {
elements.imageA.classList.remove("hidden");
elements.imageB.classList.add("hidden");
elements.fieldsetA.classList.remove("hidden");
elements.fieldsetB.classList.add("hidden");
}
else {
elements.imageA.classList.add("hidden");
elements.imageB.classList.remove("hidden");
elements.fieldsetA.classList.add("hidden");
elements.fieldsetB.classList.remove("hidden");
}
updateCalculateButton();
}
function displayTable(calcResults) {
let table = elements.outputsTable;
table.innerHTML = ""; // Clear previous content
let header = "<tr><th>Параметр</th><th>Значение</th></tr>";
let rows = "";
if (outputFields.radius) {
rows += `<tr><td>R</td><td>${calcResults.radius.toFixed(3)}</td></tr>`;
}
if (outputFields.heights) {
rows += `<tr><td>h1</td><td>${calcResults.heights[0].toFixed(3)}</td></tr>`;
rows += `<tr><td>h2</td><td>${calcResults.heights[1].toFixed(3)}</td></tr>`;
}
if (outputFields.lengths) {
rows += `<tr><td>A</td><td>${calcResults.lengths[0].toFixed(3)}</td></tr>`;
rows += `<tr><td>B</td><td>${calcResults.lengths[1].toFixed(3)}</td></tr>`;
}
table.innerHTML = header + rows;
if (rows === "") {
table.innerHTML = `<h3>Выберите параметры для вычислений, сейчас таблица пустая</h3>`;
}
table.classList.remove("hidden");
}
function clearCurrentInputs() {
if (currentModeIsA) {
elements.equalSideLength.value = null;
elements.baseAngle.value = null;
setErrTooltip(0, "");
setErrTooltip(1, "");
inputsA = {
l: null,
angle: null
};
}
else {
inputsB = {
l: null,
angle: null
};
setErrTooltip(2, "");
setErrTooltip(3, "");
elements.baseSideLength.value = null;
elements.baseAdjacentAngle.value = null;
}
elements.outputsTable.classList.add("hidden");
updateCalculateButton()
}
function check180Angle(angleString) {
let angle = parseFloat(angleString);
if (isNaN(angle)) {
return "Введите корректное число";
}
if (angle <= 0) {
return "Угол должен быть больше 0";
}
if (angle >= 180) {
return "Угол должен быть меньше 180";
}
return "";
}
function check90Angle(angleString) {
let angle = parseFloat(angleString);
if (isNaN(angle)) {
return "Введите корректное число";
}
if (angle <= 0) {
return "Угол должен быть больше 0";
}
if (angle >= 90) {
return "Угол должен быть меньше 90";
}
return "";
}
function checkLength(lengthString) {
let length = parseFloat(lengthString);
if (!isFinite(length)) {
return "Введите корректное число";
}
if (length <= 0) {
return "Длина должна быть больше 0";
}
return "";
}
function handleSwitchInputs(event) {
if (event.target.id[event.target.id.length - 1].toLowerCase() == "a") {
currentModeIsA = true;
switchInputs(true);
console.log("Switching inputs to A");
}
else {
currentModeIsA = false;
switchInputs(false);
console.log("Switching inputs to B");
}
}
function handleInputsUpdate(event) {
switch (event.target.id) {
case "equalSideLength":
{
const err = checkLength(event.target.value);
setErrTooltip(0, err);
if (err === "") {
inputsA.l = parseFloat(event.target.value);
} else {
inputsA.l = null;
}
}
break;
case "baseAngle":
{
const err = check180Angle(event.target.value);
setErrTooltip(1, err);
if (err === "") {
inputsA.angle = parseFloat(event.target.value);
} else {
inputsA.angle = null;
}
}
break;
case "baseSideLength":
{
const err = checkLength(event.target.value);
setErrTooltip(2, err);
if (err === "") {
inputsB.l = parseFloat(event.target.value);
} else {
inputsB.l = null;
}
}
break;
case "baseAdjacentAngle":
{
const err = check90Angle(event.target.value);
setErrTooltip(3, err);
if (err === "") {
inputsB.angle = parseFloat(event.target.value);
} else {
inputsB.angle = null;
}
}
break;
default:
console.log(event.target.id)
break;
}
updateCalculateButton();
}
function handleFieldsetEvent(event) {
if (event.target.type === 'radio') {
handleSwitchInputs(event);
} else if (event.target.type === 'number') {
handleInputsUpdate(event);
}
}
elements.inputsForm.addEventListener('change', handleFieldsetEvent);
elements.inputsForm.addEventListener('input', handleFieldsetEvent);
elements.outputsFieldset.addEventListener('change', (event) => {
if (event.target.type === 'checkbox') {
updateCheckboxes();
}
});
elements.clearButton.addEventListener('click', (event) => {
event.preventDefault();
clearCurrentInputs()
});
elements.calculateButton.addEventListener('click', (event) => {
event.preventDefault();
displayTable(getCalculations());
});
// чтобы не сконфузило
updateCheckboxes();
switchInputs(elements.radioA.checked);

BIN
hw/hw7/imgs/type1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
hw/hw7/imgs/type2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

1
labs/fake-lab5/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
node_modules

6695
labs/fake-lab5/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
{
"name": "template_pug",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack --mode production",
"serve": "webpack serve --open --mode development",
"dev": "webpack --mode development",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"chokidar": "^4.0.3",
"css-loader": "^6.8.1",
"filemanager-webpack-plugin": "^8.0.0",
"glob": "^11.0.3",
"html-webpack-plugin": "^5.5.3",
"pug": "^2.0.4",
"pug-loader": "^2.4.0",
"style-loader": "^3.3.3",
"stylus": "^0.61.0",
"stylus-loader": "^7.1.3",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
}
}

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 162 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1 @@
import './styles/main.styl'

View File

@@ -0,0 +1,19 @@
extends template
block nav
nav
+createMenu(dictMenu, 'Главная')
block content
div.images
each pict in listImages
a(href= "building.html")
img(src= require("../images/" + pict))
article
each item in listSections
section
h3= item.header
img(src= require("../images/" + item.image))
p= item.text
a(href="#") &hellip;

View File

@@ -0,0 +1,86 @@
colorText = #6f6d6d
back(size)
background-color #f1f1f1
box-shadow 4px 5px 10px rgba(0, 0, 0, 0.4)
padding: size + "%"
margin 0 0 1% 0
html
color colorText
nav
back(0)
text-align right
& a
display inline-block
padding 1%
color colorText
text-decoration: none
&:hover
&.active
background-color #f87777
color #f8f8f8
div.images
display grid
grid-template-columns repeat(5, 1fr)
grid-gap 0.5%
back(1)
overflow hidden
& img
width: 100%
@media (max-width: 600px)
grid-template-rows repeat(5, 1fr)
grid-template-columns 1fr
justify-items center
article
width 80%
margin auto
display grid
grid-template-columns repeat(3, 1fr)
grid-gap 4%
overflow hidden
@media (max-width: 600px)
grid-template-rows repeat(3, 1fr)
grid-template-columns 1fr
& section
display grid
grid-template-columns 1fr 2fr
grid-gap 2%
align-items center
back(2)
& h3
grid-column 1/3
margin 0
text-align center
& img
width: 100%
footer
background-color colorText
color white
@media (max-width: 600px)
margin 3vh 0
& h4
padding:10px
.big
width 50vw
@media (max-width: 600px)
width 100vw
section
display grid
grid-template-columns 1fr 1fr
@media (max-width: 600px)
grid-template-columns 1fr

View File

@@ -0,0 +1,69 @@
const HtmlWebpackPlugin = require("html-webpack-plugin");
const FileManagerPlugin = require("filemanager-webpack-plugin");
const path = require("path");
const fs = require("fs");
const pagesDir = path.join(__dirname, "src", "pages");
const pages = fs.readdirSync(pagesDir).filter(file => file.endsWith(".pug"));
module.exports = {
output: {
path: path.join(__dirname, "dist"),
filename: "index.[contenthash].js",
assetModuleFilename: path.join("images", "[name].[contenthash][ext]"),
},
entry: path.join(__dirname, "src", "index.js"),
module: {
rules: [
{
test: /\.pug$/,
loader: "pug-loader",
},
{
test: /\.(png|jpg|jpeg|gif)$/i,
type: "asset/resource",
},
{
test: /\.svg$/,
type: "asset/resource",
generator: {
filename: path.join("icons", "[name].[contenthash][ext]"),
},
},
{
test: /\.styl$/,
use: [
{
loader: "style-loader",
},
{
loader: "css-loader",
},
{
loader: "stylus-loader",
},
],
},
],
},
plugins: [
...pages.map(
(page) =>
new HtmlWebpackPlugin({
template: path.join(pagesDir, page),
filename: page.replace(".pug", ".html"),
})
),
new FileManagerPlugin({
events: {
onStart: {
delete: ["dist"],
},
},
}),
],
devServer: {
watchFiles: path.join(__dirname, "src"),
port: 9000,
},
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -1,2 +0,0 @@
h2= 'Hello World!'
img(src= require("../images/img1.jpg"))

View File

@@ -1,19 +1,5 @@
extends template
block nav
nav
+createMenu(dictMenu, 'Главная')
block content
div.images
each pict in listImages
a(href= "building.html")
img(src= require("../images/" + pict))
article
each item in listSections
section
h3= item.header
img(src= require("../images/" + item.image))
p= item.text
a(href="#") &hellip;
head
title Lab 5
body
p.first-green-letter Текст Текст
p.first-green-letter Второй параграф

View File

@@ -1,84 +1,7 @@
colorText = #6f6d6d
text(size, color)
&:first-letter
font-size size
color color
back(size)
background-color #f1f1f1
box-shadow 4px 5px 10px rgba(0, 0, 0, 0.4)
padding: size + "%"
margin 0 0 1% 0
html
color colorText
nav
back(0)
text-align right
& a
display inline-block
padding 1%
color colorText
text-decoration: none
&:hover
&.active
background-color #f87777
color #f8f8f8
div.images
display grid
grid-template-columns repeat(5, 1fr)
grid-gap 0.5%
back(1)
& img
width: 100%
@media (max-width: 600px)
grid-template-rows repeat(5, 1fr)
grid-template-columns 1fr
& img
width 80%
margin auto
article
width 80%
margin auto
display grid
grid-template-columns repeat(3, 1fr)
grid-gap 4%
@media (max-width: 600px)
grid-template-rows repeat(3, 1fr)
grid-template-columns 1fr
& section
display grid
grid-template-columns 1fr 2fr
grid-gap 2%
align-items center
back(2)
& h3
grid-column 1/3
margin 0
text-align center
& img
width: 100%
footer
background-color colorText
color white
@media (max-width: 600px)
margin 3vh 0
& h4
padding:10px
.big
width 50vw
@media (max-width: 600px)
width 100vw
section
display grid
grid-template-columns 1fr 1fr
@media (max-width: 600px)
grid-template-columns 1fr
.first-green-letter
text(2em,green)

34
lectures/lec1/task1.html Normal file
View File

@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>task 1</title>
</head>
<body>
<h3><i>Возможности HTML</i></h3>
<hr width='30%' align=left>
<ol>
<li> Выделение текста:
<ul type=circle>
<li>жирным;</li>
<li>курсивным;</li>
</ul>
</li>
<li>Характеристика шрифта.</li>
<li><a href=#>Вставка рисунков. </a></li>
<li> Оформление текста:
<ul type=circle>
<li>заголовки; </li>
<li>абзацы;</li>
<li>списки.</li>
</ul>
</li>
</ol>
<hr align=left width=30%>
<p align="justify">Средствами HTML осуществляется переход на другие страницы сети Интернет.</p>
</body>
</html>

57
lectures/lec1/task2.html Normal file
View File

@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Пройдите тест</title>
</head>
<body>
<h2>Пройдите тест</h2>
<form>
<ol>
<li>
Что будет выведено в окно браузера после выполнения оператора:<br>
<code>document.write("&lt;strong&gt;a&lt;sub&gt;i&lt;/sub&gt; = 2&lt;sup&gt;i&lt;/sup&gt;&lt;/strong&gt;")</code>
<br><br>
<input type="radio" name="q1" id="q1a" value="a1">
<label for="q1a">a<sub>i</sub> = 2<sup>i</sup></label><br>
<input type="radio" name="q1" id="q1b" value="a2">
<label for="q1b"><strong>a<sub>i</sub> = 2<sub>i</sub></strong></label><br>
<input type="radio" name="q1" id="q1c" value="a3">
<label for="q1c"><strong>a<sub>i</sub> = 2i</strong></label><br>
<input type="radio" name="q1" id="q1d" value="a4">
<label for="q1d">a<sup>i</sup> = 2<sup>i</sup></label>
</li>
<br>
<li>
Отметьте верные названия переменных:<br>
<input type="checkbox" id="q2a" name="q2" value="name">
<label for="q2a">name</label><br>
<input type="checkbox" id="q2b" name="q2" value="name+age">
<label for="q2b">name+age</label><br>
<input type="checkbox" id="q2c" name="q2" value="nameAge">
<label for="q2c">nameAge</label><br>
<input type="checkbox" id="q2d" name="q2" value="3name">
<label for="q2d">3name</label><br>
<input type="checkbox" id="q2e" name="q2" value="name(age)">
<label for="q2e">name(age)</label>
</li>
<br>
<li>
Какое значение получит переменная <code>result</code> после выполнения следующих операторов:<br>
<code>
let a = 7;<br>
let b = 4;<br>
let result = a % 3 + b % 2;
</code>
<br>
Ответ: <input type="text" name="q3" size="5">
</li>
</ol>
<button type="submit">Закончить тестирование</button>
<button type="reset">Повторить тестирование</button>
</form>
</body>
</html>

View File

@@ -0,0 +1,26 @@
.menuItem {
text-align: center;
}
#menu ul {
padding-left: 0;
margin: .5%;
}
#menu li {
display: inline-block;
width: 16%;
background: #F00;
}
#menu a {
text-decoration: none;
color: white;
}
.pict {
width: 70%;
background: rgba(0, 255, 0, .5);
margin: 5px auto;
padding: 5px 0;
}

View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Задание 2</title>
<style>
h1,
h2 {
text-align: center;
color: maroon;
}
ins {
text-decoration: underline;
}
i {
font-style: italic;
}
</style>
</head>
<body>
<h1>
<ins>Основы HTML</ins>
</h1>
<h2>
<i>Оглавление</i>
</h2>
</body>
</html>

View File

@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Задание 3</title>
<style>
.blue-bold {
font-weight: bold;
color: blue;
}
.big-font{
font-size: 20px;
color: green;
}
.center-red {
color: red;
text-align: center;
}
</style>
</head>
<body>
<p class="blue-bold">Каскадность CSS:</p>
<ul>
<li class="center-red">расширение свойств;</li>
<li class="big-font center-red">переопределение свойств.</li>
</ul>
</body>
</html>

View File

@@ -0,0 +1,81 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset=utf-8">
<title>Task 4</title>
<style>
div {
box-sizing: border-box;
background: lightblue;
text-align: center;
margin: 5px 5px;
}
.menu{
text-align: end;
}
.menu > div{
width: 100px;
height: 50px;
display: inline-block;
background: violet;
}
.gray {
background: gainsboro;
}
.w50 {
width: 48%;
display: inline-block;
height: 250px;
}
.top {
width: 70%;
margin: 0 auto 20px;
}
.left {
display: inline-block;
width: 63%
}
.left .part {
height: 80px;
}
.right {
float: right;
width: 35%;
height: 340px;
}
</style>
</head>
<body>
<div class="menu">
<div>меню1</div>
<div>меню2</div>
<div>меню3</div>
<div>меню4</div>
</div>
<div class="top">
<div class="gray w50"><span>рисунок 1</span></div>
<div class="gray w50"><span>рисунок 2</span></div>
</div>
<div class="main">
<div class="left">
<div class="gray part"><span>часть 1.1</span></div>
<div class="gray part"><span>часть 1.2</span></div>
<div class="gray part"><span>часть 1.3</span></div>
<div class="gray part"><span>часть 1.4</span></div>
</div>
<div class="gray right"><span>часть 2</span></div>
</div>
</body>
</html>

View File

@@ -0,0 +1,23 @@
.main > p:last-child{
color:green;
}
/*
<div class="menu">
<ol>
<li><a href="#">Комбинация селекторов</a></li>
<li><a href="#">Селекторы атрибутов</a></li>
</ol>
<p>CSS селекторы</p>
</div>
<div class="main">
<h2>Комбинация селекторов</h2>
<img src="tree.png">
<p> Различают следующие виды селекторов: </p>
<ol>
<li><a href="#">вложенный селектор;</a></li>
<li><a href="#">родительский селектор;</a></li>
</ol>
<p> Соединение селекторов</p> --- ВОТ ЕГО КРАСИМ!!!
</div>
*/

View File

@@ -0,0 +1,24 @@
.main li > [href="#"] {
color:green
}
/*
<div class="menu">
<ul>
<li><a href="a1.html">Комбинация селекторов</a></li>
<li><a href="#">Селекторы атрибутов</a></li>
</ul>
<p>CSS селекторы</p>
</div>
<div class="main">
<h2>Комбинация селекторов</h2>
<img src="tree.png">
<p> Различают следующие виды селекторов: </p>
<ol>
<li><a href="#">вложенный селектор;</a></li>
<li><a href="b1.html">родительский селектор;</a></li>
</ol>
<p> <a href="#"> Соединение селекторов </a></p>
</div>
*/

View File

@@ -0,0 +1,24 @@
h2, ol >li:nth-child(2) , ol + p{
color: green;
}
/*
<div class="menu">
<ul>
<li><a href="a1.html">Комбинация селекторов</a></li>
<li><a href="#">Селекторы атрибутов</a></li>
</ul>
</div>
<div class="main">
<h2>Комбинация селекторов</h2> ---
<img src="tree.png">
<p> Различают следующие виды селекторов: </p>
<ol>
<li><a href="#">вложенный селектор;</a></li>
<li><a href="#">родительский селектор;</a></li> ---
<li><a href="#">соседний селектор</a></li>
</ol>
<p> <a href="#"> Соединение селекторов </a></p> ---
</div>
*/

View File

@@ -0,0 +1,8 @@
div > a > img{
width: 10vw;
}
div > a {
display: inline-block;
}

View File

@@ -0,0 +1,8 @@
div > a > img{
width: 10vw;
min-width: 170px;
}
div > a {
min-width: 170px;
display: inline-block;
}

View File

@@ -0,0 +1,26 @@
div > a > img{
width: 10vw;
min-width: 170px;
}
div > a {
min-width: 170px;
}
div {
display: flex;
}
@media (max-width: 600px) {
div {
flex-direction: column;
align-items: center;
}
div > a {
width: 80vw;
max-width: 300px;
min-width: 0;
}
div > a > img {
width: 80vw;
max-width: 300px;
min-width: 0;
}
}

View File

@@ -0,0 +1,24 @@
<div class="container">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
</div>
<style>
.container {
display: flex;
flex-wrap: no-wrap;
background: LightGreen;
}
.container div {
min-width: 120px;
height: 50px;
margin: 5px;
border: solid thin green;
}
</style>

View File

@@ -0,0 +1,38 @@
<style>
.pict {
display: flex;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
}
.pict a img {
min-width:280px;
min-height:280px;
}
@media (max-width: 1000px) {
.pict {
flex-wrap: wrap;
}
}
@media (max-width: 700px) {
.pict {
flex-direction: column;
align-items: center;
}
}
</style>
<hr>
<div class="pict">
<a href="#"><img src="images/image_1.jpg"></a>
<a href="#"><img src="images/image_2.jpg"></a>
<a href="#"><img src="images/image_3.jpg"></a>
<a href="#"><img src="images/image_4.jpg"></a>
<a href="#"><img src="images/image_5.jpg"></a>
</div>
<hr>

View File

@@ -0,0 +1,46 @@
<style>
.pict {
display: flex;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
}
.pict a img {
min-width: 280px;
min-height: 280px;
}
.big {
min-width: 330px;
min-height: 330px;
}
@media (max-width: 1000px) {
.pict {
flex-wrap: wrap;
}
.big {
min-width: 280px;
min-height: 280px;
}
}
@media (max-width: 700px) {
.pict {
flex-direction: column;
align-items: center;
}
}
</style>
<hr>
<div class="pict">
<a href="#"><img src="images/image_1.jpg"></a>
<a href="#"><img src="images/image_2.jpg"></a>
<a href="#" class="big"><img src="images/image_3.jpg"></a>
<a href="#"><img src="images/image_4.jpg"></a>
<a href="#"><img src="images/image_5.jpg"></a>
</div>
<hr>

34
lectures/lec3/task1.html Normal file
View File

@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Template</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.col{
background: lightgray;
border: solid thin grey;
}
.row{
border: solid thin red;
}
</style>
</head>
<body class="container-fluid">
<div class="row m-2">
<div class="col-6 col-md-3 col-lg-2 h-2 p-3 bg-light"><h3>aboba</h3></div>
<div class="col-6 col-md-3 col-lg-2 h-2 p-3 bg-light"><h3>aboba</h3></div>
<div class="col-6 col-md-3 col-lg-2 h-2 p-3 bg-light"><h3>aboba</h3></div>
<div class="col-6 col-md-3 col-lg-2 h-2 p-3 bg-light"><h3>aboba</h3></div>
<div class="col-6 col-md-3 col-lg-2 h-2 p-3 bg-light"><h3>aboba</h3></div>
<div class="col-6 col-md-3 col-lg-2 h-2 p-3 bg-light"><h3>aboba</h3></div>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</html>

38
lectures/lec3/task2.html Normal file
View File

@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Template</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.col {
background: lightgray;
border: solid thin grey;
}
.row {
border: solid thin red;
}
</style>
</head>
<body>
<div class="container d-flex align-items end">
<h5 class="bg-light">Ворота на запад</h5>
<p>192-метровая арка в Сент-Луисе (штат Миссури, США)</p>
<img src="images/image1.jpg" alt="">
</div>
<div class="container d-grid justify-content-center">
<h5 class="bg-light">Ворота на запад</h5>
<p>192-метровая арка в Сент-Луисе (штат Миссури, США)</p>
<img src="images/image1.jpg" alt="">
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</html>

44
lectures/lec3/task3.html Normal file
View File

@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Template</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.col {
background: lightgray;
border: solid thin grey;
}
.row {
border: solid thin red;
}
</style>
</head>
<body>
<div class="container"></div>
<div class="row p-2 border justify-content-between">
<div class="col-12 col-md-7 p-2 m-md-2 border bg-primary text-white">
Строка 1, столбец 1
</div>
<div class="col-12 col-md-3 p-2 m-md-2 border">
Строка 1, столбец 2
</div>
</div>
<div class="row p-2 border justify-content-between">
<div class="col-12 col-md-3 p-2 m-md-2 border">
Строка 2, столбец 1
</div>
<div class="col-12 col-md-7 bg-primary text-white col p-2 m-md-2 border">
Строка 2, столбец 2
</div>
</div>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</html>

View File

@@ -0,0 +1,22 @@
...
<body>
<div class="main">
<div class="main__card">
<div class="main__card-header">Заголовок</div>
<div class="main__card-image main__card-image--position_right">Рисунок</div>
<div class="card__content"></div>
</div>
<div class="main__card">
<div class="main__card-header">Заголовок</div>
<div class="main__card-content"></div>
</div>
<div class="main__card">
<div class="main__card-image main__card-image--position_left">Рисунок</div>
<div class="main__card-header">Заголовок</div>
<div class="main__card-content"></div>
</div>
</div>
</body>

View File

@@ -0,0 +1,10 @@
ol#list(type="I")
li Препроцессоры HTML
ul(type="disc")
li.first
a(href="#") Haml
li Pug
li Препроцессоры CSS
ul(type="circle")
li.first SAAS
li Stylus

View File

@@ -0,0 +1,9 @@
ol#list(type="I")
li Препроцессоры HTML
ul(type="disc")
li.first: a(href="#") Haml
li Pug
li Препроцессоры CSS
ul(type="circle")
li.first SAAS
li Stylus

View File

@@ -0,0 +1,10 @@
- var tag = 'h'
- var i = 1
#{tag+i} Уровень #{i}
- i++
#{tag+i} Уровень #{i}
- i++
#{tag+i} Уровень #{i}
- i++
#{tag+i} Уровень #{i}

View File

@@ -0,0 +1,6 @@
- var products ={"Товар":"Цена","ручка":30.5, "карандаш":50, "альбом":156, "тетрадь":21.5, "ластик":10.2}
table
each name,price in products
tr
td= name
td= price

View File

@@ -0,0 +1,8 @@
table
- for(var i=0;i<10;i++)
tr
- for(var j=0;j<10;j++)
- if((i + j) % 2 == 0)
td.white
- else
td.black

View File

@@ -0,0 +1,12 @@
mixin createList(listType, items, tag)
- var dispListType = "ul"
- if (listType == "ol")
- dispListType = "ol"
#{dispListType}.list
each item in items
li
#{tag} #{item}
// Вызов миксина
+createList('ul', ['Python', 'JavaScript', 'Java'], 'strong')

Some files were not shown because too many files have changed in this diff Show More