Skip to content

Commit

Permalink
add demo data
Browse files Browse the repository at this point in the history
  • Loading branch information
killerducky committed Feb 15, 2024
1 parent bce4a16 commit d0a5319
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions mahjong/killer_mortal/demo_data.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mahjong/killer_mortal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ <h1>Killer Mortal Reviewer</h1>
</main>
<script src="lz-string.min.js"></script>
<script src="translations.js"></script>
<script src="demo_data.js"></script>
<script src="index.js"></script>
</body>
</html>
8 changes: 6 additions & 2 deletions mahjong/killer_mortal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1346,20 +1346,24 @@ function soften(pdfs) {

function getJsonData() {
let data = localStorage.getItem('mortalHtmlStr')
let label = document.getElementById('mortal-html-label')
if (data) {
let mortalFilename = localStorage.getItem('mortalFilename')
let label = document.getElementById('mortal-html-label')
label.innerHTML = "Choose Mortal File<br>" + mortalFilename
data = LZString.decompressFromUTF16(data)
setMortalHtmlStr(data)
updateState()
} else {
data = LZString.decompressFromBase64(demo_data)
setMortalHtmlStr(data)
updateState()
label.innerHTML = "Choose Mortal File<br>" + "(Demo file loaded)"
}

let fileInput = document.getElementById('mortal-html-file')
fileInput.addEventListener('change', function(event) {
let file = event.target.files[0]
if (file) {
let label = document.getElementById('mortal-html-label')
label.innerHTML = "Choose Mortal File<br>" + file.name
let fr = new FileReader()
fr.readAsText(file)
Expand Down
4 changes: 2 additions & 2 deletions mahjong/killer_mortal/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ h1{
text-align: center;
}
.outer {
display: grid;
grid-template-columns: var(--main-width) 1fr;
display:flex;
justify-content: space-around;
}
.grid-main{
display: grid;
Expand Down

0 comments on commit d0a5319

Please sign in to comment.