Skip to content

Commit e6fc803

Browse files
committed
feat: add basic cdn counter example
1 parent f644c8d commit e6fc803

File tree

3 files changed

+95
-0
lines changed

3 files changed

+95
-0
lines changed

demo/caret-down.png

1.4 KB
Loading

demo/caret-up.png

1.34 KB
Loading

demo/counter.html

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Vue.js 3 CDN - Counter Demo</title>
7+
<link
8+
href="https://fonts.googleapis.com/css2?family=Kanit:wght@600&display=swap"
9+
rel="stylesheet"
10+
/>
11+
<style>
12+
body {
13+
background-color: #41b883;
14+
font-family: 'Kanit', sans-serif;
15+
}
16+
17+
.button {
18+
background-color: transparent;
19+
color: #fff;
20+
padding: 1rem;
21+
border: 0;
22+
}
23+
24+
.count-box {
25+
color: white;
26+
font-weight: bold;
27+
font-size: 8rem;
28+
background-color: #34495e;
29+
border-radius: 50px;
30+
width: 200px;
31+
height: 200px;
32+
display: flex;
33+
align-items: center;
34+
justify-content: center;
35+
margin: 3rem 0;
36+
}
37+
38+
.count-box p {
39+
margin: 0;
40+
padding-bottom: 10px;
41+
}
42+
43+
.sr-only {
44+
position: absolute;
45+
width: 1px;
46+
height: 1px;
47+
padding: 0;
48+
margin: -1px;
49+
overflow: hidden;
50+
clip: rect(0, 0, 0, 0);
51+
border: 0;
52+
}
53+
54+
.wrapper {
55+
height: 100vh;
56+
display: flex;
57+
flex-direction: column;
58+
justify-content: center;
59+
align-items: center;
60+
}
61+
</style>
62+
</head>
63+
<body>
64+
<h1 class="sr-only">Vue.js 3 CDN - Counter Demo</h1>
65+
<div class="wrapper" id="app">
66+
<button class="button" @click="incrementCount">
67+
<img src="./caret-up.png" alt="" />
68+
</button>
69+
<div class="count-box">
70+
<p>{{ currentCount }}</p>
71+
</div>
72+
<button class="button" @click="decrementCount">
73+
<img src="./caret-down.png" alt="" />
74+
</button>
75+
</div>
76+
<script src="https://unpkg.com/vue@next"></script>
77+
<script>
78+
const App = {
79+
data: () => ({
80+
currentCount: 0
81+
}),
82+
methods: {
83+
incrementCount() {
84+
this.currentCount += 1
85+
},
86+
decrementCount() {
87+
this.currentCount -= 1
88+
}
89+
}
90+
}
91+
92+
Vue.createApp(App).mount('#app')
93+
</script>
94+
</body>
95+
</html>

0 commit comments

Comments
 (0)