1
+ <!DOCTYPE html>
1
2
< html lang ="en ">
2
3
3
4
< head >
9
10
< link href ="https://fonts.googleapis.com/css?family=Frijole " rel ="stylesheet ">
10
11
</ head >
11
12
13
+ <!-- Instructions -->
14
+ <!-- 1. Replace 'Static' with the data property `noun` -->
15
+ <!-- 2. Wire up `input#noun` to dynamically update `noun` when you type in it -->
16
+ <!-- 3. Use dynamic inline-styles to define a `backgroundImage` on `div#image-wrapper` that uses the data property `imageUrl` -->
17
+ <!-- 4. Wire up `input#background-image` to dynamically update the data property `imageUrl` -->
18
+ <!-- 5. Toggle `aside#side-menu` visibility when you click on `button#toggle-menu` -->
19
+ <!-- 6. Challenge: Write a method that updates `div#template-wrapper` position when you click on `div#image-wrapper` -->
20
+
12
21
< body >
13
- < div class ="app-wrapper ">
14
- < div id ="image-wrapper " class ="image-wrapper " style =" background-image: url('https://vignette.wikia.nocookie.net/clubpenguin/images/7/71/Pickle.png/revision/latest?cb=20140205184407') " >
22
+ < div id =" app " class ="app-wrapper ">
23
+ < div id ="image-wrapper " class ="image-wrapper ">
15
24
< div class ="template-wrapper " id ="template-wrapper ">
16
25
< div class ="speech-bubble ">
17
- < p > I'm Pickle Rick!</ p >
26
+ < p > I'm Static Rick!</ p >
18
27
</ div >
19
28
< img class ="rick-face " src ="https://s3-us-west-2.amazonaws.com/s.cdpn.io/262582/PickleRickFace.svg " alt ="Rick Face Template ">
20
29
</ div >
21
30
</ div >
22
- < button id ="toggle-menu " class ="toggle-menu "> Toggle Menu</ button >
31
+ < button id ="toggle-menu " class ="toggle-menu " @click =" showMenu = !showMenu " > Toggle Menu</ button >
23
32
24
- < aside id ="side-menu " class ="side-menu ">
33
+ < aside v-if =" showMenu " id ="side-menu " class ="side-menu ">
25
34
< form class ="side-menu__form ">
26
35
< label for ="noun "> Noun</ label >
27
- < input type ="text " id ="noun " />
36
+ < input type ="text " id ="noun " v-model =" noun " />
28
37
< label for ="background-image "> Background Image</ label >
29
- < input type ="text " id ="background-image " />
38
+ < input type ="text " id ="background-image " v-model =" imageUrl " />
30
39
</ form >
31
40
</ aside >
32
41
</ div >
33
42
34
43
< script src ="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.3/vue.min.js "> </ script >
44
+ < script >
45
+ const app = new Vue ( {
46
+ el : '#app' ,
47
+ data : {
48
+ noun : 'Pickle' ,
49
+ showMenu : true ,
50
+ imageUrl : 'https://vignette.wikia.nocookie.net/clubpenguin/images/7/71/Pickle.png/revision/latest?cb=20140205184407'
51
+ } ,
52
+ methods : { }
53
+ } )
54
+ </ script >
35
55
</ body >
36
56
37
57
</ html >
0 commit comments