196 lines
5.8 KiB
HTML
196 lines
5.8 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="components/ComponentA.js"></script>
|
|
<script src="components/ComponentB.js"></script>
|
|
<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 coba from "./modules/coba.js";
|
|
import coba2 from "./modules/coba2.js";
|
|
import system from "../globalstore/globalstore.js";
|
|
|
|
// import theme from "./theme.js";
|
|
const store = Vuex.createStore({
|
|
modules: {
|
|
system: system,
|
|
coba: coba,
|
|
coba2: coba2,
|
|
},
|
|
});
|
|
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: {
|
|
"component-a": ComponentA,
|
|
"component-b": ComponentB,
|
|
},
|
|
|
|
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
|
|
};
|
|
},
|
|
// <one-navbar></one-navbar>
|
|
template: `
|
|
<v-app>
|
|
<one-navbar></one-navbar>
|
|
</v-app>
|
|
`,
|
|
// <v-row no-gutters>
|
|
// <v-col cols="8">
|
|
// <hello-world></hello-world>
|
|
// <hello-world2></hello-world2>
|
|
|
|
// </v-col>
|
|
// <v-col cols="4">
|
|
// <div class="d-flex justify-center mb-6 mt-4 bg-surface-variant">
|
|
// <v-img
|
|
// class="bg-white"
|
|
// height="86px"
|
|
// src="./images/logo.svg"
|
|
// ></v-img>
|
|
// </div>
|
|
|
|
// </v-col>
|
|
// </v-row>
|
|
});
|
|
|
|
// themes: {
|
|
// light: {
|
|
// primary: "#2196F3",
|
|
// "primary-lighten": "#E3F2FD",
|
|
// "primary-darken": "#0D47A1",
|
|
// secondary: "#03a9f4",
|
|
// accent: "#ff5722",
|
|
// error: "#f44336",
|
|
// warning: "#ff9800",
|
|
// info: "#2196f3",
|
|
// success: "#4caf50",
|
|
// },
|
|
// dark: dark,
|
|
// },
|
|
// dark: false,
|
|
// // defaultTheme: "myCustomLightTheme",
|
|
const vuetify = Vuetify.createVuetify({
|
|
theme: {
|
|
themes: CustomTheme,
|
|
},
|
|
});
|
|
|
|
app.use(store);
|
|
app.use(vuetify);
|
|
app.use(i18n);
|
|
const components = {
|
|
"hello-world2": "./components/coba2.vue",
|
|
"hello-world": "./components/coba.vue",
|
|
"one-navbar": "./components/one-navbar.vue",
|
|
"main-component": "./components/main.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>
|