Skip to content

Commit

Permalink
Add Material Design library
Browse files Browse the repository at this point in the history
  • Loading branch information
geraosio committed Jul 9, 2020
1 parent fd410ca commit ede304d
Show file tree
Hide file tree
Showing 9 changed files with 821 additions and 83 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'@typescript-eslint/ban-ts-ignore': 'off'
}
}
622 changes: 618 additions & 4 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"core-js": "^3.6.5",
"material-components-vue": "^1.2.0",
"register-service-worker": "^1.7.1",
"vue": "^2.6.11",
"vue-class-component": "^7.2.3",
Expand Down
36 changes: 15 additions & 21 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
<template>
<div id="app">
<div id="nav">
<m-theme>
<!-- <div class="nav">
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</div>
<router-view/>
</div> -->
<router-view/>
</m-theme>
</div>
</template>

<style lang="scss">
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
<script lang="ts">
import { Vue } from 'vue-property-decorator'
// @ts-ignore
import Theme from 'material-components-vue/dist/theme'
#nav {
padding: 30px;
Vue.use(Theme)
a {
font-weight: bold;
color: #2c3e50;
export default { }
</script>

&.router-link-exact-active {
color: #42b983;
}
}
}
<style lang="scss">
@import "@/styles/styles";
</style>
44 changes: 0 additions & 44 deletions src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,6 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-typescript" target="_blank" rel="noopener">typescript</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa" target="_blank" rel="noopener">pwa</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>

Expand All @@ -45,18 +15,4 @@ export default class HelloWorld extends Vue {

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
26 changes: 26 additions & 0 deletions src/styles/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@import url("https://fonts.googleapis.com/css?family=Roboto:300,400,500");
@import url("https://fonts.googleapis.com/icon?family=Material+Icons");

$mdc-theme-primary: #2196f3;
$mdc-theme-secondary: #ff1744;
$mdc-theme-background: #f5f5f5;
@import "material-components-vue/dist/theme/styles";

#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.nav {
padding: 30px;

a {
font-weight: bold;
color: #2c3e50;

&.router-link-exact-active {
color: #42b983;
}
}
}
2 changes: 1 addition & 1 deletion src/views/About.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="about">
<h1>This is an about page</h1>
<p>This is the about page</p>
</div>
</template>
157 changes: 145 additions & 12 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,151 @@
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
</div>
<m-typography class="home">
<m-typo-headline :level="2">
Sistema ANDON
</m-typo-headline>
<div class="selection">
<m-select v-model="plant" id="select-plant" enhanced>
<template slot="default">
<m-list-item data-value="planta1">Planta 1</m-list-item>
<m-list-item data-value="planta2">Planta 2</m-list-item>
<m-list-item data-value="planta3">Planta 3</m-list-item>
</template>
<m-floating-label for="select-plant" id="select-plant--label" slot="label">Planta</m-floating-label>
<m-line-ripple slot="line"/>
</m-select>
<m-select v-model="machine" id="select-machine" enhanced>
<template slot="default">
<m-list-item data-value="machine1">Maquina 1</m-list-item>
<m-list-item data-value="machine2">Maquina 2</m-list-item>
<m-list-item data-value="machine3">Maquina 3</m-list-item>
</template>
<m-floating-label for="select-machine" id="select-machine--label" slot="label">Máquina</m-floating-label>
<m-line-ripple slot="line"/>
</m-select>
<m-text-field v-model="message" id="select--message" outlined>
<m-floating-label for="select--message">Mensaje</m-floating-label>
</m-text-field>
</div>
<div class="area">
<m-card class="area--card card">
<m-icon-button icon="group_work"></m-icon-button>
<m-typo-headline :level="6">HSE</m-typo-headline>
</m-card>
<m-card class="area--card card">
<m-icon-button icon="supervisor_account"></m-icon-button>
<m-typo-headline :level="6">Operaciones</m-typo-headline>
</m-card>
<m-card class="area--card card">
<m-icon-button icon="build"></m-icon-button>
<m-typo-headline :level="6">Herramentales</m-typo-headline>
</m-card>
<m-card class="area--card card">
<m-icon-button icon="construction"></m-icon-button>
<m-typo-headline :level="6">Mantenimiento</m-typo-headline>
</m-card>
<m-card class="area--card card">
<m-icon-button icon="local_police"></m-icon-button>
<m-typo-headline :level="6">Calidad</m-typo-headline>
</m-card>
</div>
</m-typography>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
export default {
name: 'Home',
components: {
HelloWorld
}
// @ts-ignore
import Typography from 'material-components-vue/dist/typography'
// @ts-ignore
import Select from 'material-components-vue/dist/select'
// @ts-ignore
import List from 'material-components-vue/dist/list'
// @ts-ignore
import TextField from 'material-components-vue/dist/text-field'
// @ts-ignore
import Card from 'material-components-vue/dist/card'
// @ts-ignore
import IconButton from 'material-components-vue/dist/icon-button'
// @ts-ignore
import FloatingLabel from 'material-components-vue/dist/floating-label'
// @ts-ignore
import LineRipple from 'material-components-vue/dist/line-ripple'
Vue.use(Typography)
Vue.use(Select)
Vue.use(List)
Vue.use(TextField)
Vue.use(Card)
Vue.use(IconButton)
Vue.use(FloatingLabel)
Vue.use(LineRipple)
@Component
export default class Home extends Vue {
private plant = ''
private machine = ''
private message = ''
private hseToggle = false
}
</script>

<style lang="scss">
@import "material-components-vue/dist/typography/styles";
@import "material-components-vue/dist/select/styles";
@import "material-components-vue/dist/list/styles";
@import "material-components-vue/dist/text-field/styles";
@import "material-components-vue/dist/card/styles";
@import "material-components-vue/dist/icon-button/styles";
@import "material-components-vue/dist/floating-label/styles";
@import "material-components-vue/dist/line-ripple/styles";
.selection {
margin-top: 36px;
display: flex;
flex-direction: row;
width: 100%;
flex-wrap: wrap;
> * {
margin-right: 8px;
margin-bottom: 8px;
flex-grow: 1;
}
> :last-child {
flex-grow: 2;
}
}
.area {
margin-top: 24px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-evenly;
> * {
margin-right: 8px;
margin-bottom: 8px;
}
.card {
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
padding: 8px;
}
.mdc-icon-button {
$icon-size: 72px;
$area-size: calc(#{$icon-size} * 2);
width: $area-size;
height: $area-size;
font-size: $icon-size;
color: $mdc-theme-primary;
}
}
</style>
13 changes: 13 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
css: {
loaderOptions: {
sass: {
sassOptions: {
includePaths: [
"./node_modules"
]
}
}
}
}
};

0 comments on commit ede304d

Please sign in to comment.