-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Ade94/workingcard
card
- Loading branch information
Showing
10 changed files
with
147 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
module.exports = { | ||
presets: [ | ||
'@vue/cli-plugin-babel/preset' | ||
] | ||
} | ||
"presets": [ | ||
["@babel/preset-env", { | ||
"modules": false | ||
}] | ||
], | ||
"env": { | ||
"test": { | ||
"presets": [ | ||
["@babel/preset-env", { | ||
"targets": { | ||
"browsers": ["last 2 versions", "safari >= 7"], | ||
node: 'current' | ||
} | ||
}] | ||
], | ||
"plugins": ["@babel/plugin-transform-runtime"] | ||
} | ||
}, | ||
"plugins": ["@babel/plugin-syntax-dynamic-import", "transform-dynamic-import"] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<template> | ||
<div | ||
class="card" | ||
:style="{'margin-bottom':setMargin}" | ||
> | ||
<div class="card__status"></div> | ||
Testings | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
props: { | ||
position: { | ||
type: Number, | ||
required: false, | ||
default: 0 | ||
} | ||
}, | ||
computed: { | ||
setMargin() { | ||
const marg = this.position * 210 | ||
return this.position > 0 ? marg + 'px' : '0px' | ||
} | ||
}, | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.card { | ||
width: 500px; | ||
height: 200px; | ||
position: absolute; | ||
bottom: 10px; | ||
right: 10px; | ||
box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.07); | ||
background-color: white; | ||
} | ||
.card__status { | ||
background-color: green; | ||
width: 95%; | ||
height: 10px; | ||
border-radius: 20px; | ||
} | ||
</style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<template> | ||
<div> | ||
<Card | ||
v-for="(whooshes,index) in whooshList" | ||
:key="index" | ||
:position="index" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Card from './Card' | ||
import { events } from './events.js' | ||
export default { | ||
name: 'Whoosh', | ||
components: { Card }, | ||
data() { | ||
return { | ||
show: false, | ||
whooshList: [] | ||
} | ||
}, | ||
mounted() { | ||
console.log("Mounted Whoosh") | ||
events.$on('startWhoosh', this.makeAWhooshList); | ||
}, | ||
methods: { | ||
makeAWhooshList(event) { | ||
this.whooshList.push(event) | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Vue from 'vue' | ||
|
||
export const events = new Vue({ | ||
name: 'Whoosh' | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,32 @@ | ||
import Vue from 'vue' | ||
//import Vue from 'vue' | ||
import ButtonField from './ButtonField' | ||
import Whoosh from './Whoosh' | ||
import Whoosh from './Whoosh/Whoosh' | ||
import { | ||
events | ||
} from './Whoosh/events' | ||
//const myWhoosh = new(Vue.extend(Whoosh)); | ||
|
||
const myWhoosh = new (Vue.extend(Whoosh)); | ||
const WhooshOn = { | ||
install(Vue, args = {}) { | ||
console.log('Installed') | ||
this.params = args | ||
|
||
export default function install (Vue) { | ||
Vue.component('ButtonField',ButtonField) | ||
Vue.component('ButtonField', ButtonField) | ||
Vue.component('Whoosh', Whoosh) | ||
|
||
//Vue.prototype.$whoosh = (name, age) => info(name, age) | ||
|
||
Vue.prototype.$whoosh = { | ||
success(message){ | ||
myWhoosh.success(message) | ||
}, | ||
error(message){ | ||
myWhoosh.success(message) | ||
} | ||
} | ||
|
||
Vue.prototype.$whoosh = (params) => { | ||
events.$emit('startWhoosh', params) | ||
} | ||
} | ||
} | ||
|
||
export { | ||
ButtonField | ||
} | ||
if (typeof window !== 'undefined' && window.Vue) { | ||
window.Vue.use(WhooshOn) | ||
} | ||
|
||
export default WhooshOn | ||
export { | ||
ButtonField, | ||
Whoosh | ||
} |