-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
51 lines (49 loc) · 1.23 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!doctype html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<style type="text/css">
.container {
padding-top: 200px;
}
#alien {
font-size: 5em;
}
#sparkle-btn {
width: 200px;
}
</style>
</head>
<body>
<div id="app" class="container">
<div class="row">
<span class="col-sm-offset-5 col-sm-2" id="alien"> {{ message }}
<span v-if="seen">{{ sparkles }}</span>
</span>
</div>
<div class="row">
<button @click="addSparkles" id="sparkle-btn" class="btn btn-default col-sm-offset-5">{{ buttonLabel }}</button>
</div>
</div>
<script src="https://unpkg.com/vue"></script>
<script type="text/javascript">
var app = new Vue({
el: '#app',
data: {
message: "👽",
sparkles: "✨",
seen: false,
buttonLabel: "Add Sparkles"
},
methods: {
addSparkles: function() {
this.seen == true ? this.seen = false : this.seen = true;
this.seen == true ? this.buttonLabel = "No Sparkles!" : this.buttonLabel = "Add Sparkles";
}
}
})
</script>
</body>
</html>