feat: DateConverter

Signed-off-by: CorentinTh <corentin.thomasset74@gmail.com>
This commit is contained in:
CorentinTh 2020-04-25 21:05:40 +02:00
parent e1ebeefdc4
commit 662b84cda0
No known key found for this signature in database
GPG key ID: 44C26D9F091CEFC7
7 changed files with 132 additions and 53 deletions

View file

@ -55,11 +55,9 @@
</v-app-bar> </v-app-bar>
<v-content> <v-content>
<v-container class="fill-height"> <v-row class="fill-height pa-4" justify="center" align="center" no-gutters>
<v-row justify="center" align="center">
<router-view></router-view> <router-view></router-view>
</v-row> </v-row>
</v-container>
</v-content> </v-content>
<!-- <v-footer app>--> <!-- <v-footer app>-->
@ -79,15 +77,19 @@
appVersion: 'v' + process.env.APPLICATION_VERSION, appVersion: 'v' + process.env.APPLICATION_VERSION,
drawer: null, drawer: null,
items: [ items: [
{ {
title: 'Crypto', title: 'Crypto',
child: [ child: [
{icon: 'fa-key', text: 'Token generator', link: '/token-generator'}, {icon: 'fa-key', text: 'Token generator', link: '/token-generator'},
{icon: 'fa-key', text: 'Hash text', link: '/hash'}, {icon: 'fa-font', text: 'Hash text', link: '/hash'},
] ],
},
{
title: 'Converter',
child: [
{icon: 'fa-calendar', text: 'Date/Time converter', link: '/date-converter'},
],
} }
], ],
}), }),
created() { created() {
@ -97,6 +99,18 @@
</script> </script>
<style lang="less"> <style lang="less">
.single-card {
width: 100%;
max-width: 700px !important;
}
.v-card__title{
justify-content: center;
font-size: 30px !important;
line-height: 30px !important;
padding: 30px 0 !important;
font-weight: 300 !important;
}
/* footer {*/ /* footer {*/
/* display: flex;*/ /* display: flex;*/

View file

@ -0,0 +1,64 @@
<template>
<v-row justify="center">
<v-col lg="6" md="6" sm="12" >
<v-card class="mb-5">
<v-card-title>Input</v-card-title>
<v-card-text>
<v-switch v-model="useCurrentDate" label="Use current date"/>
</v-card-text>
</v-card>
<v-card class="mb-5">
<v-card-title>Date</v-card-title>
<v-card-text>
<v-text-field readonly outlined label="Date" :value="displayedDate.toDateString()"/>
<v-text-field readonly outlined label="Locale date" :value="displayedDate.toLocaleDateString()"/>
</v-card-text>
</v-card>
<v-card class="mb-5">
<v-card-title>Time</v-card-title>
<v-card-text>
<v-text-field readonly outlined label="Time" :value="displayedDate.toTimeString()"/>
<v-text-field readonly outlined label="Locale time" :value="displayedDate.toLocaleTimeString()"/>
</v-card-text>
</v-card>
</v-col>
<v-col lg="6" md="6" sm="12">
<v-card >
<v-card-title>DateTime</v-card-title>
<v-card-text>
<v-text-field readonly outlined label="Locale datetime" :value="displayedDate.toLocaleString()"/>
<v-text-field readonly outlined label="ISO 8601" :value="displayedDate.toISOString()"/>
<v-text-field readonly outlined label="UTC format" :value="displayedDate.toUTCString()"/>
<v-text-field readonly outlined label="UNIX Timestamp (ms)" :value="displayedDate.getTime()"/>
<v-text-field readonly outlined label="Complete" :value="displayedDate.toString()"/>
</v-card-text>
</v-card>
</v-col>
</v-row>
</template>
<script>
export default {
name: "DateConverter",
created() {
setInterval(this.refreshCurrentDate.bind(this), 1000);
},
data() {
return {
useCurrentDate: true,
displayedDate: new Date(),
formats: ['locale'],
refreshCurrentDate() {
if (this.useCurrentDate) {
this.displayedDate = new Date();
}
}
}
}
}
</script>
<style scoped lang="less">
</style>

View file

@ -1,5 +1,5 @@
<template> <template>
<v-card> <v-card class="single-card">
<v-card-title>Hash text</v-card-title> <v-card-title>Hash text</v-card-title>
<v-card-text> <v-card-text>
<v-textarea <v-textarea

View file

@ -1,34 +1,29 @@
<template> <template>
<v-card> <v-card class="single-card">
<v-card-title>Token generator</v-card-title> <v-card-title>Token generator</v-card-title>
<v-card-text> <v-card-text>
<v-row no-gutters> <v-row no-gutters>
<v-col lg="6" md="12"> <v-col lg="6" md="12">
<v-switch v-model="withLowercase" label="Lowercase (abc...)" color="#4CAF50"/> <v-switch v-model="withLowercase" label="Lowercase (abc...)"/>
<v-switch v-model="withUppercase" label="Uppercase (ABC...)" color="#4CAF50"/> <v-switch v-model="withUppercase" label="Uppercase (ABC...)"/>
</v-col> </v-col>
<v-col lg="6" md="12"> <v-col lg="6" md="12">
<v-switch v-model="withNumbers" label="Numbers (123...)" color="#4CAF50"/> <v-switch v-model="withNumbers" label="Numbers (123...)"/>
<v-switch v-model="withSpecials" label="Specials (#]-...)" color="#4CAF50"/> <v-switch v-model="withSpecials" label="Specials (#]-...)"/>
</v-col> </v-col>
</v-row> </v-row>
<v-slider :label="`Length (${length})`" v-model="length" color="#4CAF50"></v-slider> <v-slider :label="`Length (${length})`" v-model="length" min="1" max="256"></v-slider>
<v-text-field <v-textarea outlined v-model="token"></v-textarea>
outlined
:value="token"
append-icon="fa-refresh"
@click:append="refreshToken()"
append-outer-icon="fa-clipboard"
@click:append-outer="copyToken()"
>
</v-text-field>
<div class="text-center">
<v-btn @click="refreshToken()" depressed class="mr-4">Refresh</v-btn>
<v-btn @click="copyToken()" depressed>Copy token</v-btn>
</div>
</v-card-text> </v-card-text>
</v-card> </v-card>
</template> </template>
@ -83,8 +78,5 @@
</script> </script>
<style > <style >
.v-card {
max-width: 600px;
width: 500px;
}
</style> </style>

View file

@ -11,7 +11,8 @@ Vue.use(Vuetify, {
export default new Vuetify({ export default new Vuetify({
theme: { theme: {
themes: { themes: {
light: { theme: 'dark',
dark: {
primary: '#4CAF50', primary: '#4CAF50',
secondary: '#424242', secondary: '#424242',
accent: '#4CAF50', accent: '#4CAF50',

View file

@ -3,6 +3,7 @@ import VueRouter from 'vue-router'
import Home from './routes/Home.vue' import Home from './routes/Home.vue'
import TokenGenerator from "./components/TokenGenerator"; import TokenGenerator from "./components/TokenGenerator";
import Hash from "./components/Hash"; import Hash from "./components/Hash";
import DateConverter from "./components/DateConverter";
Vue.use(VueRouter) Vue.use(VueRouter)
@ -19,6 +20,10 @@ const routes = [
path: '/hash', path: '/hash',
component: Hash component: Hash
}, },
{
path: '/date-converter',
component: DateConverter
},
{ {
path: '/about', path: '/about',
name: 'About', name: 'About',

View file

@ -1,6 +1,9 @@
<template> <template>
<v-card> <v-card>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium culpa dicta dolores eligendi esse harum illum iusto magnam maxime neque nisi nobis nostrum odit quia quo recusandae, saepe veniam voluptatibus? <v-card-text>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad at cumque dolore dolores, dolorum eius error est eum eveniet hic illum ipsum labore minus odio quibusdam repudiandae sed ullam veritatis!
</v-card-text>
</v-card> </v-card>
</template> </template>