This file contains hidden or 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 WRING_OUT_TIME = 250; | |
const SQUAT_TIME = 200; | |
function wringOut(count) { | |
return new Promise((resolve, reject) => { | |
if (count > 100) { | |
reject(new Error('Слишком много отжиманий')) | |
} else { | |
setTimeout(() => { |
This file contains hidden or 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>Document</title> | |
</head> |
This file contains hidden or 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 getResource = async (url) => { | |
const response = await fetch(url); | |
if (!response.ok) { | |
throw new Error(`Ошибка по адресу ${url}, статус ошибки ${response.status}`) | |
} | |
return await response.json(); | |
}; |
This file contains hidden or 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
:root { | |
--star-size: 15px; | |
--star-color: #8f8e8e62; | |
--star-background: #fc0; | |
} | |
.star-rating { | |
--percent: calc(var(--rating) / 5 * 100%); | |
display: inline-block; | |
font-size: var(--star-size); |
This file contains hidden or 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
.gradiented-btn { | |
width: 165px; | |
height: 50px; | |
border: double 3px transparent; | |
border-radius: 30px; | |
background-image: linear-gradient(white, white), | |
radial-gradient(circle at top left, #f00, #3020ff); | |
background-origin: border-box; | |
background-clip: content-box, | |
border-box; |
This file contains hidden or 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
@media all and (-ms-high-contrast:none) { | |
} |
This file contains hidden or 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
/* Insert Login Button inside regform block */ | |
function insertAfter(referenceNode, newNode) { | |
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); | |
} | |
var mibileLoginBtn = document.createElement("div"); | |
mibileLoginBtn.innerHTML = "Log In"; | |
mibileLoginBtn.classList.add('btn', 'login-btn-mobile'); | |
var multiButtonsForm = document.querySelector(".main-section .reg-form-block"); | |
var nextButton = multiButtonsForm.querySelector('.next-btn'); |
This file contains hidden or 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
// //INIT LOGIN FORM | |
const loginSelector = document.querySelector('.login-form-block'); | |
const loginFormObj = new LoginForm(loginSelector); | |
new FieldEvents(loginSelector); | |
// // INIT REGFORM | |
const regformSelector = document.querySelector(".reg-form.top"); | |
const regform = new Regform(regformSelector, { | |
hasMultiSteps: true, | |
pagination: { |
This file contains hidden or 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
//animated section | |
function throttle(fn, wait) { | |
let time = Date.now(); | |
return function() { | |
if (time + wait - Date.now() < 0) { | |
fn(); | |
time = Date.now() | |
} | |
} |