Skip to content

Commit

Permalink
fix: Consistent styling (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno authored Jul 29, 2021
1 parent e72e871 commit be34c4e
Show file tree
Hide file tree
Showing 21 changed files with 128 additions and 48 deletions.
22 changes: 21 additions & 1 deletion src/assets/less/coloration.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ table, [class*='badge-'] {
}
}

.navbar-nav.ml-auto .dropdown-item {
color: @text-faded;
background-color: transparent;

& > i {
color: @text-faded;
}
}

.dropdown-header {
color: @dh-color;
}
Expand All @@ -54,7 +63,7 @@ table, [class*='badge-'] {
}

.dropdown-item > i {
color: @dh-color;
color: @text-faded;
}

.router-link-exact-active.router-link-active,
Expand Down Expand Up @@ -132,6 +141,17 @@ li.nav-item.b-nav-dropdown:has(.active) {
color: @badge-color;
}

.btn-outline-primary {
border-color: @primary-bg;

&:not(:disabled):not(.disabled):active,
&:not(:disabled):not(.disabled).active,
.show > &.dropdown-toggle {
background-color: @primary-bg;
border-color: @primary-bg;
}
}

.btn-info {
background-color: @info-bg;
border-color: @info-bg;
Expand Down
3 changes: 2 additions & 1 deletion src/assets/less/night.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.night {
@text-color: white;
@text-faded: rgba(255, 255, 255, 0.5);
@bg: #222;
@bg-darker: #303030;
@link-color: #00bc8c;
Expand All @@ -26,7 +27,7 @@

@stripe-bg: #303030;
@check-color: #375a7f;
@tr-hover: rgba(0,0,0,0.075);
@tr-hover: rgba(0, 0, 0, 0.075);

@panel-bg: #2c2f33;
@panel-bt-border: @theme-primary;
Expand Down
1 change: 1 addition & 0 deletions src/assets/less/retro.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.retro {
@text-color: #39ff14;
@text-faded: @text-color;
@bg: #000;
@bg-darker: #000;
@link-color: @text-color;
Expand Down
4 changes: 2 additions & 2 deletions src/components/NoDataItem.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<b-list-group-item class="list-group-item-borderbottom py-1">
<b-list-group-item class="py-1" :class="{ 'list-group-item-borderbottom': !this.overrideBorder }">
<span class="dim">
<HubImg
:src="loading"
Expand All @@ -21,7 +21,7 @@ import HubImg from '@/components/HubImg.vue';
import loading from '@/assets/img/general/loading.svg';
export default {
name: 'NoDataItem',
props: ['text'],
props: ['text', 'overrideBorder'],
data() {
return {
loading: loading,
Expand Down
1 change: 0 additions & 1 deletion src/components/modalDialogs/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export default {
},
methods: {
updateComponentState(enabledComponents) {
console.log(enabledComponents);
Object.keys(this.$store.getters.componentState).forEach((component) => {
this.$store.commit('commitComponentDisplayMode', [component, enabledComponents.includes(component)]);
});
Expand Down
48 changes: 41 additions & 7 deletions src/components/panels/FissuresPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
:style="styleObject"
v-for="(fissure, index) in filteredFissures"
:key="fissure.id"
v-bind:class="{
'list-group-item-borderless': index !== filteredFissures.length - 1,
'pb-0': index !== filteredFissures.length - 1,
'list-group-item-borderbottom': index === filteredFissures.length - 1,
}"
class="list-group-item-borderless"
:class="{ 'pb-0': index !== filteredFissures.length - 1 }"
>
<span class="pull-left">
<HubImg
Expand All @@ -35,12 +32,27 @@
/>
</span>
</b-list-group-item>
<NoDataItem v-if="filteredFissures.length === 0" :text="headertext" />

<NoDataItem v-if="filteredFissures.length === 0" :text="headertext" :overrideBorder="true" />
<b-list-group-item class="list-group-item-borderbottom">
<b-form-group :label="$t('fissures.choice')" v-slot="{ ariaDescribedby }">
<b-form-radio-group
v-model="check"
:options="options"
:aria-describedby="ariaDescribedby"
button-variant="outline-primary"
size="sm"
name="radio-btn-outline"
buttons
></b-form-radio-group>
</b-form-group>
</b-list-group-item>
</b-list-group>
</HubPanelWrap>
</template>

<script>
import { mapGetters } from 'vuex';
import TimeBadge from '@/components/TimeBadge.vue';
import HubImg from '@/components/HubImg.vue';
import NoDataItem from '@/components/NoDataItem.vue';
Expand All @@ -63,9 +75,20 @@ export default {
name: 'Fissures',
props: ['fissures'],
computed: {
...mapGetters({
fissureDisplays: 'fissureDisplays',
}),
headertext() {
return this.$t('fissures.header');
},
check: {
get() {
return this.fissureDisplays;
},
set(value) {
this.$store.commit('commitFissureDisplaysState', [value]);
},
},
filteredFissures: function () {
const pState = [];
Object.keys(this.$store.getters.fissurePlanetStates).forEach((p) => {
Expand All @@ -77,7 +100,13 @@ export default {
return this.fissures
.filter((fissure) => {
const isFiltered = planets.test(fissure.node);
return (pState.length > 0 ? !isFiltered : true) && !fissure.expired;
let include = !fissure.expired;
if (fissure.isStorm) {
include = include && this.check.includes('storms');
} else {
include = include && this.check.includes('fissures');
}
return (pState.length > 0 ? !isFiltered : true) && include;
})
.sort((a, b) => {
return a.isStorm && !b.isStorm ? 1 : !a.isStorm && b.isStorm ? -1 : a.tierNum - b.tierNum;
Expand All @@ -96,6 +125,11 @@ export default {
'vertical-align': 'middle',
},
archwing,
options: [
{ text: this.$t('fissures.header'), value: 'fissures' },
{ text: this.$t('fissures.both'), value: 'fissures-storms' },
{ text: this.$t('fissures.voidstorm'), value: 'storms' },
],
};
},
components: {
Expand Down
38 changes: 16 additions & 22 deletions src/components/panels/TimePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,22 @@
<HubPanelWrap :title="headertext" class="time" :class="[(location || 'sol').toLowerCase()]">
<b-list-group>
<b-list-group-item :style="styleObject" class="list-group-item-borderbottom">
<div class="row">
<div class="col-md-9">
<span
class="pull-left"
v-bind:class="{
day: this.isDay,
night: this.isNight,
warm: this.isWarm,
cold: this.isCold,
fass: this.isFass,
vome: this.isVome,
}"
>
<span style="text-transform: capitalize">{{
time.state || time.active ? this.$t(`time.${(time.state || time.active).toLowerCase()}`) : display
}}</span>
</span>
</div>
<div class="col-md-3">
<TimeBadge :starttime="time.activation || now" :endtime="time.expiry" :interval="1000" />
</div>
</div>
<span
class="pull-left"
v-bind:class="{
day: this.isDay,
night: this.isNight,
warm: this.isWarm,
cold: this.isCold,
fass: this.isFass,
vome: this.isVome,
}"
>
<span style="text-transform: capitalize">{{
time.state || time.active ? this.$t(`time.${(time.state || time.active).toLowerCase()}`) : display
}}</span>
</span>
<TimeBadge class="pull-right" :starttime="time.activation || now" :endtime="time.expiry" :interval="1000" />
</b-list-group-item>
</b-list-group>
</HubPanelWrap>
Expand Down
4 changes: 3 additions & 1 deletion src/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "Fissury",
"voidstorm": "Void Storm"
"voidstorm": "Void Storm",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "Invaze",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "Risse",
"voidstorm": "Void Storm"
"voidstorm": "Void Storm",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "Invasionen",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "Fissures",
"voidstorm": "Void Storm"
"voidstorm": "Void Storm",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "Invasions",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "Fisuras",
"voidstorm": "Void Storm"
"voidstorm": "Void Storm",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "Invasiones",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "Fissures",
"voidstorm": "Void Storm"
"voidstorm": "Void Storm",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "Invasions",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "Fessure",
"voidstorm": "Void Storm"
"voidstorm": "Void Storm",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "Invasioni",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "균열",
"voidstorm": "보이드 폭풍"
"voidstorm": "보이드 폭풍",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "침공",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "Fissures",
"voidstorm": "Void Storm"
"voidstorm": "Void Storm",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "Invasions",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "Fissures",
"voidstorm": "Void Storm"
"voidstorm": "Void Storm",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "Invasions",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "Разрывы Бездны",
"voidstorm": "Void Storm"
"voidstorm": "Void Storm",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "Вторжения",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/sr.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "Fissures",
"voidstorm": "Void Storm"
"voidstorm": "Void Storm",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "Invasions",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "Fissures",
"voidstorm": "Void Storm"
"voidstorm": "Void Storm",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "Invasions",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
},
"fissures": {
"header": "虚空裂缝",
"voidstorm": "虚空风暴"
"voidstorm": "虚空风暴",
"choice": "Choose which fissures to show",
"both": "Both"
},
"invasions": {
"header": "入侵",
Expand Down
7 changes: 6 additions & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const state = {
components: components,
trackables: trackables,
fissurePlanets: fissurePlanets,
fissureDisplays: 'fissures-storms',
soundFilters: [],
notificationsAllowed: 'default',
notifiedIds: {
Expand Down Expand Up @@ -109,6 +110,9 @@ const mutations = {
const toSet = state.fissurePlanets[key];
toSet.state = newState;
},
commitFissureDisplaysState: (state, [value]) => {
state.fissureDisplays = value;
},
commitSounds: (state, [sounds]) => {
state.soundFilters = sounds;
},
Expand Down Expand Up @@ -221,7 +225,8 @@ const getters = {
theme: (state) => state.theme || 'night',
componentState: (state) => state.components,
trackableState: (state) => state.trackables,
fissurePlanetStates: (state) => state.fissurePlanets,
fissurePlanetStates: (state) => state.fissurePlanets || fissurePlanets,
fissureDisplays: (state) => state.fissureDisplays || 'fissures-storms',
sounds: (state) => state.soundFilters,
notificationAllowance: (state) => state.notificationsAllowed,
notifiedIds: (state) => state.notifiedIds[state.platform],
Expand Down

1 comment on commit be34c4e

@vercel
Copy link

@vercel vercel bot commented on be34c4e Jul 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.