README, data/css updates

This commit is contained in:
Gene Mecija 2020-02-13 11:26:23 -08:00
parent ea24a5161a
commit 80f4ee8af4
9 changed files with 68 additions and 107 deletions

View file

@ -1,68 +1,30 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). # Learn Morse Code
## Available Scripts LearnMorseCode.net helps beginners learn Morse code through several features, the main of which is a telegraph with live translation.
In the project directory, you can run: <p align=center>
<img src="telegraph.gif"
width=325px
style="border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.4);"></p>
### `npm start` ## Features
* **Telegraph**\
Press the button(s) to generate tones. See a live translation of your tones in both Morse code and alphanumeric characters. Customize the telegraph by choosing the telegraph type, tone frequency, and speed (WPM).
Runs the app in the development mode.<br /> * **Practice Mode**\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. Freely use the telegraph to practice Morse code while reading about it in the sidebar.
The page will reload if you make edits.<br /> * **Challenge Mode**\
You will also see any lint errors in the console. Take timed challenges to translate words into Morse code. Customize challenges by changing the word list category, word count, and word order.
### `npm test` * **Legend**\
See the Morse alphabet and other characters in the legend. Tap on a legend item to hear the Morse translation.
Launches the test runner in the interactive watch mode.<br /> * **Morse Translator**\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. Type in the translator below the legend and see/listen to the Morse translation.
### `npm run build` ## App Info
This web app was built using HTML, CSS, and ReactJS. It utilizes React hooks to manage state and component lifecycle.
Builds the app for production to the `build` folder.<br /> See it live here: LearnMorseCode.net
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.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent 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 youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt 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/).
### Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
### Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
### Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
### Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
### Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
### `npm run build` fails to minify
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

View file

@ -2,6 +2,7 @@
"name": "learn-morse-code", "name": "learn-morse-code",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"homepage":"https://genemecija.github.io/learn-morse-code",
"dependencies": { "dependencies": {
"@testing-library/jest-dom": "^4.2.4", "@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0", "@testing-library/react": "^9.4.0",

View file

@ -1,33 +1,16 @@
import React from "react" import React from "react"
import { contactLinks } from "../data/social"
export default (function Footer() { export default (function Footer() {
const contactLinks = {
'email': {
name: 'Email',
icon: "ri-mail-line",
link: 'mailto:gene@genemecija.com?subject='+encodeURIComponent('Hello, Gene!')
},
'github': {
name: 'GitHub',
icon: 'ri-github-fill',
link: 'https://github.com/genemecija'
},
'twitter': {
name: 'Twitter',
icon: 'ri-twitter-fill',
link:'https://twitter.com/genemecija'
}
}
function handleClick(event) { function handleClick(event) {
window.open(contactLinks[event.target.id]['link']) window.open(contactLinks[event.target.id]['link'])
} }
return ( return (
<div id="footer"> <div id="footer">
app by @genemecija app by @genemecija&nbsp;<span id="contact-icons"><i id="twitter" onClick={handleClick} className={contactLinks['twitter']['icon']}></i></span>
contact&nbsp;<span id="contact-icons"><i id="twitter" onClick={handleClick} className={contactLinks['twitter']['icon']}></i>&nbsp;<i id="email" onClick={handleClick} className={contactLinks['email']['icon']}></i></span>&nbsp; contact&nbsp;<span id="contact-icons"><i id="email" onClick={handleClick} className={contactLinks['email']['icon']}></i></span>&nbsp;
code&nbsp;<span id="contact-icons"><i id="github" onClick={handleClick} className={contactLinks['github']['icon']}></i></span> code&nbsp;<span id="contact-icons"><i id="github" onClick={handleClick} className={contactLinks['github']['icon']}></i></span>
</div> </div>
) )

View file

@ -1,25 +1,8 @@
import React from "react" import React from "react"
import { shareLinks } from "../data/social"
export default (function Header () { export default (function Header () {
const shareLinks = {
'twitter': {
name: 'Twitter',
icon: 'ri-twitter-fill',
link:'https://twitter.com/intent/tweet?text=Check%20out%20this%20site%20that%20helps%20you%20learn%20Morse%20Code%3A%20https%3A//learnmorsecode.com%20%40genemecija%20%23morse%20%23morsecode'
},
'facebook': {
name: 'Facebook',
icon: 'ri-facebook-box-fill',
link:'https://www.facebook.com/sharer/sharer.php?u=https%3A//learnmorsecode.com'
},
'email': {
name: 'Email',
icon: "ri-mail-line",
link: 'mailto:?subject='+encodeURIComponent('Check out this site that helps you learn Morse code! https://learnmorsecode.com')
}
}
function PopupCenter(url, title, w, h) { function PopupCenter(url, title, w, h) {
// Credit: http://www.xtf.dk/2011/08/center-new-popup-window-even-on.html // Credit: http://www.xtf.dk/2011/08/center-new-popup-window-even-on.html

View file

@ -7,10 +7,6 @@
cursor: default; cursor: default;
-ms-touch-action: manipulation; -ms-touch-action: manipulation;
touch-action: manipulation; touch-action: manipulation;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
} }
button { button {
@ -725,6 +721,10 @@ i[class*="ri-"] {
} }
#morseButton { #morseButton {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width: 100px; width: 100px;
height: 100px; height: 100px;
margin-top: 30px; margin-top: 30px;
@ -1649,8 +1649,6 @@ i[class*="ri-"] {
} }
#root #main-content #main-interface #morseButton { #root #main-content #main-interface #morseButton {
margin-top: 0; margin-top: 0;
-webkit-transform: scale(0.85);
transform: scale(0.85);
} }
} }
/*# sourceMappingURL=App.css.map */ /*# sourceMappingURL=App.css.map */

File diff suppressed because one or more lines are too long

36
src/data/social.js Normal file
View file

@ -0,0 +1,36 @@
const shareLinks = {
'twitter': {
name: 'Twitter',
icon: 'ri-twitter-fill',
link:'https://twitter.com/intent/tweet?text=Check%20out%20this%20site%20that%20helps%20you%20learn%20Morse%20Code%3A%20https%3A//learnmorsecode.net%20%40genemecija%20%23morse%20%23morsecode'
},
'facebook': {
name: 'Facebook',
icon: 'ri-facebook-box-fill',
link: 'https://www.facebook.com/sharer/sharer.php?u=https%3A//learnmorsecode.net'
},
'email': {
name: 'Email',
icon: "ri-mail-line",
link: 'mailto:?subject='+encodeURIComponent('Check out this site that helps you learn Morse code! https://learnmorsecode.net')
}
}
const contactLinks = {
'email': {
name: 'Email',
icon: "ri-mail-line",
link: 'mailto:gene@genemecija.com?subject='+encodeURIComponent('Hello, Gene!')
},
'github': {
name: 'GitHub',
icon: 'ri-github-fill',
link: 'https://github.com/genemecija'
},
'twitter': {
name: 'Twitter',
icon: 'ri-twitter-fill',
link:'https://twitter.com/genemecija'
}
}
export {shareLinks, contactLinks}

View file

@ -16,7 +16,6 @@ $main-border-radius: 3px;
padding: 0px; padding: 0px;
cursor: default; cursor: default;
touch-action: manipulation; // Disable double-tap to zoom on mobile devices touch-action: manipulation; // Disable double-tap to zoom on mobile devices
user-select: none;
} }
button { button {
font-family: $main-font; font-family: $main-font;
@ -568,6 +567,7 @@ $button-radius: 50px;
$morse-button-color: rgba(112, 138, 144,0.5); $morse-button-color: rgba(112, 138, 144,0.5);
#morseButton { #morseButton {
user-select: none;
width: $button-diameter; width: $button-diameter;
height: $button-diameter; height: $button-diameter;
margin-top: 30px; margin-top: 30px;
@ -1315,12 +1315,10 @@ $morse-button-color: rgba(112, 138, 144,0.5);
font-size: 3rem; font-size: 3rem;
span { span {
line-height: 2rem; line-height: 2rem;
// font-size: 2.3rem;
} }
} }
#morseButton { #morseButton {
margin-top: 0; margin-top: 0;
transform: scale(0.85);
} }
} }

BIN
telegraph.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 KiB