ADD: Install vue-i18n & implement in navbar

This commit is contained in:
Robert Kossessa
2024-01-22 15:22:43 +01:00
parent 6e4dc5e9db
commit 8cb6a8be68
5 changed files with 118 additions and 27 deletions

View File

@@ -1,10 +1,22 @@
import './assets/main.css'
import { createApp } from 'vue'
import {createApp} from 'vue'
import {createI18n} from 'vue-i18n'
import en from './lang/en.js'
import App from './App.vue'
createApp(App).mount('#app')
const i18n = createI18n({
locale: 'en',
fallbackLocale: 'en',
messages: {en}
})
const app = createApp(App)
app.use(i18n)
app.mount('#app')
var startPos = 0;
var totalPos = 360;
@@ -12,25 +24,25 @@ var currentPos = 156;
var minRange = 0;
var maxRange = 40;
document.addEventListener("DOMContentLoaded", function(){
document.addEventListener("DOMContentLoaded", function () {
//....
// Quick Preview GUI indicator Render
var scale = document.getElementById("scale");
var scale = document.getElementById("scale");
Number.prototype.map = function (in_min, in_max, out_min, out_max) {
return (this - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
var guiCurrentPos = Math.round(currentPos.map(startPos, totalPos, minRange, maxRange));
for (var i = 0; i < 40; i = i + 1) {
scale.innerHTML += "<div class='bg-white'></div>";
if (i - 1 < guiCurrentPos) {
scale.getElementsByTagName("div")[i].classList.add("active");
if (i == guiCurrentPos) {
scale.getElementsByTagName("div")[guiCurrentPos].classList.add("current");
}
}
Number.prototype.map = function (in_min, in_max, out_min, out_max) {
return (this - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
var guiCurrentPos = Math.round(currentPos.map(startPos, totalPos, minRange, maxRange));
for(var i = 0; i < 40; i=i+1){
scale.innerHTML += "<div class='bg-white'></div>";
if (i - 1 < guiCurrentPos) {
scale.getElementsByTagName("div")[i].classList.add("active");
if (i == guiCurrentPos) {
scale.getElementsByTagName("div")[guiCurrentPos].classList.add("current");
}
}
}
});