From 35648b67f5bd5857b137711e3c3b6472f38ddb02 Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Thu, 4 May 2023 16:03:28 +0200 Subject: [PATCH] Partially styled, fixed custom fonts --- client/public/stylesheets/olympus.css | 287 ++++++++++++-------------- client/src/controls/dropdown.ts | 5 +- 2 files changed, 137 insertions(+), 155 deletions(-) diff --git a/client/public/stylesheets/olympus.css b/client/public/stylesheets/olympus.css index 93a6080d..af55c114 100644 --- a/client/public/stylesheets/olympus.css +++ b/client/public/stylesheets/olympus.css @@ -16,24 +16,22 @@ box-sizing: border-box; } - -html { - font-family: 'Open Sans', sans-serif; +html * { + font-family: 'Open Sans', sans-serif !important; } body { - display:grid; - margin: 0; - padding: 0; + display: grid; + margin: 0; + padding: 0; } html, body { - height: 100%; - width: 100%; + height: 100%; + width: 100%; } - a { text-decoration: none; } @@ -42,7 +40,6 @@ a:hover { text-decoration: underline; } - button { background-color: var(--background-steel); border: 1px solid var(--background-steel); @@ -67,26 +64,32 @@ form { padding: 0; } -form > div { +form>div { margin: 20px 0; } - .pill { - background-color: var( --background-dark-steel ); + background-color: var(--background-dark-steel); border-radius: var(--border-radius-sm); padding: 4px 8px; width: fit-content; } +.ol-scrollable { + overflow-y: scroll; + scrollbar-color: white var(--background-grey); + scrollbar-width: thin; +} .ol-scrollable::-webkit-scrollbar { - width: 10px; + width: var(--border-radius-md); } - + .ol-scrollable::-webkit-scrollbar-track { - background-color: transparent; - border-radius: 100px; + background-color: var(--background-grey); + border-top-right-radius: 10px; + border-bottom-right-radius: 10px; + margin-top: 0px; } .ol-scrollable::-webkit-scrollbar-thumb { @@ -96,7 +99,6 @@ form > div { margin-top: 10px; } - .ol-panel { background-color: var(--background-steel); border-radius: 15px; @@ -124,6 +126,14 @@ form > div { width: 100%; } +.ol-ellipsed { + display: inline-block; + width: calc(100%); + overflow: hidden; + text-overflow: ellipsis; + text-align: left; +} + .ol-select { position: relative; color: var(--nav-text); @@ -138,6 +148,7 @@ form > div { text-align: center; white-space: nowrap; width: 100%; + min-width: 0; } .ol-select:not(.ol-select-image)>.ol-select-value { @@ -145,14 +156,14 @@ form > div { background-color: var(--background-grey); border-radius: var(--border-radius-sm); padding: 1em 30px 1em 20px; - width: 100%; + width: calc(100%); overflow: hidden; text-overflow: ellipsis; } .ol-select.narrow:not(.ol-select-image)>.ol-select-value { opacity: .9; - padding:4px 30px 4px 15px; + padding: 4px 30px 4px 15px; } .ol-select:not(.ol-select-image)>.ol-select-value svg { @@ -166,55 +177,51 @@ form > div { } .ol-select>.ol-select-options { - border-radius: var( --border-radius-md ); + border-radius: var(--border-radius-md); overflow: hidden; position: absolute; max-height: 0; - translate: 0 -2px; z-index: 1000; } +.ol-select-options.scrollbar-visible { + border-top-right-radius: 0px !important; + border-bottom-right-radius: 0px !important; +} + .ol-select.ol-select-image>.ol-select-options { position: absolute; } - -.ol-select.is-open > .ol-select-options { +.ol-select.is-open>.ol-select-options { max-height: 382px; overflow: visible; overflow-y: auto; - padding: 8px 0; min-width: 100%; - z-index:9999; + z-index: 9999; + translate: 0px 5px; } - -.ol-select.is-open[data-position="top"] > .ol-select-options { - top:0; - translate:0 -100%; +.ol-select.is-open[data-position="top"]>.ol-select-options { + top: 0; + translate: 0 -100%; } - - -.ol-select>.ol-select-options > div { +.ol-select>.ol-select-options>div { background-color: var(--background-grey); box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25); display: flex; justify-content: left; - padding: 4px 25px; + padding: 2px 10px; width: 100%; } .ol-select>.ol-select-options>div:first-of-type { - border-top-left-radius: var(--border-radius-md); - border-top-right-radius: var(--border-radius-md); - padding-top: 16px; + padding-top: 12px; } .ol-select>.ol-select-options>div:last-of-type { - border-bottom-left-radius: var(--border-radius-md); - border-bottom-right-radius: var(--border-radius-md); - padding-bottom: 16px; + padding-bottom: 12px; } .ol-select>.ol-select-options div hr { @@ -223,25 +230,28 @@ form > div { width: 100%; } -.ol-select>.ol-select-options > div a, .ol-select>.ol-select-options > div button { +.ol-select>.ol-select-options>div a, +.ol-select>.ol-select-options>div button { background-color: transparent; border: none; border-radius: 0; color: white; - display:block; - font-size: 14px; + display: block; + font-size: 12px; font-weight: normal; padding: 6px 2px; text-align: left; white-space: nowrap; width: 100%; + padding: 10px; + border-radius: var(--border-radius-sm); } -.ol-select>.ol-select-options > div a:hover, .ol-select>.ol-select-options > div button:hover { - text-decoration: underline; +.ol-select>.ol-select-options>div a:hover, +.ol-select>.ol-select-options>div button:hover { + background-color: #FFF3; } - .ol-panel-list { border-radius: var(--border-radius-sm); display: flex; @@ -275,32 +285,30 @@ form > div { max-width: 16px; } - .ol-panel-board { display: flex; flex-direction: row; justify-content: space-evenly; } -.ol-panel-board > .panel-section { +.ol-panel-board>.panel-section { border-right: 1px solid #555; - margin:10px 0; - padding:0 30px; + margin: 10px 0; + padding: 0 30px; } -.ol-panel-board > .panel-section:first-child { - padding-left:20px; +.ol-panel-board>.panel-section:first-child { + padding-left: 20px; } -.ol-panel-board > .panel-section:last-child { - padding-right:20px; +.ol-panel-board>.panel-section:last-child { + padding-right: 20px; } -.ol-panel-board > .panel-section:last-of-type { +.ol-panel-board>.panel-section:last-of-type { border-right-width: 0; } - h1, h2, h3, @@ -335,7 +343,6 @@ button.ol-button-warning { color: var(--primary-red); } - nav.ol-panel { column-gap: 20px; display: flex; @@ -347,7 +354,6 @@ nav.ol-panel> :last-child { margin-right: 5px; } - .ol-panel .ol-group { border-radius: var(--border-radius-sm); column-gap: 10px; @@ -367,7 +373,6 @@ nav.ol-panel> :last-child { flex-wrap: wrap; } - .ol-panel .ol-group-button-toggle { align-items: center; column-gap: 15px; @@ -381,7 +386,7 @@ nav.ol-panel> :last-child { background-position: 5px 50%; background-repeat: no-repeat; border: 0; - display:flex; + display: flex; justify-items: left; text-indent: 5px; } @@ -392,38 +397,36 @@ nav.ol-panel> :last-child { content: ""; filter: invert(100%); -webkit-filter: invert(100%); - height:16px; - width:16px; + height: 16px; + width: 16px; } - .ol-panel .ol-group-button-toggle button.off::before { background-image: url("/images/icons/square-regular.svg"); } - - - .highlight-primary { background-color: var(--secondary-light-grey); } -.highlight-coalition, .highlight-neutral { +.highlight-coalition, +.highlight-neutral { background-color: var(--primary-grey); color: var(--secondary-gunmetal-grey) } -.highlight-coalition[data-coalition="blue"], .highlight-bluefor { +.highlight-coalition[data-coalition="blue"], +.highlight-bluefor { background-color: var(--primary-blue); color: white; } -.highlight-coalition[data-coalition="red"], .highlight-redfor { +.highlight-coalition[data-coalition="red"], +.highlight-redfor { background-color: var(--primary-red); color: white; } - .accent-green { color: var(--accent-green); font-weight: var(--font-weight-bolder); @@ -464,7 +467,6 @@ nav.ol-panel> :last-child { flex-direction: column; } - .slider-container { width: 100%; } @@ -535,17 +537,14 @@ nav.ol-panel> :last-child { font-weight: var(--font-weight-bolder); } - .ol-sortable .handle { - background-image: url( "/images/icons/grip-lines-solid.svg" ); - cursor:ns-resize; - filter:invert(); - height:12px; - width:12px; + background-image: url("/images/icons/grip-lines-solid.svg"); + cursor: ns-resize; + filter: invert(); + height: 12px; + width: 12px; } - - #unit-selection { display: flex; flex-direction: column; @@ -621,17 +620,16 @@ body[data-hide-navyunit] #unit-visibility-control-navyunit { #atc-navbar-control { align-items: center; - display:flex; + display: flex; flex-direction: column; } #atc-navbar-control button { - background:#ffffff20; - border-radius: var( --border-radius-sm ); - padding:4px; + background: #ffffff20; + border-radius: var(--border-radius-sm); + padding: 4px; } - .toggle { --width: 40px; --height: calc(var(--width) / 2); @@ -666,178 +664,161 @@ body[data-hide-navyunit] #unit-visibility-control-navyunit { transition: transform 0.2s; } -.toggle-input:checked ~ .toggle-fill::after { +.toggle-input:checked~.toggle-fill::after { transform: translateX(var(--height)); } - #roe-buttons-container button { - background-color:transparent; - border:1px solid var( --accent-light-blue ); + background-color: transparent; + border: 1px solid var(--accent-light-blue); } -#roe-buttons-container button.selected, #reaction-to-threat-buttons-container button.selected { +#roe-buttons-container button.selected, +#reaction-to-threat-buttons-container button.selected { background-color: white; border-color: white; } -#roe-buttons-container button::before, #reaction-to-threat-buttons-container button::before { - background-position:center; +#roe-buttons-container button::before, +#reaction-to-threat-buttons-container button::before { + background-position: center; background-repeat: no-repeat; content: ""; - display:block; - height:24px; - width:24px; + display: block; + height: 24px; + width: 24px; } - - - #roe-buttons-container button[title="Hold"]::before { - background-image: url( "/themes/olympus/images/icons_roe_stop_light.svg"); + background-image: url("/themes/olympus/images/icons_roe_stop_light.svg"); } #roe-buttons-container button[title="Hold"].selected::before { - background-image: url( "/themes/olympus/images/icons_roe_stop_dark.svg"); + background-image: url("/themes/olympus/images/icons_roe_stop_dark.svg"); } /**/ - #roe-buttons-container button[title="Return"]::before { - background-image: url( "/themes/olympus/images/icons_roe_defend_light.svg"); + background-image: url("/themes/olympus/images/icons_roe_defend_light.svg"); } #roe-buttons-container button[title="Return"].selected::before { - background-image: url( "/themes/olympus/images/icons_roe_defend_dark.svg"); + background-image: url("/themes/olympus/images/icons_roe_defend_dark.svg"); } /**/ - #roe-buttons-container button[title="Designated"]::before { - background-image: url( "/themes/olympus/images/icons_roe_target_light.svg"); + background-image: url("/themes/olympus/images/icons_roe_target_light.svg"); } #roe-buttons-container button[title="Designated"].selected::before { - background-image: url( "/themes/olympus/images/icons_roe_target_dark.svg"); + background-image: url("/themes/olympus/images/icons_roe_target_dark.svg"); } /**/ - #roe-buttons-container button[title="Free"]::before { - background-image: url( "/themes/olympus/images/icons_roe_free_light.svg"); + background-image: url("/themes/olympus/images/icons_roe_free_light.svg"); } #roe-buttons-container button[title="Free"].selected::before { - background-image: url( "/themes/olympus/images/icons_roe_free_dark.svg"); + background-image: url("/themes/olympus/images/icons_roe_free_dark.svg"); } - /****************************************************************************************/ - - #reaction-to-threat-buttons-container button[title="None"]::before { - background-image: url( "/themes/olympus/images/icons_threat_nothing_light.svg"); + background-image: url("/themes/olympus/images/icons_threat_nothing_light.svg"); } #reaction-to-threat-buttons-container button[title="None"].selected::before { - background-image: url( "/themes/olympus/images/icons_threat_nothing_dark.svg"); + background-image: url("/themes/olympus/images/icons_threat_nothing_dark.svg"); } - /**/ - - #reaction-to-threat-buttons-container button[title="Passive"]::before { - background-image: url( "/themes/olympus/images/icons_threat_cms_light.svg"); + background-image: url("/themes/olympus/images/icons_threat_cms_light.svg"); } #reaction-to-threat-buttons-container button[title="Passive"].selected::before { - background-image: url( "/themes/olympus/images/icons_threat_cms_dark.svg"); + background-image: url("/themes/olympus/images/icons_threat_cms_dark.svg"); } - /**/ - - #reaction-to-threat-buttons-container button[title="Evade"]::before { - background-image: url( "/themes/olympus/images/icons_threat_defend_light.svg"); + background-image: url("/themes/olympus/images/icons_threat_defend_light.svg"); } #reaction-to-threat-buttons-container button[title="Evade"].selected::before { - background-image: url( "/themes/olympus/images/icons_threat_defend_dark.svg"); + background-image: url("/themes/olympus/images/icons_threat_defend_dark.svg"); } - /****************************************************************************************/ - - #splash-screen { - background-image: url( "/images/splash/splash_pic_ship.png" ); - background-position:100% 50%; - background-size:320px; - border-radius: var( --border-radius-lg ); - display:none; + background-image: url("/images/splash/splash_pic_ship.png"); + background-position: 100% 50%; + background-size: 320px; + border-radius: var(--border-radius-lg); + display: none; overflow: hidden; - width:700px; + width: 700px; } #splash-content { - background-color: var( --background-steel ); + background-color: var(--background-steel); display: flex; flex-direction: column; - padding:20px; - position:relative; - row-gap:10px; - width:55%; - z-index:10; + padding: 20px; + position: relative; + row-gap: 10px; + width: 55%; + z-index: 10; } #splash-content::after { - background-color: var( --background-steel ); + background-color: var(--background-steel); content: ""; display: block; - height:250px; + height: 250px; position: absolute; - right:0; - top:0; + right: 0; + top: 0; transform: rotate(-23deg); transform-origin: top right; - width:200px; + width: 200px; z-index: -1; } #splash-content #app-summary { - background-image: url( "/images/olympus-500x500.png" ); + background-image: url("/images/olympus-500x500.png"); background-position: 0 50%; background-repeat: no-repeat; - background-size:75px 75px; + background-size: 75px 75px; content: ""; - display:flex; + display: flex; flex-direction: column; justify-content: space-between; min-height: 75px; text-indent: 85px; } -#splash-content #app-summary > * { - height:fit-content; +#splash-content #app-summary>* { + height: fit-content; line-height: 25px; white-space: nowrap; - width:fit-content; + width: fit-content; } #splash-content .app-version { - font-size:11px; + font-size: 11px; } #splash-content #legal-stuff h4 { - text-transform:uppercase; + text-transform: uppercase; } #splash-content #legal-stuff p { - font-size:10px; + font-size: 10px; } .feature-splashScreen #splash-screen { - display:flex; + display: flex; } \ No newline at end of file diff --git a/client/src/controls/dropdown.ts b/client/src/controls/dropdown.ts index 43987d41..cb96e4c0 100644 --- a/client/src/controls/dropdown.ts +++ b/client/src/controls/dropdown.ts @@ -21,6 +21,7 @@ export class Dropdown { this.#value.addEventListener("click", (ev) => { this.#element.classList.toggle("is-open"); + this.#options.classList.toggle("scrollbar-visible", this.#options.scrollHeight > this.#options.clientHeight); this.#clip(); }); @@ -47,7 +48,7 @@ export class Dropdown { button.addEventListener("click", (e: MouseEvent) => { e.stopPropagation(); - this.#value.innerText = option; + this.#value.innerHTML = `
${option}
`; this.#close(); this.#callback(option, e); this.#index = idx; @@ -70,7 +71,7 @@ export class Dropdown { if (idx < this.#optionsList.length) { var option = this.#optionsList[idx]; - this.#value.innerText = option; + this.#value.innerHTML = `
${option}
`; this.#index = idx; this.#close(); this.#callback(option);