first commit
This commit is contained in:
188
loginstephen/index.html
Normal file
188
loginstephen/index.html
Normal file
@@ -0,0 +1,188 @@
|
||||
<!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="../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/store.js"></script>
|
||||
<!-- Component JS -->
|
||||
<script src="components/ComponentA.js"></script>
|
||||
<script src="components/ComponentB.js"></script>
|
||||
|
||||
<script>
|
||||
// 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
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<v-row no-gutters>
|
||||
<v-col cols="8">
|
||||
<v-img
|
||||
:aspect-ratio="1"
|
||||
class="bg-white"
|
||||
:src="bg_src"
|
||||
width="100vw"
|
||||
height="100vh"
|
||||
cover
|
||||
></v-img>
|
||||
</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-container class="mb-6">
|
||||
<v-row
|
||||
align="end"
|
||||
style="min-height: 480px"
|
||||
no-gutters
|
||||
justify="center"
|
||||
>
|
||||
<v-col>
|
||||
<div class="d-flex justify-center">
|
||||
<v-sheet class="pa-2 ma-2">
|
||||
<h2 class="text-h6 font-weight-black">{{ $t('message.login') }}</h2>
|
||||
</v-sheet>
|
||||
</div>
|
||||
<div class="d-flex justify-center mb-6">
|
||||
<v-card
|
||||
class="mx-auto pa-12 pb-8"
|
||||
elevation="0"
|
||||
min-width="400"
|
||||
rounded="lg"
|
||||
>
|
||||
<div class="text-subtitle-1 text-medium-emphasis">{{ $t('message.email') }}</div>
|
||||
<v-text-field
|
||||
density="compact"
|
||||
:placeholder="$t('message.placeholderEmail')"
|
||||
prepend-inner-icon="mdi-email-outline"
|
||||
variant="outlined"
|
||||
></v-text-field>
|
||||
<div class="text-subtitle-1 text-medium-emphasis d-flex align-center justify-space-between">
|
||||
{{ $t('message.password') }}
|
||||
<a
|
||||
class="text-caption text-decoration-none text-blue"
|
||||
href="#"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
{{ $t('message.forgotPassword') }}</a>
|
||||
</div>
|
||||
<v-text-field
|
||||
:append-inner-icon="visible ? 'mdi-eye-off' : 'mdi-eye'"
|
||||
:type="visible ? 'text' : 'password'"
|
||||
density="compact"
|
||||
:placeholder="$t('message.placeholderPassword')"
|
||||
prepend-inner-icon="mdi-lock-outline"
|
||||
variant="outlined"
|
||||
@click:append-inner="visible = !visible"
|
||||
></v-text-field>
|
||||
<div class="text-center">
|
||||
<v-btn
|
||||
:loading="loading"
|
||||
@click="loading = !loading"
|
||||
class="mt-8 text-none"
|
||||
color="blue"
|
||||
size="large"
|
||||
variant="elevated"
|
||||
block
|
||||
>
|
||||
{{ $t('message.login') }}
|
||||
<template v-slot:loader>
|
||||
<v-progress-linear indeterminate></v-progress-linear>
|
||||
</template>
|
||||
</v-btn>
|
||||
</div>
|
||||
</v-card>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-col>
|
||||
</v-row>
|
||||
`
|
||||
});
|
||||
|
||||
const vuetify = Vuetify.createVuetify();
|
||||
|
||||
app.use(store);
|
||||
app.use(vuetify);
|
||||
app.use(i18n);
|
||||
app.mount('#app');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user