30 Commits
lab6 ... hw6

Author SHA1 Message Date
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
70 changed files with 7096 additions and 106 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("=======");
}

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)

69
lectures/lecture3.txt Normal file
View File

@@ -0,0 +1,69 @@
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
- var tag = 'h'
- var i = 1
#{tag+i} Уровень #{i}
- i++
#{tag+i} Уровень #{i}
- i++
#{tag+i} Уровень #{i}
- i++
#{tag+i} Уровень #{i}
- var products ={"Товар":"Цена","ручка":30.5, "карандаш":50, "альбом":156, "тетрадь":21.5, "ластик":10.2}
table
each name,price in products
tr
td #{name}
td #{price}
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
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')
size=1%
section
box-shadow: size size (2*size) rgba(0,0,0,0.5)
padding:size*2
margin:size*4