Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lesson 12 #112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion lesson_12/js/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
'use strict'
'use strict'
const group = {

users: ['student 1', 'student 2'],

sayHi: function(user) {
console.log(`Hi ${user}`);
},

sayHiToAll: function() {
this.users.forEach(user => this.sayHi(user))
}
}

group.sayHiToAll();

// 2

function callWithTimer(func) {

return function innerFunc(){
console.time('time');
let resActFunction = func();
console.timeEnd('time');
return resActFunction;
};

};

function testFunction() {
const arr = new Array(4000000).fill('test');

const newArr = arr.map((el,index) => `${el}_${index}`);
return newArr;
}

const testFunctionWrapper = callWithTimer(testFunction);
const result = testFunctionWrapper();

console.log('result:', result);
24 changes: 24 additions & 0 deletions lesson_2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@
</head>

<body>
<h1 class="intro">
FLEXBOX CSS
</h1>
<div class="block flex-container">
<div class="block__element flex-element">
<span>1</span>
</div>
<div class="block__element1 flex-element">
<span>2</span>
</div>
<div class="block__element flex-element">
<span>3</span>
</div>
<div class="block__element flex-element">
<span>4</span>
</div>
<div class="block__element flex-element">
<span>5</span>
</div>
<div class="block__element flex-element">
<span>6</span>
</div>

</div>

</body>

Expand Down
95 changes: 94 additions & 1 deletion lesson_2/styles/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,96 @@

body {
font-family: sans-serif;
font-family: Tahoma, Arial, sans-serif;
}

div {
box-sizing: border-box;
}

.intro {
width: 1003px;
margin: 70px auto 0px auto;
color: #36c1d0;
}

.block__element span {
background: #dee8fb;
color: #366bd0;
display: block;
width: 40px;
height: 40px;
line-height: 40px;
text-align: center;
border-radius: 50%;
position: absolute;
left: 50%;
margin-left: -20px;
top: 50%;
margin-top: -20px;
}

.block {
background: #36c1d0;
width: 1000px;
height: 600px;
margin: 60px auto;
padding: 20px;
}

.block__element {
background: #fff;
width: 10%;
height: 100px;
position: relative;
margin: 6px;
}

.credits {
width: 1000px;
margin: 0 auto 65px auto;
}

.credits__links {
padding: 0;
margin: 0;
}

.credits__link {
display: block;
}

.credits__link a {
font-size: 13px;
text-decoration: none;
border-bottom: 1px solid rgba(54, 193, 208, 0.42);
color: #36c1d0;
font-weight: bold;
margin-right: 30px;
padding-bottom: 4px;
}

.credits__link a:hover {
border-bottom: 0;
}

/* Flexbox CSS Styling */

.flex-container {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}

.flex-element {
width: 30%;
background-color: #1418e0;
}

.block__element1 {
height: 300px;
}

.block__element {
height: 150 px;
}

38 changes: 38 additions & 0 deletions lesson_2/задание1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8" />
<title>Homework</title>
<link rel="stylesheet" href="styles/styles.css">
</head>

<body>
<h1 class="intro">
FLEXBOX CSS
</h1>
<div class="block flex-container">
<div class="block__element flex-element">
<span>1</span>
</div>
<div class="block__element1 flex-element">
<span>2</span>
</div>
<div class="block__element flex-element">
<span>3</span>
</div>
<div class="block__element flex-element">
<span>4</span>
</div>
<div class="block__element flex-element">
<span>5</span>
</div>
<div class="block__element flex-element">
<span>6</span>
</div>

</div>

</body>

</html>
96 changes: 96 additions & 0 deletions lesson_2/задание1/styles/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@

body {
font-family: Tahoma, Arial, sans-serif;
}

div {
box-sizing: border-box;
}

.intro {
width: 1003px;
margin: 70px auto 0px auto;
color: #36c1d0;
}

.block__element span {
background: #dee8fb;
color: #366bd0;
display: block;
width: 40px;
height: 40px;
line-height: 40px;
text-align: center;
border-radius: 50%;
position: absolute;
left: 50%;
margin-left: -20px;
top: 50%;
margin-top: -20px;
}

.block {
background: #36c1d0;
width: 1000px;
height: 600px;
margin: 60px auto;
padding: 20px;
}

.block__element {
background: #fff;
width: 10%;
height: 100px;
position: relative;
margin: 6px;
}

.credits {
width: 1000px;
margin: 0 auto 65px auto;
}

.credits__links {
padding: 0;
margin: 0;
}

.credits__link {
display: block;
}

.credits__link a {
font-size: 13px;
text-decoration: none;
border-bottom: 1px solid rgba(54, 193, 208, 0.42);
color: #36c1d0;
font-weight: bold;
margin-right: 30px;
padding-bottom: 4px;
}

.credits__link a:hover {
border-bottom: 0;
}

/* Flexbox CSS Styling */

.flex-container {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}

.flex-element {
width: 30%;
background-color: #1418e0;
}

.block__element1 {
height: 300px;
}

.block__element {
height: 150 px;
}

46 changes: 46 additions & 0 deletions lesson_2/задание2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8" />
<title>Homework</title>
<link rel="stylesheet" href="styles/styles.css">
</head>

<body>
<h1 class="intro">
FLEXBOX CSS
</h1>
<div class="block flex-container">
<div class="block__element flex-element2">
<span>1</span>
</div>
<div class="block__element flex-element">
<span>2</span>
</div>
<div class="block__element flex-element">
<span>3</span>
</div>
<div class="block__element flex-element">
<span>4</span>
</div>
<div class="block__element flex-element">
<span>5</span>
</div>
<div class="block__element flex-element">
<span>6</span>
</div>
<div class="block__element flex-element">
<span>7</span>
</div>
<div class="block__element flex-element3">
<span>8</span>
</div>
<div class="block__element flex-element1">
<span>9</span>
</div>
</div>

</body>

</html>
Loading