Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 63af3ed7b4 | |||
| b2c005e22c | |||
| 4cf2f56749 | |||
| b0c3660f16 | |||
| b47e479b95 | |||
| eb509fb846 | |||
| 9870335263 | |||
| 7cc781c0b9 | |||
| 8eaf1ed628 | |||
| 7b1c5b0a50 | |||
| 4316ac1636 | |||
| a4f511cb45 | |||
| dd9002a61b | |||
| e142436ed3 | |||
| 38e70189b8 | |||
| 39d023d50b | |||
| 05b624120d | |||
| 7a83c54165 | |||
| c495c26320 | |||
| 3982a97dce | |||
| 8f89dbe429 | |||
| 98b74ae77d | |||
| bdc5a9d55c | |||
| 8900cf3228 | |||
| 5f692a4708 | |||
| b98abb94cc | |||
| 2f44691a98 | |||
| 36fb1653d3 | |||
| 0bdaa800f6 | |||
| ebe6566b87 |
5
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
node_modules
|
||||
to_reform
|
||||
**node_modules
|
||||
**to_reform
|
||||
.vscode
|
||||
|
Before Width: | Height: | Size: 198 KiB After Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 159 KiB After Width: | Height: | Size: 159 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 229 KiB After Width: | Height: | Size: 229 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 347 KiB After Width: | Height: | Size: 347 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 2.3 MiB |
|
Before Width: | Height: | Size: 5.2 MiB After Width: | Height: | Size: 5.2 MiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 3.9 MiB After Width: | Height: | Size: 3.9 MiB |
|
Before Width: | Height: | Size: 4.4 MiB After Width: | Height: | Size: 4.4 MiB |
|
Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
112
hw/hw6/hw6.js
Normal 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
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
6695
labs/fake-lab5/package-lock.json
generated
Normal file
30
labs/fake-lab5/package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
1
labs/fake-lab5/src/index.js
Normal file
@@ -0,0 +1 @@
|
||||
import './styles/main.styl'
|
||||
19
labs/fake-lab5/src/pages/index.pug
Normal 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="#") …
|
||||
86
labs/fake-lab5/src/styles/main.styl
Normal 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
|
||||
69
labs/fake-lab5/webpack.config.js
Normal 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,
|
||||
},
|
||||
};
|
||||
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 37 KiB |
@@ -1,2 +0,0 @@
|
||||
h2= 'Hello World!'
|
||||
img(src= require("../images/img1.jpg"))
|
||||
@@ -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="#") …
|
||||
head
|
||||
title Lab 5
|
||||
body
|
||||
p.first-green-letter Текст Текст
|
||||
p.first-green-letter Второй параграф
|
||||
@@ -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
@@ -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
|
||||