-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(examples): Generate HTML example with relative npm script
- Loading branch information
1 parent
4b4f023
commit 7a40bb4
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
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,39 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
<title>react-avataaars</title> | ||
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script> | ||
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.21.1/babel.min.js"></script> | ||
<script src="../lib/react-avataaars.js"></script> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="text/babel"> | ||
const hash = 'type-anything-here'; | ||
const options: Options = { | ||
accessories: 'wayfarers', | ||
accessoriesChance: 100, | ||
clothesColor: 'heather', | ||
eyes: 'happy', | ||
hairColor: 'blonde', | ||
mouth: 'twinkle', | ||
style: 'circle', | ||
top: 'hat', | ||
topChance: 100, | ||
}; | ||
|
||
ReactDOM.render( | ||
<div> | ||
<h1>React Avataaars without npm 🎉</h1> | ||
<ReactAvataaars.Avatar style={{width: 300}} className="Avatar" options={options} hash={hash} size="200" /> | ||
</div>, | ||
document.getElementById('root'), | ||
); | ||
</script> | ||
</body> | ||
</html> |
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,15 @@ | ||
html, body { | ||
margin: 0; | ||
padding: 0; | ||
font-family: 'Roboto', Arial, sans-serif; | ||
} | ||
|
||
#root { | ||
margin: 0 auto; | ||
max-width: 600px; | ||
text-align: center; | ||
} | ||
|
||
svg { | ||
width: auto!important; | ||
} |
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