From 275fa9d5d3ca0fed55fb09b9163eb479495ec5a0 Mon Sep 17 00:00:00 2001
From: gas53 <45990653+GAS53@users.noreply.github.com>
Date: Wed, 13 Apr 2022 13:46:53 +0300
Subject: [PATCH] Add files via upload
---
1/chess.js | 20 ++++++++++++++++++++
1/index.html | 14 ++++++++++++++
1/style.css | 20 ++++++++++++++++++++
2/index.html | 13 +++++++++++++
2/soruse.js | 31 +++++++++++++++++++++++++++++++
5 files changed, 98 insertions(+)
create mode 100644 1/chess.js
create mode 100644 1/index.html
create mode 100644 1/style.css
create mode 100644 2/index.html
create mode 100644 2/soruse.js
diff --git a/1/chess.js b/1/chess.js
new file mode 100644
index 0000000..7a6b492
--- /dev/null
+++ b/1/chess.js
@@ -0,0 +1,20 @@
+function drawBoard() {
+ let board = document.querySelector('.board')
+ let block
+ let flag = true
+ for (let i = 0; i < 8; i++) {
+ for (let j = 0; j < 8; j++) {
+ if (j == 0) flag = !flag;
+ block = document.createElement('div')
+ if (flag) {
+ block.classList = 'block black'
+ } else {
+ block.classList = 'block white'
+ }
+ board.appendChild(block);
+ flag = !flag;
+ }
+ }
+}
+
+drawBoard()
\ No newline at end of file
diff --git a/1/index.html b/1/index.html
new file mode 100644
index 0000000..bd729f6
--- /dev/null
+++ b/1/index.html
@@ -0,0 +1,14 @@
+
+
+
+
+ Шахматная доска
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1/style.css b/1/style.css
new file mode 100644
index 0000000..852622f
--- /dev/null
+++ b/1/style.css
@@ -0,0 +1,20 @@
+.board {
+ height: 640px;
+ width: 640px;
+ margin: 30px auto;
+ border: 1px solid black;
+}
+
+.block {
+ height: 80px;
+ width: 80px;
+ float: left;
+}
+
+.black {
+ background: black;
+}
+
+.white {
+ background: white;
+}
\ No newline at end of file
diff --git a/2/index.html b/2/index.html
new file mode 100644
index 0000000..dae03cc
--- /dev/null
+++ b/2/index.html
@@ -0,0 +1,13 @@
+
+
+
+
+ Корзина
+
+
+
+ #test
+
+
+
+
\ No newline at end of file
diff --git a/2/soruse.js b/2/soruse.js
new file mode 100644
index 0000000..ea26d6f
--- /dev/null
+++ b/2/soruse.js
@@ -0,0 +1,31 @@
+var basket = {
+ summ: 0,
+ items: [],
+ append: function (item) { this.items.push(item) },
+ get_size: function () { return this.items.length },
+ get_items: function () { return this.items },
+ all_cost: function () {
+
+ for (var i in this.items) {
+ if (i != undefined) { this.summ += this.items[i].cost }
+ }
+ if (this.summ == 0) {
+ return 'корзина пуста'
+ } else{
+ return this.summ
+ }
+
+ }
+
+}
+
+// var it = { name: 'Пицца', cost: 150 }
+// var it2 = { name: 'Машина', cost: 1500 }
+// basket.append(it)
+// basket.append(it2)
+
+function drawBoard() {
+ alert(basket.all_cost())
+}
+
+drawBoard()
\ No newline at end of file