Skip to content

Commit a2f004f

Browse files
committed
updated deps / using vue-mixins/vue
1 parent 3f17ad2 commit a2f004f

File tree

4 files changed

+95
-63
lines changed

4 files changed

+95
-63
lines changed

dev/basic.vue

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
1-
<template lang="jade">
1+
<template lang="pug">
22
.container
33
p
44
a(href="https://github.com/vue-comps/vue-comps-waves/blob/master/dev/basic.vue") source
55
waves
66
button.btn black ripple
7-
waves(color="blue",style="margin-left:20px")
7+
waves(
8+
color="blue"
9+
style="margin-left:20px"
10+
)
811
button.btn blue ripple
912

10-
waves(color="white",style="margin-left:20px")
13+
waves(
14+
color="white"
15+
style="margin-left:20px"
16+
)
1117
button.btn white ripple
1218
br
13-
waves(color="red",style="width:100px;height:100px;background-color:blue")
14-
waves(color="blue",style="margin-left:20px")
19+
waves(
20+
color="red"
21+
style="width:100px;height:100px;background-color:blue"
22+
)
23+
waves(
24+
color="blue"
25+
style="margin-left:20px"
26+
)
1527
div(style="width:100px;height:100px;background-color:red")
1628
</template>
1729

1830
<script lang="coffee">
1931
require "hammer-timejs"
2032
module.exports =
2133
mixins:[
22-
require("vue-mixins/getVue")
34+
require("vue-mixins/vue")
2335
]
2436
beforeCompile: ->
25-
Vue = @getVue()
26-
Vue.use(require('vue-touch'))
37+
@Vue.use(require('vue-touch'))
2738
components:
2839
"waves" : require "../src/waves.vue"
2940

package.json

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,54 +17,39 @@
1717
"node": "*"
1818
},
1919
"dependencies": {
20-
"vue-mixins": "^0.2.6"
21-
},
22-
"peerDependecies": {
23-
"vue-touch": "^1.0.2",
24-
"velocity-animate": "^1.2.3"
20+
"vue-mixins": "^0.2.14"
2521
},
2622
"devDependencies": {
27-
"hammer-timejs": "^1.1.0",
28-
"babel-core": "^6.7.6",
29-
"babel-loader": "^6.2.4",
30-
"babel-plugin-transform-runtime": "^6.7.5",
31-
"babel-preset-es2015": "^6.6.0",
32-
"babel-runtime": "^5.8.34",
3323
"chai": "^3.5.0",
3424
"chai-spies": "^0.7.1",
3525
"coffee-loader": "^0.7.2",
3626
"coffee-script": "^1.10.0",
3727
"css-loader": "^0.23.1",
3828
"gh-pages": "^0.11.0",
39-
"jade": "^1.11.0",
40-
"karma": "^0.13.22",
29+
"hammer-timejs": "^1.1.0",
30+
"karma": "^1.1.2",
4131
"karma-chai": "^0.1.0",
4232
"karma-chai-dom": "^1.1.0",
4333
"karma-chai-spies": "^0.1.4",
44-
"karma-chrome-launcher": "^0.2.3",
45-
"karma-firefox-launcher": "^0.1.7",
46-
"karma-mocha": "^0.2.2",
34+
"karma-chrome-launcher": "^1.0.1",
35+
"karma-firefox-launcher": "^1.0.0",
36+
"karma-mocha": "^1.1.1",
4737
"karma-sourcemap-loader": "^0.3.7",
4838
"karma-spec-reporter": "^0.0.26",
4939
"karma-vue-component": "^0.1.0",
50-
"karma-webpack": "^1.7.0",
51-
"mocha": "^2.4.5",
52-
"parse5": "^2.1.5",
53-
"script-runner": "^0.1.4",
54-
"style-loader": "^0.13.1",
55-
"stylus-loader": "^2.0.0",
40+
"karma-webpack": "^1.8.0",
41+
"mocha": "^3.0.2",
42+
"pug": "^2.0.0-beta5",
43+
"script-runner": "^0.1.5",
5644
"template-html-loader": "0.0.3",
5745
"velocity-animate": "^1.2.3",
58-
"vue": "^1.0.21",
59-
"vue-compiler": "^0.1.1",
46+
"vue": "^1.0.26",
47+
"vue-compiler": "^0.3.0",
6048
"vue-dev-server": "^0.2.10",
61-
"vue-hot-reload-api": "^1.3.2",
62-
"vue-html-loader": "^1.2.2",
63-
"vue-loader": "^8.2.3",
64-
"vue-style-loader": "^1.0.0",
65-
"vue-touch": "^1.0.2",
66-
"vueify-insert-css": "^1.0.0",
67-
"webpack": "^1.13.0"
49+
"vue-html-loader": "^1.2.3",
50+
"vue-loader": "^8.5.3",
51+
"vue-touch": "^1.1.0",
52+
"webpack": "^1.13.1"
6853
},
6954
"keywords": [
7055
"waves",

src/gradient-store-component.vue

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,34 @@
11
// out: ..
2-
<template lang="jade">
3-
svg(xmlns="http://www.w3.org/2000/svg",style="position:absolute;opacity:0;visibility:hidden;pointer-events:none")
2+
<template lang="pug">
3+
svg(
4+
xmlns="http://www.w3.org/2000/svg"
5+
style="position:absolute;opacity:0;visibility:hidden;pointer-events:none")
46
defs
5-
radialGradient(:id="hash" cx="50%" cy="50%" r="75%" v-for="(color,hash) in colors")
6-
stop(offset="0%",style="stop-opacity:0.2;",:style="{stopColor:color}")
7-
stop(offset="40%",style="stop-opacity:0.3;",:style="{stopColor:color}")
8-
stop(offset="50%",style="stop-opacity:0.4;",:style="{stopColor:color}")
9-
stop(offset="60%",style="stop-opacity:0.5;",:style="{stopColor:color}")
10-
stop(offset="70%",style="stop-color:rgb(255,255,255);stop-opacity:0")
7+
radialGradient(
8+
v-bind:id="hash"
9+
cx="50%"
10+
cy="50%"
11+
r="75%"
12+
v-for="(color,hash) in colors")
13+
stop(
14+
offset="0%"
15+
style="stop-opacity:0.2;"
16+
v-bind:style="{stopColor:color}")
17+
stop(
18+
offset="40%"
19+
style="stop-opacity:0.3;"
20+
v-bind:style="{stopColor:color}")
21+
stop(
22+
offset="50%"
23+
style="stop-opacity:0.4;"
24+
v-bind:style="{stopColor:color}")
25+
stop(
26+
offset="60%"
27+
style="stop-opacity:0.5;"
28+
v-bind:style="{stopColor:color}")
29+
stop(
30+
offset="70%"
31+
style="stop-color:rgb(255,255,255);stop-opacity:0")
1132
</template>
1233

1334
<script lang="coffee">

src/waves.vue

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
// out: ..
2-
<template lang="jade">
3-
div(:style="{position:'relative',overflow:'hidden',display:'inline-block',touchAction:'auto'}",v-touch:tap="show",@mouseup="release",@mousedown="show")
4-
div(style="position:absolute;pointer-events:none;transform:translate(-50%,-50%);border-radius:50%;line-height:0",v-el:ripple-div)
2+
<template lang="pug">
3+
div(
4+
v-bind:style="{position:'relative',overflow:'hidden',display:'inline-block',touchAction:'auto'}"
5+
v-touch:tap="show"
6+
@mouseup="release"
7+
@mousedown="show"
8+
)
9+
div(
10+
style="position:absolute;pointer-events:none;transform:translate(-50%,-50%);border-radius:50%;line-height:0"
11+
v-el:ripple-div
12+
)
513
svg(
6-
xmlns="http://www.w3.org/2000/svg",
7-
height=10,
8-
width=10,
14+
xmlns="http://www.w3.org/2000/svg"
15+
height=10
16+
width=10
917
style="position:relative;opacity:0;pointer-events:none;"
1018
)
11-
rect(x="0",y="0",width="100%",height="100%",:fill="gradUrl")
19+
rect(
20+
x="0"
21+
y="0"
22+
width="100%"
23+
height="100%"
24+
v-bind:fill="gradUrl"
25+
)
1226
slot
1327
</template>
1428

@@ -19,7 +33,7 @@ module.exports =
1933
2034
mixins: [
2135
require("vue-mixins/setCss")
22-
require("vue-mixins/getVue")
36+
require("vue-mixins/vue")
2337
]
2438
2539
props:
@@ -30,17 +44,20 @@ module.exports =
3044
type: Number
3145
default: 1
3246
33-
watch:
34-
color: "processColor"
47+
computed:
48+
gradUrl: ->
49+
return null unless @getId?
50+
console.log "test"
51+
return "url(#"+@getId(@color)+")"
52+
3553
3654
data: ->
55+
getId: null
3756
gradUrl: null
3857
ripples: []
3958
debug: ""
4059
4160
methods:
42-
processColor: (val=@color) ->
43-
@gradUrl = "url(#"+@getId(@color)+")"
4461
show: (e) ->
4562
return if e.pointerType == "mouse"
4663
isTouch = e.pointerType? and e.pointerType != "mouse"
@@ -87,8 +104,6 @@ module.exports =
87104
if lastRipple.timeouted
88105
@hide(lastRipple)
89106
90-
compiled: ->
91-
92-
@getId = GradientStore(@getVue()).getId
93-
@processColor()
107+
ready: ->
108+
@getId = GradientStore(@Vue).getId
94109
</script>

0 commit comments

Comments
 (0)