Skip to content

Commit

Permalink
🗑️ #78 add manual for scania
Browse files Browse the repository at this point in the history
Signed-off-by: JAGFx <contact@jagfx.fr>
  • Loading branch information
JAGFx committed Feb 18, 2022
1 parent 48c9c39 commit 9908f3e
Show file tree
Hide file tree
Showing 12 changed files with 362 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/assets/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ $cRed: #dc322f;
$cOrange: #cb4b16;
$cGreen: #00E070;
$cGray: lighten($cBlack, 15%);
$cGray2: lighten($cBlack2, 35%);
$cYellow: #f5bb00;
$cBlue: #26d2e2;

Expand Down
2 changes: 1 addition & 1 deletion src/assets/scss/dashboard/scania/_bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
background: $cWhite;
color: transparent;
height: 1rem;
width: 1.85rem;
width: 2.2rem;
margin: .15rem;

&:first-child { margin-left: 0 }
Expand Down
70 changes: 70 additions & 0 deletions src/assets/scss/menu/_menu-tab-skins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* @author: Emmanuel SMITH <hey@emmanuel-smith.me>
* project: ets2-dashboard-skin
* file: _menu-tab-skins.scss
* Date: 17/02/2022
* Time: 19:27
*/

@import "../variables";

.manual {
.manual-wrapper {
width: 90vw;
height: 85vh;
overflow: auto;

table.symbols {
th:first-child{
width: 11rem;
text-align: center;
}

td, th{ vertical-align: middle; }

th {
background: $cBlack2;
border-color: $cRed;
border-top: 0;
border-bottom-width: 1px;
}

td.symbol-td { padding: 0 }

.category {
background: $cBlack;
padding: 0.2rem 1rem;
font-weight: bold;
border-color: $cBlackTransparentMid;
}

.symbol {
border-radius: 0.5rem;
display: flex;
justify-content: center;
align-items: center;
background: $cBlack;
font-size: 2rem;
margin: .5rem;

&.red { color: $cRed; }
&.green { color: $cGreen; }
&.yellow { color: $cYellow; }
&.blue { color: $cBlue; }

&.multiple i:last-child{ margin-left: 0 }

i {
line-height: 0;
margin: 1rem;
}
}

.description {
color: $cGray2;
font-style: italic;
text-align: justify;
}
}
}
}
1 change: 1 addition & 0 deletions src/assets/scss/menu/menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@import "menu-tab-about";
@import "menu-tab-config";
@import "menu-tab-skins";

#header {
max-height: 100%;
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboards/scania/ScaniaBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default {
return 8;
}
return this.displayIcon ? 6 : 8;
return this.displayIcon ? 8 : 10;
},
percentage() {
return (this.value * this.maxWidth()) / this.max;
Expand Down
6 changes: 2 additions & 4 deletions src/components/dashboards/scania/display/ScaniaMainMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
v-if="subMenu === null"
class="w-100 d-flex justify-content-around align-items-center"
>
<div
class="menuSelectorItem flex-area"
@click="subMenu = 'ScaniaVehicleInformationsMenu'"
>
<div class="menuSelectorItem flex-area">
<!-- @click="subMenu = 'ScaniaVehicleInformationsMenu'"-->
<i class="icon-scania-menu-vehicle-info" />
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
max: 36,
value: telemetry.truck.engine.batteryVoltage.value,
unit: 'V',
displayMidLabel: false,
displayValuePosition: 'right'
displayMidLabel: false
}"
>
<i class="icon icon-scania-battery_red" />
Expand All @@ -23,8 +22,7 @@
true,
false
),
unit: unit_pressure(1, false, true),
displayValuePosition: 'right'
unit: unit_pressure(1, false, true)
}"
>
<i class="icon icon-scania-parking-break_red" />
Expand All @@ -36,8 +34,7 @@
value:
(telemetry.truck.adBlue.value * 100) /
telemetry.truck.adBlue.capacity,
unit: '%',
displayValuePosition: 'right'
unit: '%'
}"
>
<i class="icon icon-scania-ad-blue-low_yellow" />
Expand Down
37 changes: 36 additions & 1 deletion src/components/menu/MenuTabSkins.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,50 @@
$t('Activate')
}}</a>
</div>
<div
v-if="$isActive(skin) && !$isDisabled(skin) && $hasManual(skin)"
class="card-footer d-flex justify-content-center align-items-center"
>
<button
class="btn btn-sm btn-primary"
@click="setManualComponent(skin)"
>
Manual
</button>
</div>
</div>

<component :is="manual" @click.native="manual = null" />
</div>
</template>

<script>
import SkinManualScania from '@/components/menu/skin-manuals/SkinManualScania';
import SkinsMixin from '@/mixins/SkinsMixin';
export default {
name: 'MenuTabSkins',
mixins: [SkinsMixin]
components: {
SkinManualScania
},
mixins: [SkinsMixin],
data() {
return {
manual: 'SkinManualScania'
};
},
methods: {
setManualComponent(skin) {
switch (skin.id) {
case 'Scania':
this.manual = 'SkinManualScania';
break;
default:
this.manual = null;
break;
}
}
}
};
</script>
63 changes: 63 additions & 0 deletions src/components/menu/skin-manuals/SkinManualLine.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<template>
<tr>
<td class="symbol-td">
<div class="d-flex justify-content-center">
<div
class="symbol"
:class="[
color,
{
multiple: icons.length > 1
}
]"
>
<i v-for="icon in icons" :key="icon" class="icon" :class="icon" />
</div>
</div>
</td>
<td>
<div class="d-flex flex-column">
<div class="d-flex justify-content-start align-items-center">
<span>{{ label }}</span>
<span v-if="!implemented" class="badge badge-secondary ml-2"
>Not yet implemented</span
>
</div>
<small v-if="description.length > 0" class="description">{{
description
}}</small>
</div>
</td>
</tr>
</template>

<script>
export default {
name: 'SkinManualLine',
props: {
icons: {
type: Array,
required: true
},
color: {
type: String,
required: false,
default: ''
},
label: {
type: String,
required: true
},
description: {
type: String,
required: false,
default: ''
},
implemented: {
type: Boolean,
required: false,
default: true
}
}
};
</script>
Loading

0 comments on commit 9908f3e

Please sign in to comment.