mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-29 06:53:21 -07:00
Many small adjustments
- Adjust header width for scrollbar presence - Added new header assets for grass and dirt - Adjusted styles for hosted and tracker - Expand header to implement templating system - Much more I have forgotten
This commit is contained in:
@@ -27,6 +27,7 @@ window.addEventListener('load', () => {
|
||||
|
||||
document.getElementById('export-button').addEventListener('click', exportSettings);
|
||||
document.getElementById('reset-to-default').addEventListener('click', resetToDefaults);
|
||||
adjustHeaderWidth();
|
||||
}).catch((error) => {
|
||||
gameSettings.innerHTML = `
|
||||
<h2>Something went wrong while loading your game settings page.</h2>
|
||||
|
||||
@@ -19,7 +19,29 @@ const adjustFooterHeight = () => {
|
||||
footer.style.marginTop = `${margin}px`;
|
||||
};
|
||||
|
||||
const adjustHeaderWidth = () => {
|
||||
// If there is no header, do nothing
|
||||
const header = document.getElementById('base-header');
|
||||
if (!header) { return; }
|
||||
|
||||
const tempDiv = document.createElement('div');
|
||||
tempDiv.style.width = '100px';
|
||||
tempDiv.style.height = '100px';
|
||||
tempDiv.style.overflow = 'scroll';
|
||||
tempDiv.style.position = 'absolute';
|
||||
tempDiv.style.top = '-500px';
|
||||
document.body.appendChild(tempDiv);
|
||||
const scrollbarWidth = tempDiv.offsetWidth - tempDiv.clientWidth;
|
||||
document.body.removeChild(tempDiv);
|
||||
|
||||
const documentRoot = document.compatMode === 'BackCompat' ? document.body : document.documentElement;
|
||||
const margin = (documentRoot.scrollHeight > documentRoot.clientHeight) ? 0-scrollbarWidth : 0;
|
||||
document.getElementById('base-header-right').style.marginRight = `${margin}px`;
|
||||
};
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
adjustFooterHeight();
|
||||
adjustHeaderWidth();
|
||||
window.addEventListener('resize', adjustFooterHeight);
|
||||
window.addEventListener('resize', adjustHeaderWidth);
|
||||
});
|
||||
|
||||
@@ -44,6 +44,7 @@ window.addEventListener('load', () => {
|
||||
|
||||
// Populate page with HTML generated from markdown
|
||||
tutorialWrapper.innerHTML += (new showdown.Converter()).makeHtml(results);
|
||||
adjustHeaderWidth();
|
||||
|
||||
// Reset the id of all header divs to something nicer
|
||||
const headers = Array.from(document.querySelectorAll('h1, h2, h3, h4, h5, h6'));
|
||||
|
||||
BIN
WebHostLib/static/static/backgrounds/header/dirt-header.png
Normal file
BIN
WebHostLib/static/static/backgrounds/header/dirt-header.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
BIN
WebHostLib/static/static/backgrounds/header/grass-header.png
Normal file
BIN
WebHostLib/static/static/backgrounds/header/grass-header.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
@@ -101,3 +101,16 @@ h5, h6{
|
||||
padding-bottom: 120px;
|
||||
}
|
||||
|
||||
.user-message{
|
||||
width: 50%;
|
||||
min-width: 500px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
color: #000000;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 20px;
|
||||
background-color: #ffff00;
|
||||
}
|
||||
|
||||
@@ -2,11 +2,10 @@ html{
|
||||
padding-top: 110px;
|
||||
}
|
||||
|
||||
#cloud-header{
|
||||
#base-header{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
background: url('../static/backgrounds/header/cloud-header.png') repeat-x;
|
||||
justify-content: space-between;
|
||||
background-size: auto 90px;
|
||||
width: calc(100% - 20px);
|
||||
height: 90px;
|
||||
@@ -19,20 +18,26 @@ html{
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
#cloud-header #site-title{
|
||||
#base-header #base-header-left{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
#base-header #base-header-left a{
|
||||
margin-right: 0;
|
||||
padding-right: 7px;
|
||||
}
|
||||
|
||||
#base-header #site-title{
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
#cloud-header #cloud-header-spacer{
|
||||
flex-grow: 1
|
||||
}
|
||||
|
||||
#cloud-header #site-title img{
|
||||
#base-header #site-title img{
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
#cloud-header a{
|
||||
#base-header a{
|
||||
color: #2f6b83;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
3
WebHostLib/static/styles/header/dirtHeader.css
Normal file
3
WebHostLib/static/styles/header/dirtHeader.css
Normal file
@@ -0,0 +1,3 @@
|
||||
#base-header{
|
||||
background: url('../../static/backgrounds/header/dirt-header.png') repeat-x;
|
||||
}
|
||||
3
WebHostLib/static/styles/header/grassHeader.css
Normal file
3
WebHostLib/static/styles/header/grassHeader.css
Normal file
@@ -0,0 +1,3 @@
|
||||
#base-header{
|
||||
background: url('../../static/backgrounds/header/grass-header.png') repeat-x;
|
||||
}
|
||||
3
WebHostLib/static/styles/header/oceanHeader.css
Normal file
3
WebHostLib/static/styles/header/oceanHeader.css
Normal file
@@ -0,0 +1,3 @@
|
||||
#base-header{
|
||||
background: url('../../static/backgrounds/header/ocean-header.png') repeat-x;
|
||||
}
|
||||
@@ -26,9 +26,15 @@ html{
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
#tracker-header-bar .info{
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#search{
|
||||
border: 1px solid #000000;
|
||||
border-radius: 3px;
|
||||
padding: 3px;
|
||||
width: 200px;
|
||||
height: 20px;
|
||||
margin-bottom: 0.5rem;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user