11/*
2+ A simplified version of MojsInteractive that cant be edited,
3+ but has more flexibility regarding the code.
4+
25Usage:
36<MojsCode
47 id="unique_id"
@@ -24,6 +27,7 @@ new mojs.Shape({
2427 <div class =" mojs-interactive__code" >
2528 <slot ></slot >
2629 </div >
30+ <p v-if =" notice" class =" mojs-interactive__clicknotice" >{{this.notice}}</p >
2731 <div :id =" this.id" class =" mojs-interactive__result" :class =" this.className" :style =" style" >
2832 <div v-if =" controller" :id =" this.id + '_controller'" class =" mojs-interactive__controller" ></div >
2933 </div >
@@ -40,6 +44,7 @@ new mojs.Shape({
4044 height: { type: String , default: ' 300px' },
4145 code: { type: [String , Boolean ], default: ' ' },
4246 className: { type: String , default: ' ' },
47+ notice: { type: [String , Boolean ], default: false }, // to show a "click somewhere to activate animation" text
4348 },
4449
4550 computed: {
@@ -73,18 +78,25 @@ new mojs.Shape({
7378 }
7479 </script >
7580
76- <style >
81+ <style lang="stylus" >
7782.mojs-interactive__result {
78- position : relative ;
83+ position : relative
7984}
8085.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
8691}
8792.mojs-interactive__result svg {
8893 overflow : visible
8994}
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+ }
90102 </style >
0 commit comments