149 lines
4.3 KiB
HTML
149 lines
4.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>WESTONE</title>
|
|
<!-- Vuetify CSS -->
|
|
<link href="../css/vuetify.css" rel="stylesheet" />
|
|
<!-- Local Stylesheet for Fonts -->
|
|
<link rel="stylesheet" href="../css/styles.css" />
|
|
<link href="../css/materialdesignicon.css" rel="stylesheet" />
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
|
|
<!-- Vue.js -->
|
|
<!-- <script src="https://unpkg.com/vue@next"></script> -->
|
|
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
|
|
<!-- <script src="../libraries/vue3.4.36.global.prod.js"></script> -->
|
|
<!-- Vuex -->
|
|
<script src="../libraries/vuex.js"></script>
|
|
<!-- Vuetify -->
|
|
<script src="../libraries/vuetify3.js"></script>
|
|
<!-- vue-i18n -->
|
|
<script src="../libraries/vue-i18n.global.js"></script>
|
|
<!-- Axios -->
|
|
<script src="../libraries/axios.js"></script>
|
|
<!-- Store JS -->
|
|
<!-- <script src="store.js"></script> -->
|
|
<!-- Component JS -->
|
|
<script src="../globalscript/theme.js"></script>
|
|
<!-- <script src="https://unpkg.com/vue3-sfc-loader/dist/vue3-sfc-loader.iife.js"></script> -->
|
|
<script src="../libraries/vue3-sfc-loader.js"></script>
|
|
|
|
<script type="module">
|
|
const { loadModule } = window["vue3-sfc-loader"];
|
|
import system from "../globalstore/globalstore.js";
|
|
|
|
// import theme from "./theme.js";
|
|
const store = Vuex.createStore({
|
|
modules: {
|
|
system: system,
|
|
},
|
|
});
|
|
const options = {
|
|
moduleCache: {
|
|
vue: Vue,
|
|
},
|
|
getFile(url) {
|
|
return fetch(url).then((response) =>
|
|
response.ok ? response.text() : Promise.reject(response)
|
|
);
|
|
},
|
|
addStyle(textContent) {
|
|
const style = document.createElement("style");
|
|
style.textContent = textContent;
|
|
const ref = document.head.getElementsByTagName("style")[0] || null;
|
|
document.head.insertBefore(style, ref);
|
|
},
|
|
};
|
|
// Locale messages
|
|
const messages = {
|
|
en: {
|
|
message: {
|
|
login: "Login",
|
|
email: "Email",
|
|
password: "Password",
|
|
forgotPassword: "Forgot password?",
|
|
placeholderEmail: "Enter your email",
|
|
placeholderPassword: "Enter your password",
|
|
},
|
|
},
|
|
id: {
|
|
message: {
|
|
login: "Masuk",
|
|
email: "Surel",
|
|
password: "Kata Sandi",
|
|
forgotPassword: "Lupa kata sandi?",
|
|
placeholderEmail: "Isikan email anda",
|
|
placeholderPassword: "Isikan kata sandi anda",
|
|
},
|
|
},
|
|
};
|
|
|
|
// Get the browser's preferred language
|
|
const browserLocale = navigator.language || navigator.languages[0];
|
|
|
|
// Initialize vue-i18n
|
|
const i18n = VueI18n.createI18n({
|
|
locale: browserLocale.startsWith("id") ? "id" : "en", // Set locale based on browser setting
|
|
fallbackLocale: "en", // Set fallback locale
|
|
messages, // Set locale messages
|
|
});
|
|
|
|
// Vue App
|
|
const app = Vue.createApp({
|
|
components: {
|
|
},
|
|
|
|
data() {
|
|
return {
|
|
visible: false,
|
|
bg_src: "./images/bg_cover.svg",
|
|
items: [
|
|
{
|
|
src: "./images/frame_1.svg",
|
|
},
|
|
{
|
|
src: "./images/frame_1.svg",
|
|
},
|
|
],
|
|
loading: false, // Initialize loading state
|
|
};
|
|
},
|
|
template: `
|
|
<v-app>
|
|
<one-navbar></one-navbar>
|
|
</v-app>
|
|
`,
|
|
});
|
|
const vuetify = Vuetify.createVuetify({
|
|
theme: {
|
|
themes: CustomTheme,
|
|
},
|
|
});
|
|
|
|
app.use(store);
|
|
app.use(vuetify);
|
|
app.use(i18n);
|
|
const components = {
|
|
"one-navbar": "../globalcomponent/one-navbar.vue"
|
|
};
|
|
Promise.all(
|
|
Object.entries(components).map(([name, path]) => {
|
|
return loadModule(path, options).then((component) => {
|
|
app.component(name, component);
|
|
});
|
|
})
|
|
)
|
|
.then(() => {
|
|
app.mount("#app");
|
|
})
|
|
.catch((error) => {
|
|
console.error("Error loading components:", error);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|