ijl cli init
This commit is contained in:
parent
650253121c
commit
11f3ee76ba
22
ijl.config.js
Normal file
22
ijl.config.js
Normal file
@ -0,0 +1,22 @@
|
||||
const pkg = require('./package')
|
||||
|
||||
module.exports = {
|
||||
apiPath: 'stubs/api',
|
||||
webpackConfig: {
|
||||
output: {
|
||||
publicPath: `/static/${pkg.name}/${process.env.VERSION || pkg.version}/`
|
||||
}
|
||||
},
|
||||
/* use https://kc.admin.inno-js.ru/ to create config, navigations and features */
|
||||
navigations: {
|
||||
'r-and-m.main': '/r-and-m'
|
||||
},
|
||||
features: {
|
||||
'r-and-m': {
|
||||
// add your features here in the format [featureName]: { value: string }
|
||||
},
|
||||
},
|
||||
config: {
|
||||
key: 'value'
|
||||
}
|
||||
}
|
7807
package-lock.json
generated
Normal file
7807
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
28
package.json
Normal file
28
package.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "r-and-m",
|
||||
"version": "1.0.0",
|
||||
"description": "![Рик огурчик!!!](./docs/cucumber.webp)",
|
||||
"main": "./src/index.tsx",
|
||||
"directories": {
|
||||
"doc": "docs"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "ijl-cli server --port=8099 --with-open-browser",
|
||||
"build": "npm run clean && ijl-cli build --dev",
|
||||
"build:prod": "npm run clean && ijl-cli build",
|
||||
"clean": "rimraf dist"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@ijl/cli": "^5.1.0",
|
||||
"@types/react": "^18.2.74",
|
||||
"@types/react-dom": "^18.2.24",
|
||||
"express": "^4.19.2",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"typescript": "^5.4.4"
|
||||
}
|
||||
}
|
14
src/app.tsx
Normal file
14
src/app.tsx
Normal file
@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
|
||||
import { LandingPage } from './pages/landing'
|
||||
|
||||
import './style/main.css'
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
<LandingPage />
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
23
src/index.tsx
Normal file
23
src/index.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
|
||||
import App from './app';
|
||||
|
||||
export default () => <App/>;
|
||||
|
||||
let rootElement: ReactDOM.Root
|
||||
|
||||
export const mount = (Сomponent, element = document.getElementById('app')) => {
|
||||
const rootElement = ReactDOM.createRoot(element);
|
||||
rootElement.render(<Сomponent/>);
|
||||
|
||||
if(module.hot) {
|
||||
module.hot.accept('./app', ()=> {
|
||||
rootElement.render(<Сomponent/>);
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export const unmount = () => {
|
||||
rootElement.unmount();
|
||||
};
|
98
src/pages/landing.tsx
Normal file
98
src/pages/landing.tsx
Normal file
@ -0,0 +1,98 @@
|
||||
import React from "react";
|
||||
|
||||
export const LandingPage = () => {
|
||||
return (
|
||||
<>
|
||||
<header id="header">
|
||||
<img
|
||||
className="logo"
|
||||
height="44p"
|
||||
width="227"
|
||||
src="./assets/logo_4x.png"
|
||||
alt="Логотип. Надпись Рик и Морти"
|
||||
srcSet="
|
||||
./assets/logo_1x.png 220w,
|
||||
./assets/logo_2x.png 445w,
|
||||
./assets/logo_4x.png 880w
|
||||
"
|
||||
sizes="
|
||||
(max-width: 240px) 100px,
|
||||
(min-width: 320px) 440px,
|
||||
(min-width: 520px) 880px
|
||||
"
|
||||
/>
|
||||
|
||||
<nav className="nav">
|
||||
<ul>
|
||||
<li>
|
||||
<a className="link" href="#01">
|
||||
Home
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a className="link link__contrast" href="#02">
|
||||
Персонажи
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a className="link link__contrast" href="#03">
|
||||
Локации
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a className="link link__contrast" href="#04">
|
||||
Эризоды
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main className="main">
|
||||
<header className="card card-main">
|
||||
<div className="card-text">
|
||||
<h1 className="h1">
|
||||
Персонажи из <br />
|
||||
<span className="brand-text">огурчиковой вселенной</span>
|
||||
</h1>
|
||||
|
||||
<p className="p card--text__p">
|
||||
На этой странице представлены персонажи из сериала “
|
||||
<a className="link" href="#">
|
||||
Rick and Morty
|
||||
</a>
|
||||
”. Этот популярный анимационный сериал, созданный Джастином
|
||||
Ройландом и Дэном Хармоном, рассказывает о приключениях Рика
|
||||
Санчеза, гениального и эксцентричного ученого, и его внука Морти
|
||||
Смита.
|
||||
</p>
|
||||
</div>
|
||||
<img className="card--img" src="./assets/cucumber.png" alt="" />
|
||||
</header>
|
||||
<article className="card card__toRight">
|
||||
<div className="card-text">
|
||||
<h1 className="h1">
|
||||
Персонажи из <br />
|
||||
<span className="brand-text">огурчиковой вселенной</span>
|
||||
</h1>
|
||||
|
||||
<p className="p card--text__p">
|
||||
На этой странице представлены персонажи из сериала “
|
||||
<a className="link" href="#">
|
||||
Rick and Morty
|
||||
</a>
|
||||
”. Этот популярный анимационный сериал, созданный Джастином
|
||||
Ройландом и Дэном Хармоном, рассказывает о приключениях Рика
|
||||
Санчеза, гениального и эксцентричного ученого, и его внука Морти
|
||||
Смита.
|
||||
</p>
|
||||
</div>
|
||||
<img className="card--img" src="./assets/cucumber.png" alt="" />
|
||||
</article>
|
||||
</main>
|
||||
|
||||
<aside></aside>
|
||||
<footer className="page-footer"></footer>
|
||||
</>
|
||||
);
|
||||
};
|
@ -14,6 +14,10 @@
|
||||
|
||||
html { height: 100%; }
|
||||
|
||||
body.dark {
|
||||
--bg-main: #0f5c66;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "PT Sans", sans-serif;
|
||||
background-color: var(--bg-main);
|
||||
|
3
stubs/api/index.js
Normal file
3
stubs/api/index.js
Normal file
@ -0,0 +1,3 @@
|
||||
const router = require('express').Router();
|
||||
|
||||
module.exports = router;
|
25
tsconfig.json
Normal file
25
tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2017"
|
||||
],
|
||||
"outDir": "./dist/",
|
||||
"sourceMap": true,
|
||||
"esModuleInterop": true,
|
||||
"noImplicitAny": false,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"target": "es6",
|
||||
"jsx": "react",
|
||||
"typeRoots": ["node_modules/@types", "src/typings"],
|
||||
"types" : ["webpack-env", "node"],
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"**/*.test.ts",
|
||||
"**/*.test.tsx",
|
||||
"node_modules/@types/jest"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user