Skip to content

Commit

Permalink
introducing store
Browse files Browse the repository at this point in the history
  • Loading branch information
Abeyy committed Aug 26, 2018
1 parent 1c9884d commit 494627e
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>enterthecosmos</title>
</head>
<body>
<body style="margin:0px;">
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"dependencies": {
"cosmicjs": "^3.2.12",
"vue": "^2.5.2"
"vue": "^2.5.2",
"vuex": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
Expand Down
2 changes: 0 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<div id="app">
<img src="./assets/logo.png">
<HelloWorld/>
</div>
</template>
Expand All @@ -25,6 +24,5 @@ export default {
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
Binary file added src/assets/homeScreenTitleImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 47 additions & 2 deletions src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
<template>
<div>
<div class="homeScreen" :style="`background-image:url(${(homeScreenImage)});`">
<div class="homeScreenTitle">
<!-- <img :src="`${homeScreenTitleImage}`"> -->
<img src="../assets/homeScreenTitleImage.png" >
</div>

<div class="homeScreenOptions">
<div class="homeScreenOption">
Play Game
</div>

<div class="homeScreenOption">
How To Play {{abey}}
</div>
</div>
</div>
</template>

Expand All @@ -20,7 +34,11 @@ const api = Cosmic()
mounted() {
this.getResObject()
},
computed: {},
computed: {
abey() {
return this.$store.state.abey
}
},
methods: {
async getResObject() {
const slug = 'home'
Expand Down Expand Up @@ -62,5 +80,32 @@ const api = Cosmic()
</script>

<style scoped>
.homeScreen {
height: 100vh;
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed!important;
overflow:hidden;
text-align: center;
}
.homeScreenTitle {
margin-top: 75px;
}
.homeScreenOptions {
margin: 45px auto 0 auto;
width: 30%;
}
.homeScreenOption {
border: 2px solid #92ced6;
color: #92ced6;
padding: 10px;
font-size: 18px;
font-weight: 800;
text-transform: uppercase;
margin: 25px;
}
</style>
5 changes: 4 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import Vuex from 'vuex'
import App from './App'
import Store from './store/index.js'

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
el: '#app',
components: { App },
template: '<App/>'
template: '<App/>',
store: Store
})
17 changes: 17 additions & 0 deletions src/store/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

const store = new Vuex.Store({
state: {
abey: '5'
},
getters: {

},
mutations: {

}
})

export default store

0 comments on commit 494627e

Please sign in to comment.