feat: auto-save replays on game over and page unload
- Add autoSave() function that saves replay silently on game over - Add beforeunload listener to save incomplete games when navigating away - Add prominent 'Save Now' button in status bar (visible during play) - Show 'Replay auto-saved!' notification in status bar - Add gameSaved flag to prevent duplicate saves
This commit is contained in:
@@ -342,6 +342,24 @@ h3 {
|
||||
font-weight: bold;
|
||||
font-size: 1.05em;
|
||||
min-height: 24px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#status-save-btn {
|
||||
padding: 4px 12px;
|
||||
background: var(--blue);
|
||||
color: var(--bg);
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 0.9em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#status-save-btn:hover {
|
||||
background: #5bb3ff;
|
||||
}
|
||||
|
||||
/* ===== Replay Page ===== */
|
||||
|
||||
Reference in New Issue
Block a user