Skip to content

Commit

Permalink
Merge branch 'userXinos:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
233dada authored May 1, 2024
2 parents 884a6b8 + 3a7c8e7 commit ace841f
Show file tree
Hide file tree
Showing 8 changed files with 336 additions and 30 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

This changelog starts with the v3.0 the third rewrite of the parser module and the entire web app

## 4.3.0

### Added
- [Third Party Tools Page](https://userxinos.github.io/HadesSpace/thirdPartyTools)
- [WSMatches Page](https://userxinos.github.io/HadesSpace/WSMatches)
- Install PWA modal

### Changed
- Support localization for About page
- Update favicons
- Update PWA manifest (if you are using PWA mode, it is recommended to reinstall the app)

### Fixes
- Bugs on the drones page
- Some styles for mobile
- Many minor format bugs


## 4.2.0

### Added
Expand Down
1 change: 1 addition & 0 deletions i18n/externalLocales/en/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@
"TID_PLAYER_INFO_SECTION_BADGES": "DISTINCTIONS",
"TID_MODULE_CARRIER_LASER": "MULTI-TARGET LASER",
"TID_MODULE_CARRIER_LASER_DESCR": "Can target multiple enemy ships in range. Each laser beam scales damage up over time, independently from the other beams.",
"TID_OTHER_PLAYER_INFO_PAGE_CORP_SECTION": "CORPORATION",
"TID_PRODUCTION_DLG_SHIPS": "SHIPS",
"TID_PRODUCTION_DLG_STATIONS": "SPACE STATIONS",
"TID_UPGRADE_TRANSPORT_DESIGN": "PERMANENTLY UPGRADE TRANSPORTS TO\\nLEVEL {0}?",
Expand Down
5 changes: 3 additions & 2 deletions i18n/locales/en/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"INSTALL_PWA_NOTE": "Install a progressive web application. Powered by your favorite browser, icon on desktop/launcher, work offline",
"INSTALL_PWA_ERR_NOT_PROVIDE": "Browser did not provide installation function",
"THIRD_PARTY_TOOLS": "Third Party Tools",
"THIRD_PARTY_TOOLS_NOTE": "This list of tools is provided for informational purposes only. We are not responsible for the accuracy, results, or safety of using these tools. Their use is at your own risk"

"THIRD_PARTY_TOOLS_NOTE": "This list of tools is provided for informational purposes only. We are not responsible for the accuracy, results, or safety of using these tools. Their use is at your own risk",
"SELECT": "Select",
"SELECTED": "{0} selected"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hades-space",
"author": "Xinos",
"version": "4.2.0",
"version": "4.3.0",
"type": "module",
"scripts": {
"build": "npm run parser && npm run i18n:full && vite build",
Expand Down
224 changes: 224 additions & 0 deletions src/components/MultiSelect.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
<template>
<div
v-click-outside="() => isOpen = false"
class="multiselect"
:class="{'__active': isOpen}"
>
<slot
:selected="selected"
:toggle-dropdown="toggleDropdown"
>
<button
class="multiselect_btn"
@click="toggleDropdown"
>
<input
ref="filterInput"
v-model="filter"
type="text"
@click.stop
>
<div
v-show="!isOpen"
class="label"
>
<slot
name="label"
>
<p v-if="selected.length">
{{ $t('SELECTED', [selected.length]) }}
</p>
<p
v-else
v-t="'SELECT'"
/>
</slot>
</div>

<div
v-if="!isOpen"
class="clear"
@click.stop="clear"
/>
<div class="arrow" />
</button>
</slot>

<Transition name="list">
<ul
v-if="isOpen"
class="multiselect_list"
>
<li
v-for="(option, id) in filteredOptions"
:key="id"
@click="selectOption(option)"
>
<input
type="checkbox"
:checked="$props.modelValue.includes(option)"
>
<span class="label">{{ option[$props.displayField] }}</span>
</li>
</ul>
</Transition>
</div>
</template>

<script setup lang="ts">
import { computed, ref } from 'vue';
export interface Props {
options: [{ [key: string]: unknown }];
displayField: string
}
const props = defineProps<Props>();
const selected = defineModel<unknown[]>({ required: true });
const isOpen = ref(false);
const filterInput = ref<HTMLElement>();
const filter = ref<string>();
const filteredOptions = computed(() =>
props.options.filter((e) => e[props.displayField]?.toLowerCase().includes(filter.value?.toLowerCase())),
);
function toggleDropdown() {
isOpen.value = !isOpen.value;
if (isOpen.value) {
filter.value = '';
filterInput.value?.focus();
}
}
function selectOption(option) {
if (selected.value.includes(option)) {
selected.value.splice(selected.value.indexOf(option), 1);
} else {
selected.value.push(option);
}
}
function clear() {
selected.value = [];
}
</script>

<style scoped lang="scss">
@import "../style/vars";
.multiselect {
position: relative;
height: 100%;
z-index: 1;
&.__active {
.arrow {
transform: rotate(270deg);
}
}
&_btn {
cursor: pointer;
display: flex;
font-weight: bold;
transition: background .2s;
width: 100%;
background: inherit;
font-size: 16px;
height: 50px;
.arrow {
width: 16px;
height: 16px;
background-repeat: no-repeat;
background-image: url("@/img/icons/arrow.svg");
transform: rotate(90deg);
transition: transform .2s;
position: absolute;
right: 10px;
top: 18px;
}
.clear {
width: 24px;
height: 24px;
background-repeat: no-repeat;
background-image: url("@/img/icons/cross.svg");
position: absolute;
right: 30px;
top: 14px;
}
.label {
position: absolute;
width: 90%;
height: 92%;
display: flex;
justify-content: center;
align-items: center;
background: inherit;
}
input {
position: absolute;
width: 80%;
background: inherit;
border: none;
padding: 5px;
top: 10px;
left: 10px;
&:active, &:focus {
background: inherit;
border: 1px solid $border-color;
border-radius: 5px;
outline: none
}
}
}
&_list {
position: absolute;
width: 100%;
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1), 0 7.7037px 12.7407px rgba(0, 0, 0, 0.061), 0 1.62963px 3.25926px rgba(0, 0, 0, 0.061);
background: inherit;
border-radius: 4px;
margin-top: 6px;
overflow-y: auto;
max-height: 300px;
text-align: center;
cursor: pointer;
&::-webkit-scrollbar {
width: 4px;
height: 40px;
}
::-webkit-scrollbar-thumb {
min-height: 40px;
}
li {
padding: 8px;
display: flex;
justify-content: start;
.label {
width: 100%;
}
&:hover {
filter: invert(0.9);
}
}
}
}
.list {
&-enter-active, &-leave-active {
transition: max-height .18s linear;
}
&-enter-from, &-leave-to {
max-height: 0;
}
}
</style>
3 changes: 3 additions & 0 deletions src/img/icons/cross.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ace841f

Please sign in to comment.