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
// Обновляем в том случае если, изменение окна больше или меньше на 100px | |
let screen_width = window.innerWidth | |
window.addEventListener('resize', (e) => { | |
let res = screen_width - e.target.innerWidth | |
if (res > 100) { | |
location.reload() | |
} | |
if (res < -100) { | |
location.reload() | |
} |
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
<div class="wrap_for_arrow"> | |
<!-- Слайд влево --> | |
<span id="btn_left"></span> | |
<div class="wrap_overflow"> | |
<div class="wrap-brand"> <!-- Обёртка для брэндов --> | |
<a href="#"><img src="img/brand/brand_gipersport.svg" alt="gipersport"></a> | |
<a href="#"><img src="img/brand/brand_mirsporta.svg" alt="mirsporta"></a> | |
<a href="#"><img src="img/brand/brand_sportmaster.svg" alt="sportmaster"></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
window.getComputedStyle(logo).display |
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 valid_mail () { | |
let inp_mail = document.getElementById('user__email') | |
if (!inp_mail.value.match(/^([a-z0-9_-]+\.)*[a-z0-9_-]+@[a-z0-9_-]+(\.[a-z0-9_-]+)*\.[a-z]{2,6}$/gi)) { | |
console.log('Валидацию не прошёл'); | |
} else { | |
console.log('Валидацию Прошёл!'); | |
} | |
} |
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>Document</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<img src="2.jpg" alt="#"> | |
<img src="3.jpg" alt="#"> |
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
<?php | |
/*setcookie("utm_term", "test__utm_term"); | |
setcookie("utm_compaign", "test__utm_compaign"); | |
setcookie("utm_content", "test__utm_content"); | |
setcookie("id", "10"); | |
setcookie("utm_source", "test__utm_source"); | |
setcookie("utm_medium", "test__utm_medium");*/ | |
/*$url = 'http://45.67.56.103:8001/api/v1/utm/'; |
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 obj = Object.create({ | |
calculateAge () { | |
console.log('Age:', new Date().getFullYear()) - 36 | |
} | |
}, { | |
name1: { | |
value: 'Denis1', | |
enumerable: true, | |
configurable: true, |
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"> | |
<meta name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<link rel="stylesheet" href="css/main.css"> | |
</head> |
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
const destr_arr = [1, 2, 3, 4, 5, 6, 7, 18] | |
const [a, b] = destr_arr | |
const [c, d, ...e] = destr_arr | |
const [f, g = 42, ...k] = destr_arr | |
console.log(a, b, c, d, e, f, g, k) | |
const arr = [1, 2, 3, 4, 5, 6, 7, 8] | |
console.log(Math.max(...arr)) // 8 | |
console.log(Math.min(...arr)) // 1 |
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
// Generator | |
function *gen (num = 4) { | |
for (let i = 0; i < num; i++) { | |
yield i | |
} | |
} | |
const iter = gen(3) | |
console.log(iter.next()) // { value: 0, done: false } | |
console.log(iter.next()) // { value: 1, done: false } |