Skip to content

Commit

Permalink
💄 [feat/rework-scania] #78 add gauge on scania next gen skin
Browse files Browse the repository at this point in the history
Signed-off-by: JAGFx <contact@jagfx.fr>
  • Loading branch information
JAGFx committed Mar 6, 2022
1 parent a5bb429 commit 6274d38
Show file tree
Hide file tree
Showing 18 changed files with 403 additions and 74 deletions.
70 changes: 0 additions & 70 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file added public/img/dashboard/scania-next-gen/arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions src/assets/scss/dashboard/_scania-next-gen.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
@import "scania-next-gen/variable";
@import "scania-next-gen/font-face";

.scania-next-gen {
@import "scania-next-gen/gauge-display";
@import "scania-next-gen/ad-blue-bar";
@import "scania-next-gen/fuel-gauge";

&.wrapper {

}

.dashboard {
background: url("/img/dashboard/scania-next-gen/background.jpg") top left no-repeat;
position: absolute;
transform-origin: top left;
left: 50%;
top: 50%;
}

.truck-speed {
position: fixed;
background-image: url("/img/dashboard/scania-next-gen/arrow.png");
transform: rotate(-116.3deg);
transform-origin: 50% 236px;
left: 274px;
top: 142px;
width: 40px;
height: 263px;
}

.truck-engineRpm {
position: fixed;
background-image: url("/img/dashboard/scania-next-gen/arrow.png");
left: 1411px;
top: 145px;
width: 40px;
height: 263px;
transform: rotate(-117.7deg);
transform-origin: 50% 231px;
}
}
50 changes: 50 additions & 0 deletions src/assets/scss/dashboard/scania-next-gen/_ad-blue-bar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* @author: Emmanuel SMITH <hey@emmanuel-smith.me>
* project: ets2-dashboard-skin
* file: _ad-blue-bar.scss
* Date: 06/03/2022
* Time: 16:21
*/

@import "variable";

.adblue{
.adblue-bars {
.labels { font-size: 1.2rem ; line-height: 1.3rem;}

.bar-wrapper {
border-bottom: 2px solid $cWhite;
padding-bottom: .25rem;
position: relative;

&:before, &:after {
content: ' ';
position: absolute;
z-index: 1;
width: 1.2rem;
height: 1rem;
background: #0f0f0f;
border: 2px solid $cWhite;
border-color: transparent transparent $cWhite transparent;
}

&:before {
top: 0.2rem;
left: -0.4rem;
transform: rotate(220deg);
}

&:after {
top: 0.2rem;
right: -0.4rem;
transform: rotate(135deg);
}

.bar {
width: 100%;
height: .4rem;
background: $cWhite;
}
}
}
}
14 changes: 14 additions & 0 deletions src/assets/scss/dashboard/scania-next-gen/_font-face.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @author: Emmanuel SMITH <hey@emmanuel-smith.me>
* project: ets2-dashboard-skin
* file: _font-face.scss
* Date: 06/03/2022
* Time: 14:09
*/

@font-face {
font-family: 'ww-digital';
src: url("/font/dashboard/scania-next-gen/WW-Digital.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
30 changes: 30 additions & 0 deletions src/assets/scss/dashboard/scania-next-gen/_fuel-gauge.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* @author: Emmanuel SMITH <hey@emmanuel-smith.me>
* project: ets2-dashboard-skin
* file: _fuel-gauge.scss
* Date: 06/03/2022
* Time: 17:21
*/

@import "variable";

.fuel-gauge {
position: absolute;
top: 35.8rem;
left: 11.4rem;
width: 13.5rem;

.bar {
width: 1.1rem;
height: .3rem;
background: $cGreyLight;

&.active {
background: $cWhite;
}

&.red, &:first-child {
background: $cRed;
}
}
}
77 changes: 77 additions & 0 deletions src/assets/scss/dashboard/scania-next-gen/_gauge-display.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* @author: Emmanuel SMITH <hey@emmanuel-smith.me>
* project: ets2-dashboard-skin
* file: _gauge-display.scss
* Date: 06/03/2022
* Time: 13:54
*/

@import "variable";

.gauge-display {
position: fixed;
color: $cWhite;
width: 13.5rem;
height: 11.5rem;
top: 17.4rem;

.value {
font-family: "ww-digital";
font-weight: normal;
}

&.left {
left: 11.5rem;

.speed {
.value {
line-height: 4rem;
font-size: 4.3rem;
}
.unit {
font-size: 1rem;
line-height: 1.2rem;
margin-left: .5rem;
}
}

.line {
.value {
font-size: 2.5rem;
line-height: 2.2rem;
}
.unit, .trip-label {
font-size: 1rem;
line-height: 1.2rem;
margin-left: .5rem;
}
}
}

&.right {
right: 11.2rem;

.hour {
.value {
line-height: 3rem;
font-size: 3.4rem;
}
}

.exterior-temperature {
.value {
font-size: 2.5rem;
line-height: 2.2rem;
}
.unit {
font-size: 1rem;
line-height: 1.2rem;
margin-left: .5rem;
}
}

.adblue {
i { font-size: 2.5rem; }
}
}
}
17 changes: 17 additions & 0 deletions src/assets/scss/dashboard/scania-next-gen/_variable.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @author: Emmanuel SMITH <hey@emmanuel-smith.me>
* project: ets2-dashboard-skin
* file: _variable.scss
* Date: 07/02/2022
* Time: 19:11
*/

$cBlack: #000;
$cWhite: #FFF;
$cGreen: #4CFF00;
$cYellow: #FDC200;
$cGrey: #1C1D21;
$cGreyDark: #151716;
$cGreyLight: #58595b;
$cBlue: #004dff;
$cRed: #ED0F02;
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>
<div
v-if="telemetry2.truck.ignitionIsTurnedOn"
class="adblue d-flex justify-content-center align-items-center w-100"
>
<i class="icon-scania-ad-blue-low_yellow mr-2"></i>
<div class="adblue-bars w-100">
<div class="labels d-flex justify-content-between align-items-center">
<span>0</span>
<span>1/2</span>
<span>1</span>
</div>
<div
class="bar-wrapper d-flex justify-content-between align-items-center"
>
<div class="bar" :style="{ width: `${size()}%` }"></div>
</div>
</div>
</div>
</template>

<script>
import TelemetryMixin from '@/mixins/TelemetryMixin';
export default {
name: 'ScaniaNextGenAdBlueBar',
mixins: [TelemetryMixin],
methods: {
size() {
return (
(this.telemetry2.truck.adBlueLevel * 100) /
this.telemetry2.truck.adBlueCapacity
);
}
}
};
</script>
Loading

0 comments on commit 6274d38

Please sign in to comment.