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
/* | |
Написать приложение для работы с REST сервисом, | |
все функции делают запрос и возвращают Promise | |
с которым потом можно работать. | |
Реализовать следующий функционал: | |
- функция getAllUsers() - должна вернуть текущий список всех пользователей в БД. | |
- функция getUserById(id) - должна вернуть пользователя с переданным id. | |
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
/* | |
1. Модифицируйте готовую функцию createPostCard() из задания | |
номер 6 (https://codepen.io/goit-fe-adv/pen/MVPaeZ) так, | |
чтобы она принимала объект post с данными для заполнения полей | |
в карточке. | |
2. Создайте функцию createCards(posts), которая принимает массив | |
объектов-карточек, вызывает функцию createPostCard(post) столько | |
раз, сколько объектов в массиве, сохраняя общий результат и возвращает | |
массив DOM-элементов всех постов. |
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 getTimeToInteractive() { | |
const { requestStart, domInteractive } = window.performance.timing; | |
return requestStart - domInteractive; | |
} | |
function getResourceEntries() { | |
return window.performance.getEntriesByType('resource') || []; | |
} |
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
// Can prefetch css and js | |
function prefetchResource(resourceUrl) { | |
const xhrRequest = new XMLHttpRequest(); | |
xhrRequest.open('GET', resourceUrl, true); | |
xhrRequest.send(); | |
} | |
// Can prefetch everything but support in not great, use for HTML | |
// <link rel="prefetch" href="path-to-content"> |
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
/* | |
Реализуйте форму фильтра товаров в каталоге и список отфильтрованных товаров. | |
Используйте шаблонизацию для создания карточек товаров. | |
Есть массив объектов (дальше в задании), каждый из которых описывает | |
ноутбук с определенными характеристиками. | |
Поля объекта по которым необходимо производить фильтрацию: size, color, release_date. | |
Поля объекта для отображения в карточке: name, img, descr, color, price, release_date. | |
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
fetch('https://api.ipify.org?format=json') | |
.then(response => { | |
if (response.ok) return response.json(); | |
throw Error('Error while fetching' + response.statusText); | |
}) | |
.then(data => console.log(data)) | |
.catch(err => console.log(err)); |
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="image-gallery js-image-gallery"> | |
<div class="fullview"> | |
<!-- Если выбран первый элемент из preview --> | |
<img src="img/fullview-1.jpeg" alt="alt text 1"> | |
</div> | |
<!-- li будет столько, сколько объектов в массиве картинок. Эти 3 для примера --> |
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
/* | |
Напишите приложение для хранения url веб-страниц в виде карточек-закладок. | |
Реализуйте следующий функционал: | |
- Используйте Gulp для сборки проекта, JS обработан транспайлером Babel, ресурсы оптимизированы | |
- Для добавления новой закладки, в приложении есть форма с элементом input и кнопкой "Добавить" | |
- В приложении есть список всех добавленных карточек-закладок, располагающийся под формой | |
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
/* | |
Сеть фастфудов предлагает несколько видов гамбургеров. | |
Основа (булочка) гамбургера может быть большой или маленькой (обязательно): | |
- маленькая (+30 денег, +50 калорий) | |
- большая (+50 денег, +100 калорий) | |
Гамбургер может быть с одной из нескольких видов начинок (обязательно): | |
- сыром (+15 денег, +20 калорий) | |
- салатом (+20 денег, +5 калорий) |
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
/* | |
Создайте скрипт секундомера. | |
По ссылке можно посмотреть пример выбрав Stopwatch http://www.online-stopwatch.com/full-screen-stopwatch/ | |
Изначально в HTML есть разметка: | |
<div class="stopwatch"> | |
<p class="time js-time">00:00.0</p> | |
<button class="btn js-start">Start</button> | |
<button class="btn js-take-lap">Lap</button> |
OlderNewer