From 5f6ce9cad6ae2277a16eb508eb85f0caef7afa9c Mon Sep 17 00:00:00 2001 From: 0p3r4t0r Date: Wed, 27 Oct 2021 20:30:39 +0900 Subject: [PATCH] Getting started. https://github.com/facebook/create-react-app/issues/11037#issuecomment-870565090 --- .gitmodules | 6 +++ README.md | 47 +-------------------- notes.md | 2 + package.json | 1 + src/App.css | 38 ----------------- src/App.tsx | 39 +++++++++-------- src/components/organisms/Keyboard/index.tsx | 17 ++++++++ src/logo.svg | 1 - src/static/keymason | 1 + src/static/texts/amenbo_no_uta/hiragana.txt | 29 +++++++++++++ src/static/texts/amenbo_no_uta/kanji.txt | 29 +++++++++++++ tsconfig.json | 1 + yarn.lock | 46 +++++++++++++++++++- 13 files changed, 151 insertions(+), 106 deletions(-) create mode 100644 .gitmodules create mode 100644 notes.md delete mode 100644 src/App.css create mode 100644 src/components/organisms/Keyboard/index.tsx delete mode 100644 src/logo.svg create mode 160000 src/static/keymason create mode 100644 src/static/texts/amenbo_no_uta/hiragana.txt create mode 100644 src/static/texts/amenbo_no_uta/kanji.txt diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5d9232c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "keymason"] + path = keymason + url = https://github.com/0p3r4t0r/keymason.git +[submodule "src/static/keymason"] + path = src/static/keymason + url = https://github.com/0p3r4t0r/keymason.git diff --git a/README.md b/README.md index b58e0af..d0f776e 100644 --- a/README.md +++ b/README.md @@ -1,46 +1 @@ -# Getting Started with Create React App - -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `yarn start` - -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.\ -You will also see any lint errors in the console. - -### `yarn test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `yarn build` - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `yarn eject` - -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** - -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. - -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). +# Japanese Typing Practice diff --git a/notes.md b/notes.md new file mode 100644 index 0000000..d885310 --- /dev/null +++ b/notes.md @@ -0,0 +1,2 @@ +## Inspiration +https://github.com/miragecraft/keymason diff --git a/package.json b/package.json index 0f36cd0..ffa9af9 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "react-scripts": "4.0.3", + "sass": "^1.43.4", "typescript": "^4.1.2", "web-vitals": "^1.0.1" }, diff --git a/src/App.css b/src/App.css deleted file mode 100644 index 74b5e05..0000000 --- a/src/App.css +++ /dev/null @@ -1,38 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/src/App.tsx b/src/App.tsx index a53698a..7b14017 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,25 +1,24 @@ -import React from 'react'; -import logo from './logo.svg'; -import './App.css'; - +import React from "react"; +import { KeyCap, KeyLegend, KeyRow } from "components/organisms/Keyboard"; function App() { return ( -
-
- logo -

- Edit src/App.tsx and save to reload. -

- - Learn React - -
-
+ + + A + + + T + + + O + + + M + + + S + + ); } diff --git a/src/components/organisms/Keyboard/index.tsx b/src/components/organisms/Keyboard/index.tsx new file mode 100644 index 0000000..9773a8d --- /dev/null +++ b/src/components/organisms/Keyboard/index.tsx @@ -0,0 +1,17 @@ +import React from "react"; +import "static/keymason/keymason/style.css"; + +export const KeyLegend = (props: { children: React.ReactNode }) => { + const KeyLegendTag = "k-legend" as keyof JSX.IntrinsicElements; + return {props.children}; +}; + +export const KeyCap = (props: { children: React.ReactNode }) => { + const KeyCapTag = "k-cap" as keyof JSX.IntrinsicElements; + return {props.children} ; +}; + +export const KeyRow = (props: { children: React.ReactNode }) => { + const KeyRowTag = "k-row" as keyof JSX.IntrinsicElements; + return {props.children} ; +}; diff --git a/src/logo.svg b/src/logo.svg deleted file mode 100644 index 9dfc1c0..0000000 --- a/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/static/keymason b/src/static/keymason new file mode 160000 index 0000000..473f773 --- /dev/null +++ b/src/static/keymason @@ -0,0 +1 @@ +Subproject commit 473f773d15a66dd5afc31092e7e0620cadfbf3ed diff --git a/src/static/texts/amenbo_no_uta/hiragana.txt b/src/static/texts/amenbo_no_uta/hiragana.txt new file mode 100644 index 0000000..c32ef29 --- /dev/null +++ b/src/static/texts/amenbo_no_uta/hiragana.txt @@ -0,0 +1,29 @@ +あめんぼ あかいな あいうえお +うきもに こえびも およいでる + +かきのき くりのき かきくけこ +きつつき こつこつ かれけやき + +ささげに すをかけ さしすせそ +そのうお あさせで さしました + +たちましょ らっぱで たちつてと +とてとて たったと とびたった + +なめくじ のろのろ なにぬねの +なんどに ぬめって なにねばる + +はとぽっぽ ほろほろ はひふへほ +ひなたの おへやにゃ ふえをふく + +まいまい ねじまき まみむめも +うめのみ おちても みもしまい + +やきぐり ゆでぐり やいゆえよ +やまだに ひのつく よいのいえ + +らいちょうは さむかろ らりるれろ +れんげが さいたら るりのとり + +わいわい わっしょい わいうえを +うえきや いどがえ おまつりだ diff --git a/src/static/texts/amenbo_no_uta/kanji.txt b/src/static/texts/amenbo_no_uta/kanji.txt new file mode 100644 index 0000000..9abcd0c --- /dev/null +++ b/src/static/texts/amenbo_no_uta/kanji.txt @@ -0,0 +1,29 @@ +水馬 赤いな あいうえお +浮藻に 小蝦も 泳いでる + +柿の木 栗の木 かきくけこ +啄木鳥 こつこつ 枯れ欅 + +大角豆に 酢をかけ さしすせそ +その魚 浅瀬で 刺しました + +立ちましょ 喇叭で たちつてと +トテトテ タッタと 飛び立った + +蛞蝓 のろのろ なにぬねの +納戸に ぬめって なにねばる + +鳩ポッポ ほろほろ はひふへほ +日向の お部屋にゃ 笛を吹く + +蝸牛 ネジ巻 まみむめも +梅の実 落ちても 見もしまい + +焼栗 ゆで栗 やいゆえよ +山田に 灯のつく よいの家 + +雷鳥は 寒かろ らりるれろ +蓮花が 咲いたら 瑠璃の鳥 + +わいわい わっしょい わゐうゑを +植木屋 井戸換へ お祭りだ diff --git a/tsconfig.json b/tsconfig.json index a273b0c..9c7d4a8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "baseUrl": "src", "target": "es5", "lib": [ "dom", diff --git a/yarn.lock b/yarn.lock index 37c565f..27bbb5b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2344,6 +2344,14 @@ anymatch@^3.0.3, anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -3203,6 +3211,21 @@ check-types@^11.1.1: resolved "https://registry.yarnpkg.com/check-types/-/check-types-11.1.2.tgz#86a7c12bf5539f6324eb0e70ca8896c0e38f3e2f" integrity sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ== +"chokidar@>=3.0.0 <4.0.0": + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + chokidar@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" @@ -5191,7 +5214,7 @@ fsevents@^1.2.7: bindings "^1.5.0" nan "^2.12.1" -fsevents@^2.1.2, fsevents@^2.1.3, fsevents@~2.3.1: +fsevents@^2.1.2, fsevents@^2.1.3, fsevents@~2.3.1, fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -5276,6 +5299,13 @@ glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0: dependencies: is-glob "^4.0.1" +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" @@ -9225,6 +9255,13 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + recursive-readdir@2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" @@ -9645,6 +9682,13 @@ sass-loader@^10.0.5: schema-utils "^3.0.0" semver "^7.3.2" +sass@^1.43.4: + version "1.43.4" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.43.4.tgz#68c7d6a1b004bef49af0d9caf750e9b252105d1f" + integrity sha512-/ptG7KE9lxpGSYiXn7Ar+lKOv37xfWsZRtFYal2QHNigyVQDx685VFT/h7ejVr+R8w7H4tmUgtulsKl5YpveOg== + dependencies: + chokidar ">=3.0.0 <4.0.0" + sax@~1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"