-
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.
Make "Reload Page" message in New Game Notification a link
... for re-joining the Current Game. Also: - Ensure a good mobile experience by controlling word-wrapping / line length of "Reload Page" message, etc. - Add, but rotate the "reload" emoji so that it looks like the one in the browser window. - Which require manually fixing a quirk in the underline behavior for the link, as the default behavior would crop out the portion that should have gone under the emoji. - Allow pressing `esc` to clear the notification/overlay.
- Loading branch information
Showing
5 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
app/javascript/controllers/game_notification_controller.js
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 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
// GameNotificationController is responsible for a singleton flash-style | ||
// notification overlay that may appear on a Game Show page, specifically. | ||
export default class extends Controller { | ||
static classes = ["hide"] | ||
|
||
close() { | ||
this.element.classList.add(...this.hideClasses) | ||
} | ||
|
||
remove() { | ||
this.element.remove() | ||
} | ||
} |
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,8 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
reload(event) { | ||
event.preventDefault() | ||
location.reload(true) | ||
} | ||
} |
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