Browse Source

оформление

pull/1/head
Sergey Verevkin 4 years ago
parent
commit
91937d38fb
  1. 14
      src/components/App/App.css
  2. 7
      src/components/GamePage/GamePage.css
  3. 7
      src/components/IntroPage/IntroPage.css
  4. 13
      src/index.css
  5. 9
      src/index.tsx
  6. 2
      src/model/Game.ts
  7. 2
      src/model/GameDto.ts
  8. 10
      src/model/WitchDto.ts
  9. 2
      src/reportWebVitals.js
  10. 29
      src/resources/witch.svg
  11. 13
      src/store/apiStore/apiStore.service.ts

14
src/components/App/App.css

@ -1,3 +1,10 @@
/*
* @file Класс
* @version 2022.2.6
* @author Verevkin S.A.
* @copyright Verevkin S.A.
*/
.App {
text-align: center;
}
@ -6,10 +13,12 @@
color: red;
font-weight: bold;
}
.game {
width: 100%;
max-width: 500px;
}
h1 {
color: gold;
}
@ -21,9 +30,11 @@ h1 {
.witch-row.state2 {
border: 1px solid darkred;
}
.witch-row.state0 {
border: 0;
}
.witch-row.state1 {
border: 1px solid darkgreen;
}
@ -31,12 +42,15 @@ h1 {
.small {
font-size: 0.5em;
}
.witch {
width: 100px;
}
.witch img {
width: 100px;
}
.witch:hover {
opacity: 0.5;
animation: App-logo-spin infinite 10s linear;

7
src/components/GamePage/GamePage.css

@ -0,0 +1,7 @@
/*
* @file Класс
* @version 2022.2.6
* @author Verevkin S.A.
* @copyright Verevkin S.A.
*/

7
src/components/IntroPage/IntroPage.css

@ -0,0 +1,7 @@
/*
* @file Класс
* @version 2022.2.6
* @author Verevkin S.A.
* @copyright Verevkin S.A.
*/

13
src/index.css

@ -1,13 +1,20 @@
/*
* @file Класс
* @version 2022.2.6
* @author Verevkin S.A.
* @copyright Verevkin S.A.
*/
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
monospace;
}

9
src/index.tsx

@ -1,3 +1,10 @@
/*
* @file Корневой элемент
* @version 2022.2.6
* @author Verevkin S.A.
* @copyright Verevkin S.A.
*/
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
@ -6,7 +13,7 @@ import reportWebVitals from './reportWebVitals';
ReactDOM.render(
<React.StrictMode>
<App />
<App/>
</React.StrictMode>,
document.getElementById('root')
);

2
src/model/Game.ts

@ -1,5 +1,5 @@
/*
* @file Класс
* @file Класс игры
* @version 2022.2.6
* @author Verevkin S.A.
* @copyright Verevkin S.A.

2
src/model/GameDto.ts

@ -1,5 +1,5 @@
/*
* @file Класс
* @file Класс dto игры
* @version 2022.2.6
* @author Verevkin S.A.
* @copyright Verevkin S.A.

10
src/model/WitchDto.ts

@ -1,10 +1,8 @@
/*
* *
* * @file Класс
* * @version {2022}.{2}.{6}
* * @author Verevkin S.A.
* * @copyright Verevkin S.A.
*
* @file Класс dto ведьмы
* @version 2022.2.6
* @author Verevkin S.A.
* @copyright Verevkin S.A.
*/
export interface IWitchDto {

2
src/reportWebVitals.js

@ -1,6 +1,6 @@
const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
import('web-vitals').then(({getCLS, getFID, getFCP, getLCP, getTTFB}) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);

29
src/resources/witch.svg

@ -1,17 +1,24 @@
<?xml version="1.0" standalone="no"?>
<!--
- @file Класс
- @version 2022.2.6
- @author Verevkin S.A.
- @copyright Verevkin S.A.
-->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="1280.000000pt" height="1009.000000pt" viewBox="0 0 1280.000000 1009.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.15, written by Peter Selinger 2001-2017
</metadata>
<g transform="translate(0.000000,1009.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M4710 10076 c0 -9 5 -16 10 -16 6 0 10 4 10 9 0 6 -4 13 -10 16 -5 3
width="1280.000000pt" height="1009.000000pt" viewBox="0 0 1280.000000 1009.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.15, written by Peter Selinger 2001-2017
</metadata>
<g transform="translate(0.000000,1009.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M4710 10076 c0 -9 5 -16 10 -16 6 0 10 4 10 9 0 6 -4 13 -10 16 -5 3
-10 -1 -10 -9z"/>
<path d="M6365 9340 c-3 -6 1 -13 9 -16 9 -3 16 -17 16 -30 0 -14 9 -37 20
<path d="M6365 9340 c-3 -6 1 -13 9 -16 9 -3 16 -17 16 -30 0 -14 9 -37 20
-53 20 -26 21 -38 18 -292 -3 -237 -5 -267 -20 -283 -11 -10 -18 -32 -18 -52
0 -20 -6 -42 -14 -49 -7 -8 -17 -39 -20 -69 -4 -31 -12 -58 -17 -61 -5 -4 -9
-22 -9 -41 0 -22 -7 -40 -20 -51 -11 -10 -20 -28 -20 -41 0 -12 -7 -25 -15
@ -202,5 +209,5 @@ c-11 110 -58 202 -103 202 -8 0 -21 16 -29 35 -8 19 -19 35 -24 35 -6 0 -10 6
0 4 -14 11 -32 14 -40 9 -138 105 -138 135 0 13 -8 24 -18 27 -24 6 -42 49
-53 130 -5 37 -14 72 -19 77 -6 6 -10 75 -10 157 0 118 3 149 15 159 10 8 15
30 15 61 0 35 5 51 18 59 27 17 94 6 126 -21z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

13
src/store/apiStore/apiStore.service.ts

@ -1,5 +1,5 @@
/*
* @file Класс
* @file Сервис взаимодействия
* @version 2022.2.6
* @author Verevkin S.A.
* @copyright Verevkin S.A.
@ -12,7 +12,7 @@ import { Mapper } from '../mapper';
const service = {
// region Публичные функции
async getGame(): Promise<Game | undefined> {
const resultPromise = tool.get<IGameDto>('/game', {});
const resultPromise = tool.get<IGameDto>('/game', []);
return resultPromise.then((response: IGameDto | undefined): (Game | undefined) => {
if (!response) return;
return Mapper.fromGame(response);
@ -20,9 +20,10 @@ const service = {
},
async gameTurn(gameGuid: string, witchGuid: string): Promise<Game | undefined> {
const resultPromise = tool.get<IGameDto>('/turn', {
gameGuid, witchGuid
});
const resultPromise = tool.get<IGameDto>('/turn', [
{name: "gameGuid", value: gameGuid},
{name: "witchGuid", value: witchGuid},
]);
return resultPromise.then((response: IGameDto | undefined): (Game | undefined) => {
if (!response) return;
return Mapper.fromGame(response);
@ -30,7 +31,7 @@ const service = {
},
async getVersion(): Promise<string | undefined> {
return tool.get<string>('/version', {});
return tool.get<string>('/version', []);
}
// endregion
};

Loading…
Cancel
Save