Skip to content

Commit

Permalink
Merge pull request #35 from justincohan/fix-dot-placement
Browse files Browse the repository at this point in the history
Adjust the dots to be centered
  • Loading branch information
chukwumaijem authored Dec 17, 2023
2 parents ddd5f9b + ad87e5f commit 935a659
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion example/dice.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</div>
</div>

<script src="../dist/roll-a-die.js"></script>
<script type="text/javascript" src="../dist/roll-a-die.js"></script>
<script>
function response(res) {
// returns an array of the values from the dice
Expand Down
62 changes: 31 additions & 31 deletions js/roll-a-die.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,37 +122,37 @@ const rollADie = function (options) {
dieInDOM.push(dieId);
const dice = appendDieContainers(dieId, element, angle);
[
[{ cx: 16, cy: 16, r: 6, fill: 'red' }],
[
{ cx: 8, cy: 8, r: 3 },
{ cx: 24, cy: 24, r: 3 },
],
[
{ cx: 8, cy: 8, r: 3 },
{ cx: 16, cy: 16, r: 3 },
{ cx: 24, cy: 24, r: 3 },
],
[
{ cx: 8, cy: 8, r: 3 },
{ cx: 24, cy: 24, r: 3 },
{ cx: 8, cy: 24, r: 3 },
{ cx: 24, cy: 8, r: 3 },
],
[
{ cx: 8, cy: 8, r: 3 },
{ cx: 16, cy: 16, r: 3 },
{ cx: 24, cy: 24, r: 3 },
{ cx: 8, cy: 24, r: 3 },
{ cx: 24, cy: 8, r: 3 },
],
[
{ cx: 8, cy: 8, r: 3 },
{ cx: 24, cy: 24, r: 3 },
{ cx: 8, cy: 16, r: 3 },
{ cx: 24, cy: 16, r: 3 },
{ cx: 8, cy: 24, r: 3 },
{ cx: 24, cy: 8, r: 3 },
],
[{ cx: 14, cy: 14, r: 6, fill: 'red' }],
[
{ cx: 6, cy: 6, r: 3 },
{ cx: 22, cy: 22, r: 3 },
],
[
{ cx: 6, cy: 6, r: 3 },
{ cx: 14, cy: 14, r: 3 },
{ cx: 22, cy: 22, r: 3 },
],
[
{ cx: 6, cy: 6, r: 3 },
{ cx: 22, cy: 22, r: 3 },
{ cx: 6, cy: 22, r: 3 },
{ cx: 22, cy: 6, r: 3 },
],
[
{ cx: 6, cy: 6, r: 3 },
{ cx: 14, cy: 14, r: 3 },
{ cx: 22, cy: 22, r: 3 },
{ cx: 6, cy: 22, r: 3 },
{ cx: 22, cy: 6, r: 3 },
],
[
{ cx: 6, cy: 6, r: 3 },
{ cx: 22, cy: 22, r: 3 },
{ cx: 6, cy: 14, r: 3 },
{ cx: 22, cy: 14, r: 3 },
{ cx: 6, cy: 22, r: 3 },
{ cx: 22, cy: 6, r: 3 },
],
]
.map(getFace)
.forEach((face) => dice.appendChild(face));
Expand Down

0 comments on commit 935a659

Please sign in to comment.