Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit c745d36

Browse files
game page
1 parent 0e9af9a commit c745d36

File tree

9 files changed

+82
-7
lines changed

9 files changed

+82
-7
lines changed

src/components/containers/game/index.scss

+11-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@
1010
justify-content: space-between;
1111
}
1212

13+
.start-button-block{
14+
width: 100%;
15+
padding: 15rem;
16+
display: flex;
17+
align-items: center;
18+
justify-content: center;
19+
overflow: hidden;
20+
}
21+
1322
.square-container{
14-
border: 1px solid #979797;
23+
border: 1px solid $green;
1524
padding: 1.2rem;
1625
width: 100%;
1726
height: 50vh;
@@ -29,6 +38,7 @@
2938
width: 5rem;
3039
height: 5rem;
3140
background-color: $green;
41+
animation-duration: 0.4s;
3242
}
3343

3444
.completed{

src/components/containers/game/index.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {setTransactionInfo} from "../../../actions/set-transaction-info";
1010
import {IService} from "../../../services/model";
1111
import {withService} from "../../hoc-helpers/with-service";
1212
import {ITransactionsService, TransactionInfoService} from "../../../services/transactions-service/model";
13+
import {ButtonAnimate} from "../../ui/button-animate";
1314

1415
interface IDispatchProps {
1516
dispatch: Dispatch
@@ -57,9 +58,12 @@ class Game extends React.Component<IProps, {}> {
5758
<p>Total amount of transactions: {transactions.length}</p>
5859
</div>
5960
</div>
61+
{/*<div className={'start-button-block'}>*/}
62+
{/* <ButtonAnimate name={'Begin'}/>*/}
63+
{/*</div>*/}
6064
<div className={'square-container'} onClick={this.handlerClick}>
6165
{transactions && transactions.map((item: ITransaction.Model) => (
62-
<div key={item.id} className={`square ${item.status}`}/>
66+
<div key={item.id} className={`square ${item.status} animated zoomInRight`}/>
6367
))}
6468
</div>
6569
</div>

src/components/containers/home/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export default class Home extends React.Component {
1919
At the end, we will show you how close you came to overhelm the system.</p>
2020
<Button name={'Play the game'} linkTo={'/game'}/>
2121
<div className={'padding-b'}/>
22-
<Button name={'Read how it works'} linkTo={'/'}/>
22+
<Button typeALink={true} name={'Read how it works'} linkTo={'https://solana.com/category/blog/'}/>
2323
</div>
2424
<div className={'hero-illustration'}>
25-
<object id={'hero'} data={heroImage} type={'image/svg+xml'}></object>
25+
<object id={'hero'} data={heroImage} type={'image/svg+xml'}/>
2626
</div>
2727
</div>
2828
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@import '~@styles/variables/colors';
2+
@import '~@styles/tools/transitions';
3+
4+
.button-animate-component {
5+
font-size: 1.8rem;
6+
line-height: 2.4rem;
7+
padding: 2.4rem;
8+
min-width: 20rem;
9+
background-color: $green;
10+
border: 1px solid $green;
11+
box-shadow: none;
12+
color: #242424;
13+
font-weight: 700;
14+
text-transform: uppercase;
15+
cursor: pointer;
16+
display: flex;
17+
align-items: center;
18+
justify-content: center;
19+
text-align: center;
20+
@include transition;
21+
22+
&:hover{
23+
background-color: $black;
24+
color: $green;
25+
@include transition;
26+
}
27+
}
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as React from 'react';
2+
3+
import './index.scss';
4+
5+
interface IProps {
6+
name: string
7+
onClick?(): void
8+
}
9+
10+
export const ButtonAnimate = ({name, onClick}: IProps) => {
11+
12+
return (
13+
<button onClick={onClick} className={'button-animate-component animated infinite pulse'}>{name}</button>
14+
)
15+
};

src/components/ui/button/index.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,18 @@ import {Link} from "react-router-dom";
66
interface IProps {
77
name: string
88
linkTo: string
9+
typeButton?: boolean
10+
typeALink?: boolean
11+
onClick?(): void
912
}
1013

11-
export const Button = ({name, linkTo}: IProps) => {
14+
export const Button = ({name, linkTo, typeButton,typeALink,onClick}: IProps) => {
1215

1316
return (
14-
<Link to={linkTo} className={'button-component'}>{name}</Link>
17+
<React.Fragment>
18+
{!typeButton && !typeALink && <Link to={linkTo} className={'button-component'}>{name}</Link>}
19+
{typeButton && <button onClick={onClick} className={'button-component'}>{name}</button>}
20+
{typeALink && <a href={linkTo} className={'button-component'}>{name}</a>}
21+
</React.Fragment>
1522
);
1623
};

src/shared/styles/animate.scss

+11
Large diffs are not rendered by default.

src/shared/styles/global.scss

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import "./variables/colors.scss";
22
@import "./tools/transitions.scss";
33
@import "./typography/typography.scss";
4+
@import "/animate.scss";
45

56
@font-face {
67
font-family: 'Exo';

src/shared/styles/tools/transitions.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@mixin transition(){
2-
transition: 0.15s ease-in-out;
2+
transition: 0.2s ease-in-out;
33
}
44

55
@mixin transition-hover(){

0 commit comments

Comments
 (0)