Skip to content

Commit

Permalink
save names automatically.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tag Eom committed Oct 7, 2023
1 parent d373a59 commit 5f71f02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This is a lucky draw by dropping marbles.

# ChangeLogs

- 2023-10-08:
- Save names in the local storage automatically.
- 2023-09-23:
- You can move the viewport by dragging your cursor on the minimap.
- 2023-09-22:
Expand Down
9 changes: 8 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
const names = getNames();
window.roullete.setMarbles(names);
ready = names.length > 0;
localStorage.setItem('mbr_names', names.join(','));
}

function setWinnerRank(rank) {
Expand All @@ -197,6 +198,10 @@
let ready = false;

document.addEventListener('DOMContentLoaded', () => {
const savedNames = localStorage.getItem('mbr_names');
if (savedNames) {
document.querySelector('#in_names').value = savedNames;
}
document.querySelector('#in_names').addEventListener('input', () => {
getReady();
});
Expand Down Expand Up @@ -292,7 +297,7 @@

document.querySelector('#btnShuffle').click();

const currentNotice = 20230923;
const currentNotice = 20231008;
const closed = parseInt(localStorage.getItem('noticeClose') || '0', 10);

if (closed < currentNotice) {
Expand All @@ -308,6 +313,8 @@
<div id="notice" class="hide">
<h3>Change logs</h3>
<dl>
<dt>2023-10-08</dt>
<dd>Save names automatically.</dd>
<dt>2023-09-23</dt>
<dd>You can move the viewport by dragging your cursor on the minimap.</dd>
<dt>2023-09-22</dt>
Expand Down

0 comments on commit 5f71f02

Please sign in to comment.