This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let $square = document.querySelector('.square'); | |
const topRight = [250, 0]; | |
const topLeft = [0, 0]; | |
const bottomRight = [250, 250]; | |
const bottomLeft = [0, 250]; | |
function delay(ms = 0) { | |
return new Promise((resolve) => { | |
setTimeout(resolve, ms); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let $container = document.querySelector('.container') | |
function makeInput(id) { | |
const $input = document.createElement('input'); | |
$input.id = id; | |
$input.name = name; | |
return $input; | |
} | |
function validation(name) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let collection = [ | |
{ | |
name: 'John', | |
age: 18, | |
friendsCount: 22 | |
}, | |
{ | |
name: 'Eve', | |
age: 17, | |
friendsCount: 14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HW</title> | |
<style> | |
.square { | |
width: 100px; | |
height: 100px; | |
background-color: red; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HW</title> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | |
<style> | |
body { | |
background-color: beige; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HW</title> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | |
<style> | |
body { | |
background-color: beige; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getUrl(url) { | |
return 'https://jsonplaceholder.typicode.com/' + url | |
} | |
function slicer(str, limit) { | |
if(str.length > limit) { | |
return str.slice(0, limit) + '...' | |
} else { | |
return str | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeSwap() { | |
let i = 0; | |
return function (a, b) { | |
if (i++ % 2 === 0) { | |
return [a, b]; | |
} | |
return [b, a]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Validator { | |
constructor(string) { | |
this.string = string; | |
} | |
isEmail() { | |
return this.string.includes('@') && this.string.includes('.') | |
} | |
isDate() { | |
return /\d\d\.\d\d\.\d\d/.test(this.string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HW</title> | |
<style> | |
.carousel { | |
display: flex; | |
justify-content: space-between; | |
align-items: center; |
NewerOlder