1
1
/*
2
+ A simplified version of MojsInteractive that cant be edited,
3
+ but has more flexibility regarding the code.
4
+
2
5
Usage:
3
6
<MojsCode
4
7
id="unique_id"
@@ -24,6 +27,7 @@ new mojs.Shape({
24
27
<div class =" mojs-interactive__code" >
25
28
<slot ></slot >
26
29
</div >
30
+ <p v-if =" notice" class =" mojs-interactive__clicknotice" >{{this.notice}}</p >
27
31
<div :id =" this.id" class =" mojs-interactive__result" :class =" this.className" :style =" style" >
28
32
<div v-if =" controller" :id =" this.id + '_controller'" class =" mojs-interactive__controller" ></div >
29
33
</div >
@@ -40,6 +44,7 @@ new mojs.Shape({
40
44
height: { type: String , default: ' 300px' },
41
45
code: { type: [String , Boolean ], default: ' ' },
42
46
className: { type: String , default: ' ' },
47
+ notice: { type: [String , Boolean ], default: false }, // to show a "click somewhere to activate animation" text
43
48
},
44
49
45
50
computed: {
@@ -73,18 +78,25 @@ new mojs.Shape({
73
78
}
74
79
</script >
75
80
76
- <style >
81
+ <style lang="stylus" >
77
82
.mojs-interactive__result {
78
- position : relative ;
83
+ position : relative
79
84
}
80
85
.mojs-interactive__result {
81
- background : #f1e2d7 ;
82
- width : 100% ;
83
- height : 400px ;
84
- position : relative ;
85
- overflow : hidden ;
86
+ background : #f1 e2 d7
87
+ width : 100%
88
+ height : 400px
89
+ position : relative
90
+ overflow : hidden
86
91
}
87
92
.mojs-interactive__result svg {
88
93
overflow : visible
89
94
}
95
+ .mojs-interactive__clicknotice {
96
+ font-size : 0.85em
97
+ color : $c-white
98
+ background : $c-purple-light
99
+ padding : $s-small $s-large
100
+ margin : 0
101
+ }
90
102
</style >
0 commit comments