From 7c20410c2b7f588e67261e8fbe8cf84d8dce2a7c Mon Sep 17 00:00:00 2001 From: Ccccadyrov Date: Sat, 15 Oct 2022 15:02:35 +1000 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=B0=20=D0=B1=D0=BB=D1=8F=D1=82=D1=8C?= =?UTF-8?q?=20=D1=8F=20=D0=BF=D0=B8=D1=88=D1=83=20=D0=BE=D1=85=D1=83=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D1=85=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=B1=D0=B5=D1=81=D1=81=D0=BC=D1=8B=D1=81=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B8?= =?UTF-8?q?=D1=82=20=D0=BF=D1=80=D0=BE=D1=81=D1=82=D0=BE=20=D0=BE=D1=85?= =?UTF-8?q?=D1=83=D0=B5=D1=82=D1=8C=20=D0=B1=D0=BB=D1=8F=D1=82=D1=8C=20?= =?UTF-8?q?=D0=B5=D0=B1=D0=B0=D0=BD=D1=83=D1=82=D1=8C=D1=81=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 1 + script/js.js | 128 ++++++++++++++++++++++++++--------------------- styles/style.css | 12 +++++ 3 files changed, 85 insertions(+), 56 deletions(-) diff --git a/index.html b/index.html index e40aecd..7189f97 100644 --- a/index.html +++ b/index.html @@ -25,6 +25,7 @@ + diff --git a/script/js.js b/script/js.js index 636b7c6..45b63fa 100644 --- a/script/js.js +++ b/script/js.js @@ -1,70 +1,86 @@ console.log('wrok'); -const pg = require('pg'); - -const config = { - host: '77.34.74.77', - // Do not hard code your username and password. - // Consider using Node environment variables. - user: 'postgres', - password: 'postgres', - database: 'postgres', - port: 5432, - ssl: false -}; - -const client = new pg.Client(config); - -client.connect -( - err => - { - if (err) throw err; - else - { - addToDvachDatabase(); - queryDatabase(); - } +let infinite=5; +ugly.onclick = function() { + alert ('Ок?') + while(true) { + infinite=infinite*infinite + console.log (infinite); } -); + }; -function addToDvachDatabase() { //Добавляем значение в базу данных dvach - console.log(`Running query to PostgreSQL server: ${config.host}`); - const query = "INSERT INTO dvach (post) VALUES ('Привет двач');"; - client.query(query) - .then(res => { - //const rows = res.rows; - //rows.map(row => { - //console.log(`Прочитано следующее : ${JSON.stringify(row)}`); - // }); - //process.exit(); - }) - .catch(err => { - console.log(err); - }); -} -function queryDatabase() { //VSE ZNACHENIYA IZ BAZI DANNYKH - console.log(`Running query to PostgreSQL server: ${config.host}`); +// const pg = require('pg'); - const query = 'SELECT * FROM dvach;'; +// const config = { +// host: '77.34.74.77', +// // Do not hard code your username and password. +// // Consider using Node environment variables. +// user: 'postgres', +// password: 'postgres', +// database: 'postgres', +// port: 5432, +// ssl: false +// }; - client.query(query) - .then(res => { - const rows = res.rows; +// const client = new pg.Client(config); - rows.map(row => { - console.log(`Прочитано следующее : ${JSON.stringify(row)}`); - }); +// client.connect +// ( +// err => +// { +// if (err) throw err; +// else +// { +// addToDvachDatabase(); +// queryDatabase(); +// } +// } +// ); - process.exit(); - }) - .catch(err => { - console.log(err); - }); -} \ No newline at end of file +// function addToDvachDatabase() { //Добавляем значение в базу данных dvach + +// console.log(`Running query to PostgreSQL server: ${config.host}`); + +// const query = "INSERT INTO dvach (post) VALUES ('Привет двач');"; + +// client.query(query) +// .then(res => { +// //const rows = res.rows; + +// //rows.map(row => { +// //console.log(`Прочитано следующее : ${JSON.stringify(row)}`); +// // }); + +// //process.exit(); +// }) +// .catch(err => { +// console.log(err); +// }); +// } + +// function queryDatabase() { //VSE ZNACHENIYA IZ BAZI DANNYKH + +// console.log(`Running query to PostgreSQL server: ${config.host}`); + +// const query = 'SELECT * FROM dvach;'; + +// client.query(query) +// .then(res => { +// const rows = res.rows; + +// rows.map(row => { +// console.log(`Прочитано следующее : ${JSON.stringify(row)}`); +// }); + +// process.exit(); +// }) +// .catch(err => { +// console.log(err); +// }); +// } \ No newline at end of file diff --git a/styles/style.css b/styles/style.css index 0b4ffa4..dbc3565 100644 --- a/styles/style.css +++ b/styles/style.css @@ -54,4 +54,16 @@ h1 { margin-left: auto; margin-right: auto; +} +.ugly { + display: block; + width: 500px; + padding-top: 30px; + padding-bottom: 30px; + margin-left: auto; + margin-right: auto; + background-color: chartreuse; +} +.ugly:hover { + background-color: darkgoldenrod; } \ No newline at end of file