Skip to content

Commit

Permalink
Prepare for 1.0.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
tillvit committed Aug 14, 2024
1 parent ab0be7c commit fb40afe
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 119 deletions.
8 changes: 5 additions & 3 deletions app/src/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ interface Version {
type: string
date: number
downloads: {
mac: string
"mac-x64": string
"mac-arm": string
win: string
linux: string
}
Expand Down Expand Up @@ -416,8 +417,9 @@ export class App {
nightly: 0,
}
let os = "win"
if (navigator.userAgent.includes("Mac")) os = "mac"
else if (navigator.userAgent.includes("Linux")) os = "linux"
if (process.platform == "darwin") {
os = process.arch == "arm64" ? "mac-arm" : "mac-x64"
} else if (process.platform == "linux") os = "linux"
fetch("/smeditor/assets/app/versions.json")
.then(data => data.json())
.then((versions: Version[]) => {
Expand Down
12 changes: 12 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -460,3 +460,15 @@ a {
z-index: -10;
filter: saturate(130%) blur(3px);
}

#other-downloads {
margin-top: 5px;
font-size: 13px;
text-decoration: underline;
opacity: 0.5;
transition: 0.2s cubic-bezier(0.17, 0.67, 0.39, 1.35);
}

#other-downloads:hover {
opacity: 0.7;
}
251 changes: 138 additions & 113 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,42 @@ <h1>SMEditor</h1>
</div>
<p>An open source tool to view and edit StepMania charts.</p>
<div class="banner-button-container">
<a id="download-link">
<button id="download-button" class="large">
<div class="button-content">
<svg
width="800px"
height="800px"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
stroke="currentColor"
d="M17 17H17.01M17.4 14H18C18.9319 14 19.3978 14 19.7654 14.1522C20.2554 14.3552 20.6448 14.7446 20.8478 15.2346C21 15.6022 21 16.0681 21 17C21 17.9319 21 18.3978 20.8478 18.7654C20.6448 19.2554 20.2554 19.6448 19.7654 19.8478C19.3978 20 18.9319 20 18 20H6C5.06812 20 4.60218 20 4.23463 19.8478C3.74458 19.6448 3.35523 19.2554 3.15224 18.7654C3 18.3978 3 17.9319 3 17C3 16.0681 3 15.6022 3.15224 15.2346C3.35523 14.7446 3.74458 14.3552 4.23463 14.1522C4.60218 14 5.06812 14 6 14H6.6M12 15V4M12 15L9 12M12 15L15 12"
stroke="#000000"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<div class="button-text">
<h3>Download the desktop app</h3>
<div id="version" style="font-size: 12px">-</div>
<div
style="display: flex; flex-direction: column; align-items: center"
>
<a id="download-link">
<button id="download-button" class="large">
<div class="button-content">
<svg
width="800px"
height="800px"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
stroke="currentColor"
d="M17 17H17.01M17.4 14H18C18.9319 14 19.3978 14 19.7654 14.1522C20.2554 14.3552 20.6448 14.7446 20.8478 15.2346C21 15.6022 21 16.0681 21 17C21 17.9319 21 18.3978 20.8478 18.7654C20.6448 19.2554 20.2554 19.6448 19.7654 19.8478C19.3978 20 18.9319 20 18 20H6C5.06812 20 4.60218 20 4.23463 19.8478C3.74458 19.6448 3.35523 19.2554 3.15224 18.7654C3 18.3978 3 17.9319 3 17C3 16.0681 3 15.6022 3.15224 15.2346C3.35523 14.7446 3.74458 14.3552 4.23463 14.1522C4.60218 14 5.06812 14 6 14H6.6M12 15V4M12 15L9 12M12 15L15 12"
stroke="#000000"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<div class="button-text">
<h3>Download the desktop app</h3>
<div id="version" style="font-size: 12px">-</div>
</div>
</div>
</div>
</button>
</a>
</button>
</a>
<a
id="other-downloads"
href="https://github.com/tillvit/smeditor/releases/"
target="_blank"
>All Downloads</a
>
</div>
<a href="app/">
<button id="web-button" class="large">
<div class="button-content">
Expand Down Expand Up @@ -248,98 +258,113 @@ <h3>View on GitHub</h3>
</div>
</div>
<script>
const OS_NAMES = {
win: "Windows",
mac: "MacOS",
linux: "Linux",
}
const BUILD_TYPES = {
stable: 3,
beta: 2,
alpha: 1,
nightly: 0,
}
let os = "win"
if (navigator.userAgent.includes("Mac")) os = "mac"
else if (navigator.userAgent.includes("Linux")) os = "linux"
fetch("/smeditor/assets/app/versions.json")
.then(data => data.json())
.then(versions => {
versions = versions.sort((a, b) => {
if (BUILD_TYPES[a.type] != BUILD_TYPES[b.type])
return BUILD_TYPES[b.type] - BUILD_TYPES[a.type]
return b.date - a.date
;(async () => {
const OS_NAMES = {
win: "Windows",
"mac-x64": "MacOS (Intel)",
"mac-arm": "MacOS (Apple Silicon)",
linux: "Linux",
}
const BUILD_TYPES = {
stable: 3,
beta: 2,
alpha: 1,
nightly: 0,
}
let os = "win"
if (navigator.userAgent.includes("Mac")) {
os = "mac-x64"
if (navigator.userAgentData) {
// Try to get architecture
const data = await navigator.userAgentData.getHighEntropyValues([
"architecture",
])
if (data.architecture === "arm") {
os = "mac-arm"
}
}
} else if (navigator.userAgent.includes("Linux")) {
os = "linux"
}
fetch("/smeditor/assets/app/versions.json")
.then(data => data.json())
.then(versions => {
versions = versions.sort((a, b) => {
if (BUILD_TYPES[a.type] != BUILD_TYPES[b.type])
return BUILD_TYPES[b.type] - BUILD_TYPES[a.type]
return b.date - a.date
})
const version = versions[0]
document.getElementById("version").innerText =
`${version.version}${OS_NAMES[os]}`
document.getElementById("download-link").href =
version.downloads[os]
})
const version = versions[0]
document.getElementById(
"version"
).innerText = `${version.version}${OS_NAMES[os]}`
document.getElementById("download-link").href = version.downloads[os]
})
document
.querySelectorAll("#feature-container .feature")
.forEach(element => {
const open = () => {
const clone = element.cloneNode(true)
clone.style.position = "absolute"
const elbr = element.getBoundingClientRect()
const ctbr = document
.getElementById("feature-container")
.getBoundingClientRect()
const imgCopy = clone.querySelector(".preview").cloneNode()
imgCopy.classList.remove("preview")
imgCopy.classList.add("hover")
clone.appendChild(imgCopy)
clone.style.left = elbr.left - ctbr.left + "px"
clone.style.top = elbr.top - ctbr.top + "px"
clone.style.width = elbr.width + "px"
clone.style.maxWidth = "none"
clone.style.height = elbr.height + "px"
clone.style.zIndex = "100"
clone.style.justifyContent = "normal"
clone.querySelector(".description").style.position = "absolute"
clone.querySelector(".description").style.top =
element.querySelector(".description").offsetTop + "px"
clone.querySelector(".title").style.position = "absolute"
clone.querySelector(".title").style.top =
element.querySelector(".title").offsetTop + "px"
clone.querySelector(".preview").style.position = "absolute"
clone.querySelector(".preview").style.top =
element.querySelector(".preview").offsetTop + "px"
imgCopy.style.position = "absolute"
imgCopy.style.top = elbr.height + "px"
clone.style.opacity = 1
element.style.opacity = 0
const close = () => {
clone.style.pointerEvents = "none"
window.removeEventListener("mousemove", mouseHandler)
document
.querySelectorAll("#feature-container .feature")
.forEach(element => {
const open = () => {
const clone = element.cloneNode(true)
clone.style.position = "absolute"
const elbr = element.getBoundingClientRect()
const ctbr = document
.getElementById("feature-container")
.getBoundingClientRect()
const imgCopy = clone.querySelector(".preview").cloneNode()
imgCopy.classList.remove("preview")
imgCopy.classList.add("hover")
clone.appendChild(imgCopy)
clone.style.left = elbr.left - ctbr.left + "px"
clone.style.top = elbr.top - ctbr.top + "px"
clone.style.width = elbr.width + "px"
clone.style.maxWidth = "none"
clone.style.height = elbr.height + "px"
clone.classList.remove("hovered")
clone.style.pointerEvents = "none"
clone.style.zIndex = "100"
clone.style.justifyContent = "normal"
clone.querySelector(".description").style.position = "absolute"
clone.querySelector(".description").style.top =
element.querySelector(".description").offsetTop + "px"
clone.querySelector(".title").style.position = "absolute"
clone.querySelector(".title").style.top =
element.querySelector(".title").offsetTop + "px"
clone.querySelector(".preview").style.position = "absolute"
clone.querySelector(".preview").style.top =
element.querySelector(".preview").offsetTop + "px"
imgCopy.style.position = "absolute"
imgCopy.style.top = elbr.height + "px"
clone.style.opacity = 1
element.style.opacity = 0
const close = () => {
clone.style.pointerEvents = "none"
window.removeEventListener("mousemove", mouseHandler)
clone.style.height = elbr.height + "px"
clone.classList.remove("hovered")
clone.style.pointerEvents = "none"
setTimeout(() => {
element.style.opacity = 1
clone.remove()
}, 500)
}
const mouseHandler = e => {
if (e.clientY - elbr.top > elbr.height + 2) close()
if (e.clientY - elbr.top < -2) close()
if (e.clientX - elbr.left > elbr.width + 2) close()
if (e.clientX - elbr.left < -2) close()
}
window.addEventListener("mousemove", mouseHandler)
setTimeout(() => {
element.style.opacity = 1
clone.remove()
}, 500)
}
const mouseHandler = e => {
if (e.clientY - elbr.top > elbr.height + 2) close()
if (e.clientY - elbr.top < -2) close()
if (e.clientX - elbr.left > elbr.width + 2) close()
if (e.clientX - elbr.left < -2) close()
clone.style.height =
elbr.height +
element.querySelector(".preview").clientHeight +
"px"
clone.classList.add("hovered")
})
document.getElementById("feature-popups").appendChild(clone)
}
window.addEventListener("mousemove", mouseHandler)
setTimeout(() => {
clone.style.height =
elbr.height +
element.querySelector(".preview").clientHeight +
"px"
clone.classList.add("hovered")
})
document.getElementById("feature-popups").appendChild(clone)
}
element.onmouseenter = () => open()
element.onclick = () => open()
})
element.onmouseenter = () => open()
element.onclick = () => open()
})
})()
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion nw/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SMEditor",
"version": "0.1.1-beta",
"version": "1.0.0",
"main": "index.html",
"node-remote": [
"http://127.0.0.1:5173/smeditor/app",
Expand Down
21 changes: 19 additions & 2 deletions public/assets/app/versions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
[
{
"version": "1.0.0",
"type": "stable",
"date": 1723601217471,
"downloads": {
"mac-x64": "https://github.com/tillvit/smeditor/releases/download/v1.0.0/SMEditor-Mac-x64.zip",
"mac-arm": "https://github.com/tillvit/smeditor/releases/download/v1.0.0/SMEditor-Mac-arm.zip",
"win": "https://github.com/tillvit/smeditor/releases/download/v1.0.0/SMEditor-Windows.zip",
"linux": "https://github.com/tillvit/smeditor/releases/download/v1.0.0/SMEditor-Linux.zip"
},
"changelog": [
"Add Apple Silicon release",
"Fix faulty chrome flags"
]
},
{
"version": "0.1.1-beta",
"type": "beta",
"date": 1700175762544,
"downloads": {
"mac": "https://github.com/tillvit/smeditor/releases/download/v0.1.1-beta/SMEditor.app.zip",
"mac-x64": "https://github.com/tillvit/smeditor/releases/download/v0.1.1-beta/SMEditor.app.zip",
"mac-arm": "https://github.com/tillvit/smeditor/releases/download/v0.1.1-beta/SMEditor.app.zip",
"win": "https://github.com/tillvit/smeditor/releases/download/v0.1.1-beta/SMEditor-Windows.zip",
"linux": "https://github.com/tillvit/smeditor/releases/download/v0.1.1-beta/SMEditor-Linux.zip"
},
Expand All @@ -17,7 +33,8 @@
"type": "beta",
"date": 1696428414145,
"downloads": {
"mac": "https://github.com/tillvit/smeditor/releases/download/v0.1.0-beta/SMEditor.app.zip",
"mac-x64": "https://github.com/tillvit/smeditor/releases/download/v0.1.0-beta/SMEditor.app.zip",
"mac-arm": "https://github.com/tillvit/smeditor/releases/download/v0.1.0-beta/SMEditor.app.zip",
"win": "https://github.com/tillvit/smeditor/releases/download/v0.1.0-beta/SMEditor-Windows.zip",
"linux": "https://github.com/tillvit/smeditor/releases/download/v0.1.0-beta/SMEditor-Linux.zip"
},
Expand Down

0 comments on commit fb40afe

Please sign in to comment.