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
//Отдаёт Base64 | |
function encodeImageFileAsURL(el) { | |
let file = el; | |
let reader = new FileReader(); | |
reader.onloadend = function () { | |
return reader.result; | |
} | |
reader.readAsDataURL(file); | |
} |
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="cookie"> | |
<p class="cookie__description">This website uses cookies to ensure you get the best experience on our website.</p> | |
<div class="cookie__link-btn"> | |
<a href="{{ route('privacy-policy') }}" class="cookie__link">Cookie Settings</a> | |
<button class="cookie__accept-btn">Accept all cookies</button> | |
</div> | |
</div> |
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 http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Promise Error</title> | |
<style>img { | |
max-width: 200px; | |
}</style> |
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
// ES6 | |
class ProductES { | |
constructor(brand, price, discount) { | |
this.brand = brand; | |
this.price = price; | |
this.discount = discount; | |
} | |
get brand() { | |
return this._brand; |
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 names = ['Denis', 'Ivan', 'Maks', 'Olga'] | |
function mapArray(arr, fn) { | |
let res = [] | |
for (let i = 0; i < arr.length; i++) { | |
res.push(fn(arr[i])); | |
} | |
return res; | |
} |
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
<style> | |
[v-cloak] { | |
display: none; | |
} | |
</style> | |
<div id="app" v-cloak> | |
</div> |
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 people = [ | |
{name: 'Mihail', age: 15, budget: 100}, | |
{name: 'Maria', age: 25, budget: 200}, | |
{name: 'Miron', age: 35, budget: 300}, | |
] | |
people.forEach((person, index, pArr) => { | |
console.log(person) | |
console.log(person.name) | |
console.log(person.age) |
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 map = new Map(); | |
map.set('42', 4222); | |
map.set(42, '4222'); | |
map.set(44, '666'); | |
console.log(map.get('42')); // 4222 | |
console.log(map.has('42')); // true | |
console.log(map.has(43)); // false | |
console.log(map.size); // 3 | |
console.log(map); |
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
<img src="img/img_x1.jpg" | |
srcset="img/img_x2.jpg 2x img/img_x3.jpg 3x"> | |
<img src="img/img_x1.jpg" | |
srcset="img/img_x2.jpg 500w img/img_x3.jpg 700w img/img_x4.jpg 1000w"> |
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>svg</title> | |
<style> | |
svg { | |
width: 100%; | |
height: 100%; | |
border: 2px solid darkolivegreen; |
NewerOlder