https://informer.yandex.ru/informer/47370901/3_0_2...
$(document).on('click', "#product_adding", function(e){
})
gulp.task('html', function () {
gulp.src('src/*.html') //Выберем файлы по нужному пути
.pipe(rigger()) //Прогоним через rigger
.pipe(gulp.dest('dist/')) //Выплюнем их в папку build
.pipe(browserSync.reload({stream: true})); //И перезагрузим наш сервер для обновлений
});
<!DOCTYPE html>
<html>
<head lang="ru">
<meta charset="UTF-8">
<title>Пум-пум</title>
</head>
<body>
//= template/header.html
<section class="content">
Content
</section>
//= template/footer.html
</body>
</html>
for (let x = 0; x < backBtn.length; x++) {
backBtn[x].onclick = (e) => {
e.stopPropagation()
backBtn[x].closest(".navigation__list")
.classList.remove("navigation__submenu--active");
}
}
document.addEventListener("DOMContentLoaded", function(e){
document.querySelector(".button2").click()
})
render() {
return(
<div className="App">
{routes}
<Footer />
</div>
)
}
}
import React from 'react';
import {BrowserRouter as Router} from 'react-router-dom';
import {useRoutes} from './routes';
import {useAuth} from './hooks/auth.hook'
import {AuthContext} from './context/AuthContext'
import 'bootswatch/dist/sketchy/bootstrap.min.css'
function App() {
const {token, login, logout, userId} = useAuth()
const isAuthenticated = !!token
const routes = useRoutes(isAuthenticated)
return (
<AuthContext.Provider value={{token, login, logout, userId, isAuthenticated}}>
<Router>
<div className="App container">
{routes}
</div>
</Router>
</AuthContext.Provider>
);
}
export default App;
import React from 'react'
import {Switch, Route, Redirect} from 'react-router-dom'
import AdminPage from './pages/AdminPage'
import MainPage from './pages/MainPage'
import AuthPage from './pages/AuthPage'
import PostPage from './pages/PostPage'
export const useRoutes = isAuthenticated =>{
if(isAuthenticated){
return(
<Switch>
<Route path="/admin" exact>
<AdminPage/>
</Route>
<Redirect to="/admin"/>
</Switch>
)
}
return(
<Switch>
<Route path="/" exact>
<MainPage/>
</Route>
<Route path="/post/:id" exact>
<PostPage/>
</Route>
<Route path="/login" exact>
<AuthPage/>
</Route>
<Redirect to="/"/>
</Switch>
)
}
currentStep5 += step5;
$5year.textContent = `$${currentStep5}`;
currentStep10 += step10;
$10year.textContent = `$${currentStep10}`;
const n =10;
for (let i = 0; i < 12; i++) {
//просто вывод
if(i === (n-1)){
//Вывод курсивом
}
}