begin downloads panel

This commit is contained in:
SpikeHD 2022-05-01 22:56:15 -07:00
parent 8ed80bc55f
commit 8971cee64f
4 changed files with 54 additions and 1 deletions

View File

@ -115,6 +115,28 @@
</div> </div>
</div> </div>
<div id="downloadPanel" style="display: none;">
<div id="downloadTitleBar">
<span id="downloadTitle">
<span id="downloadTitleText">Downloads</span>
<span id="downloadClose" onclick="closeDownloads()">
<img src="icons/close.svg" />
</span>
</span>
</div>
<div id="downloadPanelInner">
<div class="downloadRow">
<div class="downloadSection">
<span class="downloadLabel" id="installerTitle">Installer</span>
<button class="smolBtn" onclick="runInstallScript()" id="proxyInstall">Install</button>
</div>
<span class="downloadSubtitle" id="installerSubtitle">
Installs proxy and other tools. Required for Grasscutter servers.
</span>
</div>
</div>
</div>
<!-- Setting panel --> <!-- Setting panel -->
<div id="settingsPanel" style="display: none;"> <div id="settingsPanel" style="display: none;">
<div id="settingsTitleBar"> <div id="settingsTitleBar">
@ -195,6 +217,9 @@
<div id="refreshBtn" onclick="window.location.reload()"> <div id="refreshBtn" onclick="window.location.reload()">
<img src="icons/refresh.svg" /> <img src="icons/refresh.svg" />
</div> </div>
<div id="downloadBtn" onclick="openDownloads()">
<img src="icons/download.svg" />
</div>
<div id="settingsBtn" onclick="openSettings()"> <div id="settingsBtn" onclick="openSettings()">
<img src="icons/cog.svg" /> <img src="icons/cog.svg" />
</div> </div>
@ -205,6 +230,8 @@
<img src="icons/close.svg" /> <img src="icons/close.svg" />
</div> </div>
</div> </div>
<!-- Main content -->
<div id="panelContainer"> <div id="panelContainer">
<!-- Official play btn --> <!-- Official play btn -->
<div id="firstPanel"> <div id="firstPanel">

View File

@ -56,7 +56,6 @@ async function downloadGC(branch) {
// Run installer // Run installer
createCmdWindow(`.\\scripts\\gc_download.cmd ${artiUrl} ${keystoreUrl} ${branch}`) createCmdWindow(`.\\scripts\\gc_download.cmd ${artiUrl} ${keystoreUrl} ${branch}`)
// Display folder after saving config // Display folder after saving config
displayServerFolder() displayServerFolder()
} }

View File

@ -246,6 +246,20 @@ async function handleFavoriteList() {
} }
} }
async function openDownloads() {
const downloads = document.querySelector('#downloadPanel')
if (downloads.style.display === 'none') {
downloads.style.removeProperty('display')
}
}
async function closeDownloads() {
const downloads = document.querySelector('#downloadPanel')
downloads.style.display = 'none'
}
async function openSettings() { async function openSettings() {
const settings = document.querySelector('#settingsPanel') const settings = document.querySelector('#settingsPanel')
const config = await getCfg() const config = await getCfg()

View File

@ -157,6 +157,7 @@ a {
#firstTimeNotice, #firstTimeNotice,
#loginPanel, #loginPanel,
#downloadPanel,
#settingsPanel { #settingsPanel {
display: block; display: block;
position: absolute; position: absolute;
@ -172,6 +173,7 @@ a {
font-family: system-ui; font-family: system-ui;
} }
#downloadPanel,
#settingsPanel { #settingsPanel {
width: 35%; width: 35%;
height: 80%; height: 80%;
@ -184,6 +186,7 @@ a {
margin-bottom: 10px; margin-bottom: 10px;
} }
#downloadPanelInner,
#settingsPanelInner { #settingsPanelInner {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -192,16 +195,19 @@ a {
padding: 10px 10%; padding: 10px 10%;
} }
.downloadRow,
.settingsRow { .settingsRow {
width: 100%; width: 100%;
} }
.downloadTitle,
.settingTitle { .settingTitle {
font-size: 1.2em; font-size: 1.2em;
font-weight: bold; font-weight: bold;
margin-bottom: 10px; margin-bottom: 10px;
} }
.downloadLabel,
.settingLabel { .settingLabel {
display:inline-block; display:inline-block;
font-size: 1em; font-size: 1em;
@ -209,12 +215,14 @@ a {
margin: 10px 0px; margin: 10px 0px;
} }
.downloadSubtitle,
.settingSubtitle { .settingSubtitle {
color: rgb(165, 165, 165); color: rgb(165, 165, 165);
font-size: 0.8em; font-size: 0.8em;
font-weight: normal; font-weight: normal;
} }
.downloadSection,
.settingSection { .settingSection {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -222,10 +230,12 @@ a {
justify-content: space-between; justify-content: space-between;
} }
.downloadSection .smolBtn,
.settingSection .smolBtn { .settingSection .smolBtn {
height: 30px; height: 30px;
} }
#downloadTitleBar
#settingsTitleBar { #settingsTitleBar {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -233,15 +243,18 @@ a {
justify-content: space-between; justify-content: space-between;
} }
#downloadClose,
#settingsClose { #settingsClose {
display: inline-block; display: inline-block;
transition: filter 0.1s ease-in-out; transition: filter 0.1s ease-in-out;
} }
#downloadClose img,
#settingsClose img { #settingsClose img {
height: 20px; height: 20px;
} }
#downloadClose:hover,
#settingsClose:hover { #settingsClose:hover {
filter: invert(85%) sepia(31%) saturate(560%) hue-rotate(329deg) brightness(100%) contrast(92%); filter: invert(85%) sepia(31%) saturate(560%) hue-rotate(329deg) brightness(100%) contrast(92%);
cursor: pointer; cursor: pointer;