Start Gauge
This commit is contained in:
@@ -1,115 +0,0 @@
|
||||
:root {
|
||||
--bodyHeightScale: 1;
|
||||
}
|
||||
@keyframes TemporaryShow {
|
||||
0%, 100% {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
@keyframes TemporaryHide {
|
||||
0%, 100% {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
html {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
html body {
|
||||
-webkit-user-select: none;
|
||||
font-family: var(--font);
|
||||
font-size: calc(var(--viewportHeightRatio) * (36px / 21.6) * var(--currentPageHeight) / 100 );
|
||||
color: white;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#highlight {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
pointer-events: none;
|
||||
}
|
||||
#Electricity {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
#Electricity[state=off] {
|
||||
display: none;
|
||||
}
|
||||
hour-meter-element {
|
||||
background-color: #121212;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
}
|
||||
hour-meter-element #Mainframe {
|
||||
position: absolute;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
background-color: #121212;
|
||||
overflow: visible;
|
||||
font-size: 75vh;
|
||||
line-height: 100vh;
|
||||
font-weight: bold;
|
||||
}
|
||||
hour-meter-element #Mainframe div {
|
||||
background-color: #121212;
|
||||
color: #a0a0a0;
|
||||
position: absolute;
|
||||
height: 100vh;
|
||||
width: 16.6666666667vw;
|
||||
vertical-align: central;
|
||||
text-align: center;
|
||||
border-left: 0.5vw solid black;
|
||||
border-right: 0.5vw solid black;
|
||||
}
|
||||
hour-meter-element #Mainframe .bot {
|
||||
bottom: -100vh;
|
||||
}
|
||||
hour-meter-element #Mainframe #d1, hour-meter-element #Mainframe #d1Bot {
|
||||
left: 0vw;
|
||||
}
|
||||
hour-meter-element #Mainframe #d1[state=decimal], hour-meter-element #Mainframe #d1Bot[state=decimal] {
|
||||
background-color: #a0a0a0;
|
||||
color: black;
|
||||
}
|
||||
hour-meter-element #Mainframe #d2, hour-meter-element #Mainframe #d2Bot {
|
||||
left: 16.6666666667vw;
|
||||
}
|
||||
hour-meter-element #Mainframe #d2[state=decimal], hour-meter-element #Mainframe #d2Bot[state=decimal] {
|
||||
background-color: #a0a0a0;
|
||||
color: black;
|
||||
}
|
||||
hour-meter-element #Mainframe #d3, hour-meter-element #Mainframe #d3Bot {
|
||||
left: 33.3333333333vw;
|
||||
}
|
||||
hour-meter-element #Mainframe #d3[state=decimal], hour-meter-element #Mainframe #d3Bot[state=decimal] {
|
||||
background-color: #a0a0a0;
|
||||
color: black;
|
||||
}
|
||||
hour-meter-element #Mainframe #d4, hour-meter-element #Mainframe #d4Bot {
|
||||
left: 50vw;
|
||||
}
|
||||
hour-meter-element #Mainframe #d4[state=decimal], hour-meter-element #Mainframe #d4Bot[state=decimal] {
|
||||
background-color: #a0a0a0;
|
||||
color: black;
|
||||
}
|
||||
hour-meter-element #Mainframe #d5, hour-meter-element #Mainframe #d5Bot {
|
||||
left: 66.6666666667vw;
|
||||
}
|
||||
hour-meter-element #Mainframe #d5[state=decimal], hour-meter-element #Mainframe #d5Bot[state=decimal] {
|
||||
background-color: #a0a0a0;
|
||||
color: black;
|
||||
}
|
||||
hour-meter-element #Mainframe #d6, hour-meter-element #Mainframe #d6Bot {
|
||||
left: 83.3333333333vw;
|
||||
}
|
||||
hour-meter-element #Mainframe #d6[state=decimal], hour-meter-element #Mainframe #d6Bot[state=decimal] {
|
||||
background-color: #a0a0a0;
|
||||
color: black;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<link rel="stylesheet" href="FPLAN.css" />
|
||||
<script type="text/html" id="FPLAN">
|
||||
<div id="Mainframe">
|
||||
<div id="d1">0</div>
|
||||
<div id="d1Bot" class="bot">1</div>
|
||||
<div id="d2">0</div>
|
||||
<div id="d2Bot" class="bot">1</div>
|
||||
<div id="d3">0</div>
|
||||
<div id="d3Bot" class="bot">1</div>
|
||||
<div id="d4">0</div>
|
||||
<div id="d4Bot" class="bot">1</div>
|
||||
<div id="d5">0</div>
|
||||
<div id="d5Bot" class="bot">1</div>
|
||||
<div id="d6">0</div>
|
||||
<div id="d6Bot" class="bot">1</div>
|
||||
</div>
|
||||
</script>
|
||||
<script
|
||||
type="text/html"
|
||||
import-script="/Pages/VCockpit/Instruments/FSS_B272/KH_FE_FPLAN/FPLAN.js"
|
||||
></script>
|
||||
@@ -1,75 +0,0 @@
|
||||
class HourMeter extends BaseInstrument {
|
||||
constructor() {
|
||||
super();
|
||||
this.decimals = 1;
|
||||
}
|
||||
get templateID() {
|
||||
return "HourMeter";
|
||||
}
|
||||
connectedCallback() {
|
||||
super.connectedCallback();
|
||||
this.digits = [];
|
||||
this.digitsBot = [];
|
||||
for (let i = 1; i <= 6; i++) {
|
||||
this.digits.push(this.getChildById("d" + i));
|
||||
this.digitsBot.push(this.getChildById("d" + i + "Bot"));
|
||||
}
|
||||
}
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback();
|
||||
}
|
||||
parseXMLConfig() {
|
||||
super.parseXMLConfig();
|
||||
if (this.instrumentXmlConfig) {
|
||||
let mode = this.instrumentXmlConfig.getElementsByTagName("Decimals");
|
||||
if (mode.length > 0) {
|
||||
this.decimals = parseInt(mode[0].textContent.toLowerCase());
|
||||
}
|
||||
}
|
||||
for (
|
||||
let i = this.digits.length - 1;
|
||||
i >= this.digits.length - this.decimals;
|
||||
i--
|
||||
) {
|
||||
diffAndSetAttribute(this.digits[i], "state", "decimal");
|
||||
diffAndSetAttribute(this.digitsBot[i], "state", "decimal");
|
||||
}
|
||||
}
|
||||
Update() {
|
||||
super.Update();
|
||||
let hour = SimVar.GetSimVarValue("GENERAL ENG ELAPSED TIME:1", "hour");
|
||||
for (let i = this.digits.length - 1; i >= 0; i--) {
|
||||
if (hour < 0) {
|
||||
hour = 0;
|
||||
}
|
||||
let power = this.digits.length - i - 1 - this.decimals;
|
||||
let digit = Math.floor(
|
||||
(hour % Math.pow(10, power + 1)) / Math.pow(10, power)
|
||||
);
|
||||
if (this.digits[i].textContent != digit + "") {
|
||||
diffAndSetText(this.digits[i], digit + "");
|
||||
diffAndSetText(this.digitsBot[i], ((digit + 1) % 10) + "");
|
||||
}
|
||||
if (
|
||||
Math.pow(10, power) * (digit + 1) <
|
||||
(hour % Math.pow(10, power + 1)) + 0.001
|
||||
) {
|
||||
diffAndSetStyle(
|
||||
this.digits[i],
|
||||
StyleProperty.transform,
|
||||
"translate(0vh,-" + ((100000 * hour) % 100) + "" + "vh)"
|
||||
);
|
||||
diffAndSetStyle(
|
||||
this.digitsBot[i],
|
||||
StyleProperty.transform,
|
||||
"translate(0vh,-" + ((100000 * hour) % 100) + "" + "vh)"
|
||||
);
|
||||
} else {
|
||||
diffAndSetStyle(this.digits[i], StyleProperty.transform, "");
|
||||
diffAndSetStyle(this.digitsBot[i], StyleProperty.transform, "");
|
||||
}
|
||||
hour -= 0.0001;
|
||||
}
|
||||
}
|
||||
}
|
||||
registerInstrument("hour-meter-element", HourMeter);
|
||||
Reference in New Issue
Block a user