gulp build
gulp
<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> |
//Отдаёт Base64 | |
function encodeImageFileAsURL(el) { | |
let file = el; | |
let reader = new FileReader(); | |
reader.onloadend = function () { | |
return reader.result; | |
} | |
reader.readAsDataURL(file); | |
} |
<!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> |
// ES6 | |
class ProductES { | |
constructor(brand, price, discount) { | |
this.brand = brand; | |
this.price = price; | |
this.discount = discount; | |
} | |
get brand() { | |
return this._brand; |
<style> | |
[v-cloak] { | |
display: none; | |
} | |
</style> | |
<div id="app" v-cloak> | |
</div> |
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; | |
} |
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); |
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) |
<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"> |