Skip to content

Commit

Permalink
iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
okwme committed Aug 6, 2024
2 parents ea991fe + 2eb7972 commit d413c0a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dist/index.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/module.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/anybody.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ export class Anybody extends EventEmitter {
this.sound?.setSong()
this.init()
this.draw()
if (!beginPaused) {
this.setPause(false)
if (beginPaused) {
this.setPause(true)
}
this.addCSS()
}
Expand Down
31 changes: 26 additions & 5 deletions src/visuals.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,10 @@ export const Visuals = {
})

// buttons (max 2)
const buttons = popup.buttons.slice(0, 2)
const btnGutter = 10
const btnW = w / 2 - pad[1] / 2 - btnGutter / 2
const btnW =
buttons.length === 1 ? w / 2 : w / 2 - pad[1] / 2 - btnGutter / 2
const defaultOptions = {
height: 84,
width: btnW,
Expand All @@ -770,7 +772,7 @@ export const Visuals = {
stroke
}

popup.buttons.slice(0, 2).forEach((options, i) => {
buttons.forEach((options, i) => {
this.drawButton({
x:
popup.buttons.length > 1
Expand Down Expand Up @@ -1202,7 +1204,7 @@ export const Visuals = {
onClick: () => {
this.popup = null
this.level = 1
this.restart(null, false)
this.restart(undefined, this.practiceMode)
}
}
]
Expand Down Expand Up @@ -1242,9 +1244,28 @@ export const Visuals = {
} else {
// parent app should handle waiting to save
this.drawBottomButton({
text: 'MINT',
text: this.practiceMode ? 'SAVE' : 'MINT',
onClick: () => {
this.emit('save')
if (this.practiceMode) {
this.popup = {
header: 'Nice Job!',
body: ['Next time connect a wallet to', 'mint your win!'],
fg: THEME.green_50,
bg: THEME.green_75,
buttons: [
{
text: 'NEW GAME',
onClick: () => {
this.popup = null
this.level = 0
this.restart(undefined, true)
}
}
]
}
} else {
this.emit('save')
}
},
...themes.buttons.green,
columns: buttonCount,
Expand Down

0 comments on commit d413c0a

Please sign in to comment.