Skip to content

Commit

Permalink
add favicons
Browse files Browse the repository at this point in the history
  • Loading branch information
arjanfrans committed Apr 11, 2024
1 parent 1df6f97 commit f1d17ec
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<head>
<base href="">

<title>Hard Bulls - Game Day</title>
<link rel="icon" href="./public/favicon.ico"/>

<script type="module" src="/src/main.ts"></script>
</head>

Expand Down
Binary file added public/favicon.ico
Binary file not shown.
Binary file added public/icon_256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ body {
margin: 0;
width: 100%;
font-family: sans-serif;
background-color: rgb(196, 196, 196);
}

#controls {
Expand All @@ -24,11 +25,14 @@ body {
font-size: 2em;
height: 2em;
}
.file-input label {
width: 100%;

.file-input-label {
display: flex;
vertical-align: middle;
width: 100%;
justify-content: center;
flex-direction: column;
height: 100%;

}

.file-input button {
Expand Down
10 changes: 8 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,15 @@ function uploadBackground(

container.classList.add("file-input");

const labelDiv = document.createElement("div");

labelDiv.classList.add("file-input-label");

const label = document.createElement("label");
label.innerText = "Upload Background";

labelDiv.append(label);

const button = document.createElement("button");
button.innerText = "Choose File";

Expand All @@ -316,7 +322,7 @@ function uploadBackground(
}
});

container.appendChild(label);
container.appendChild(labelDiv);
container.appendChild(button);
container.appendChild(uploadField);

Expand Down Expand Up @@ -350,7 +356,7 @@ function uploadBackground(
const downloadLink = document.createElement("a");

downloadLink.style.display = "none";
downloadLink.href = canvas.toDataURL("image/png");
downloadLink.href = outputImage.src;
downloadLink.download = "ballpark-hard.png";

document.body.appendChild(downloadLink);
Expand Down

0 comments on commit f1d17ec

Please sign in to comment.