Skip to content

Commit aebebff

Browse files
committed
Initial commit
Created from https://vercel.com/new
0 parents  commit aebebff

File tree

110 files changed

+67998
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+67998
-0
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.next
2+
dist
3+
node_modules
4+
out
5+
public

.eslintrc.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
node: true
6+
},
7+
extends: [
8+
'eslint:recommended',
9+
'plugin:react/recommended',
10+
'plugin:@typescript-eslint/recommended',
11+
'plugin:@next/next/recommended'
12+
],
13+
overrides: [],
14+
parser: '@typescript-eslint/parser',
15+
parserOptions: {
16+
ecmaVersion: 'latest',
17+
sourceType: 'module'
18+
},
19+
settings: {
20+
react: {
21+
version: 'detect'
22+
}
23+
},
24+
plugins: ['react', '@typescript-eslint'],
25+
rules: {
26+
'react/react-in-jsx-scope': 'off'
27+
}
28+
}

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts
37+
38+
39+
# next-pwa
40+
**/public/workbox-*
41+
**/public/sw.js*

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run eslint
5+
npm run pretty-quick-staged

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.next
2+
dist
3+
node_modules
4+
out
5+
public

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": false,
3+
"useTabs": false,
4+
"singleQuote": true,
5+
"trailingComma": "none",
6+
"bracketSpacing": true,
7+
"arrowParens": "avoid",
8+
"printWidth": 90
9+
}

LICENCE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Manan Tank
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# cybertype.app
2+
3+
A Fast and Minimal Typing App.
4+
5+
Checkout [cybertype.app](https://cybertype.app/)
6+
7+
Practice typing in various modes such as common 1k, 5k, 10k English Words, most commonly misspelled words, Quotes or Programming Language keywords for various languages such as JavaScript, HTML, CSS, Rust, Python, C++ etc with Sweet Mechanical Keyboard Sounds.
8+
9+
<br>
10+
11+
## Awesome Themes
12+
13+
<img src='./docs/themes.png' />
14+
15+
<br>
16+
17+
## Speed Heatmap
18+
19+
Find your weakness and keep practicing to improve your typing speed.
20+
21+
<p align="center">
22+
<img src='./docs/heatmap.png' width='400' align='center' />
23+
</p>
24+
25+
<br/>
26+
27+
## Mechanical Keyboard Sounds
28+
29+
<p align="center">
30+
<img src='./docs/switches.png' width='600' align='center' />
31+
</p>
32+
33+
<br>
34+
35+
## Super Fast, Minimal and Installable 💯
36+
37+
It is a Progressive Web app that can be installed and can work 100% offline.
38+
39+
<p align="center">
40+
<img src='./docs/perf.png' width='500' />
41+
</p>
42+
43+
### Created with
44+
45+
- `TypeScript`
46+
- `Next.js`,
47+
- `React`
48+
- `SCSS`
49+
- `use-immer`, `howler`, `next-pwa`
50+
51+
<br>
52+
<br>
53+
54+
### Credits for Data Collection
55+
56+
JSON Data for various languages is collected from the amazing [MonkeyType](https://github.com/monkeytypegame/monkeytype) Repository.

components/ClientOnly.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { useState, useEffect } from 'react'
2+
3+
type Props = {
4+
children: JSX.Element | JSX.Element[]
5+
ssr?: JSX.Element
6+
}
7+
8+
// wrap stuff with ClientOnly that is browser specific or is customized to the client ( using localStorage, etc )
9+
export function ClientOnly({ children, ssr }: Props) {
10+
const [hasMounted, setHasMounted] = useState(false)
11+
useEffect(() => {
12+
setHasMounted(true)
13+
}, [])
14+
if (!hasMounted) {
15+
return ssr || null
16+
}
17+
return <> {children} </>
18+
}

components/DataSelector.tsx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import { Dispatch } from 'react'
2+
import { Action } from '../lib/types'
3+
import styles from '../styles/DataSelector.module.scss'
4+
5+
export const dataNameGroups = [
6+
{
7+
group: 'English',
8+
values: [
9+
'Quotes',
10+
'English 200',
11+
'English 1K',
12+
'English 5K',
13+
'English 10K',
14+
'Wordle',
15+
'Commonly Misspelled'
16+
]
17+
},
18+
{
19+
group: 'Programming',
20+
values: [
21+
'JavaScript',
22+
'Rust',
23+
'HTML',
24+
'CSS',
25+
'C++',
26+
'SQL',
27+
'Git',
28+
'Bash',
29+
'Python',
30+
'Java',
31+
'C#'
32+
]
33+
}
34+
]
35+
36+
type Props = { dispatch: Dispatch<Action>; handleClose: () => void }
37+
38+
export function DataSelector({ dispatch, handleClose }: Props) {
39+
return (
40+
<div className={styles.dataSelector}>
41+
{dataNameGroups.map(dataNameGroup => (
42+
<div key={dataNameGroup.group} className={styles.optionGroup}>
43+
<h3 className={styles.groupTitle}> {dataNameGroup.group} </h3>
44+
<div className={styles.options}>
45+
{dataNameGroup.values.map(value => (
46+
<div
47+
key={value}
48+
className={styles.option}
49+
onClick={() => {
50+
handleClose()
51+
dispatch({ type: 'setDataName', data: value })
52+
}}
53+
>
54+
{value}
55+
</div>
56+
))}
57+
</div>
58+
</div>
59+
))}
60+
</div>
61+
)
62+
}

0 commit comments

Comments
 (0)