-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add info section, alter css for mobile.
Create footer and info components. Info component contains modal that popups onClick of more info. It explains reasons behind diceware and what list is used. Alter css of site to prevent rejigging of buttons on change of words. Make button padding smaller on smaller screens. Change colour of download windows button. Remove useless diceware1 file. (cherry picked from commit 23b854b)
- Loading branch information
1 parent
14e24ea
commit f0f2a47
Showing
11 changed files
with
198 additions
and
94 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import '../css/style.css'; | ||
import Info from './Info'; | ||
|
||
|
||
const Footer = ({pass}) => { | ||
|
||
|
||
const click = (event) => { | ||
console.log("click: href ", | ||
event.target.href) | ||
// event.preventDefault(); | ||
} | ||
|
||
|
||
return ( | ||
<div id={"footer"}> | ||
Inspired by <a href="https://diceware.herokuapp.com/" onClick={click} | ||
className="text-blue-500 hover:text-blue-800" >Michael Henriksen</a> | <Info /> | Created | ||
by <a className="text-blue-500 hover:text-blue-800" | ||
href={"https://twitter.com/RMcElhinney"}>Rob McElhinney</a> | ||
</div> | ||
); | ||
} | ||
|
||
export default Footer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
import React from 'react'; | ||
import '../css/style.css'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import Modal from '@material-ui/core/Modal'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
modal: { | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center' | ||
}, | ||
paper: { | ||
position: 'absolute', | ||
textAlign: 'left', | ||
width: '80%', | ||
backgroundColor: theme.palette.background.paper, | ||
border: '2px solid #000', | ||
boxShadow: theme.shadows[5], | ||
padding: theme.spacing(2, 4, 3), | ||
paddingTop: '2em', | ||
paddingBottom: '2em' | ||
}, | ||
})); | ||
|
||
|
||
const Info = ({pass}) => { | ||
const classes = useStyles(); | ||
const [open, setOpen] = React.useState(false); | ||
|
||
const handleOpen = (event) => { | ||
setOpen(true); | ||
event.preventDefault() | ||
}; | ||
|
||
const handleClose = (event) => { | ||
setOpen(false); | ||
ignoreClick(event) | ||
}; | ||
|
||
const link = (link, text) => { | ||
return ( | ||
<a className="text-blue-500 hover:text-blue-800" href={link}>{text}</a> | ||
) | ||
} | ||
|
||
const ignoreClick = (event) => { | ||
console.log("click: href ", | ||
event.target.href) | ||
event.preventDefault(); | ||
} | ||
|
||
|
||
const body = ( | ||
<div className={classes.paper} id={"modal"}> | ||
<p className={"text-lg font-semibold mb-2"}>What's Diceware?</p> | ||
<div><i>"Diceware is a method for creating passphrases, | ||
passwords, and other cryptographic variables | ||
using ordinary dice as a hardware random | ||
number generator"</i> {link( | ||
"https://en.wikipedia.org/wiki/Diceware", | ||
"- Wiki")}</div> | ||
<div>Read more about password Dice generated passwords from | ||
the {link("https://www.eff.org/dice", "EFF")}.</div> | ||
|
||
<p className={"text-lg font-semibold mt-3 mb-2"}>What | ||
list is used?</p> | ||
<div>{link("https://www.eff.org/files/2016/07/18/" + | ||
"eff_large_wordlist.txt", "EFF Large Word List")} I | ||
converted this list into a json file to make it easier | ||
to import.</div> | ||
|
||
<p className={"text-lg font-semibold mt-3 mb-2"}> | ||
Should I trust this site?</p> | ||
<div>Probably not, but it is open source so please have a look | ||
at the {link("https://github.com/robmcelhinney/diceware/", | ||
"code on github")}. If you spot any issues, let me know | ||
or make a pull request.</div> | ||
<div>It is always better to use real dice to verify the | ||
randomness yourself but that's a lot of hassle so here | ||
we are.</div> | ||
|
||
<p className={"text-lg font-semibold mt-3 mb-2"}> | ||
How is randomness verified?</p> | ||
<div>The {link("https://developer.mozilla.org/en-US/docs/Web/" + | ||
"API/Crypto", "Web Crypto API's")} Window.Crypto.getRandom | ||
which was copied from the {link( | ||
"https://github.com/EFForg/OpenWireless/blob" + | ||
"/master/app/js/diceware.js", "EFF")}.</div> | ||
|
||
<p className={"text-lg font-semibold mt-3 mb-2"}> | ||
Are you saving any data?</p> | ||
<div>All code is completely run on the client side so it's | ||
staying on your device. If you use Windows you can | ||
download this site as a program to use it completely | ||
offline.</div> | ||
</div> | ||
); | ||
|
||
return ( | ||
<> | ||
<a href="/#" className="text-blue-500 hover:text-blue-800" | ||
onClick={handleOpen}>More Info</a> | ||
<Modal | ||
open={open} | ||
onClose={handleClose} | ||
aria-labelledby="simple-modal-title" | ||
aria-describedby="simple-modal-description" | ||
className={classes.modal} | ||
> | ||
{body} | ||
</Modal> | ||
</> | ||
); | ||
} | ||
|
||
export default Info; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.