Skip to content

Commit 2d12bd7

Browse files
authored
Merge pull request #1 from NHNerd/dev
Dev
2 parents 65fb9a4 + d3314b0 commit 2d12bd7

12 files changed

Lines changed: 278 additions & 140 deletions

File tree

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + React + TS</title>
7+
<title>React Draggable Card Deck</title>
88
</head>
99
<body>
1010
<div id="root"></div>

src/App.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, { useRef, useState } from 'react';
33
import Bar from './gameSession/bar/Bar';
44
import Deck from './gameSession/deck/Deck';
55
import Btns from './gameSession/footer/Btns';
6+
import About from './about/About';
67
import DebugVisual from './dev/debugVisual/DebugVisual';
78
import type { CardType, DragsStatusType } from './types/types';
89

@@ -18,6 +19,7 @@ function App() {
1819
const [devDeckRest, devDeckRestSet] = useState<number>(0);
1920
const [devDragsStatus, setDevDragsStatus] = useState<DragsStatusType[]>([]);
2021
const [devDeckVisible, devDeckVisibleSet] = useState<CardType[]>([]);
22+
const devSpeed = useRef<1 | 0.3 | 0.05>(1);
2123

2224
return (
2325
<>
@@ -31,16 +33,17 @@ function App() {
3133
btnsSet={btnsSet}
3234
devDeckRestSet={devDeckRestSet}
3335
devDeckVisibleSet={devDeckVisibleSet}
34-
devDragsStatus={devDragsStatus}
3536
setDevDragsStatus={setDevDragsStatus}
37+
devSpeed={devSpeed}
3638
/>
3739
</section>
3840
<section className='flexChildren3'>
3941
<Btns btns={btns} btnsSet={btnsSet} />
4042
</section>
4143
</section>
4244

43-
<DebugVisual devDragsStatus={devDragsStatus} devDeckVisible={devDeckVisible} />
45+
<DebugVisual devDragsStatus={devDragsStatus} devDeckVisible={devDeckVisible} devSpeed={devSpeed} />
46+
<About />
4447
</>
4548
);
4649
}

src/about/About.module.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.aboutBtn {
2+
margin: 10px;
3+
padding: 10px;
4+
position: absolute;
5+
top: 0;
6+
right: 0;
7+
user-select: none;
8+
font-size: 18px;
9+
}
10+
11+
.opacity0 {
12+
opacity: 0;
13+
}

src/about/About.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React, { useState } from 'react';
2+
import AboutCss from './About.module.css';
3+
4+
function About() {
5+
const [isOpen, setIsOpen] = useState<boolean>(false);
6+
7+
return (
8+
<>
9+
<button onClick={() => setIsOpen(!isOpen)} className={AboutCss.aboutBtn}>
10+
?
11+
</button>
12+
<section className={`${isOpen ? '' : AboutCss.opacity0}`}>
13+
About
14+
<main>Description</main>
15+
<footer>Contacts</footer>
16+
</section>
17+
</>
18+
);
19+
}
20+
21+
export default About;

0 commit comments

Comments
 (0)