|
1 | 1 | <template> |
2 | 2 | <div class="container"> |
3 | 3 | <div> |
4 | | - <p class="background"> |
5 | | - <img src="~assets/image/main-logo-white.png"> |
6 | | - <h1> |
7 | | - 今日のあなたはどのお酒? |
8 | | - </h1> |
9 | | - </p> |
10 | | - <button @click=""><img src="~assets/image/drink_beer.png" width="100" height="100">ビール</button> |
11 | | - <button @click=""><img src="~assets/image/drink_nihonsyu.png" width="100" height="100">日本酒</button> |
12 | | - <button @click=""><img src="~assets/image/party_highball_glass.png" width="100" height="100">ハイボール</button><br> |
13 | | - <button @click=""><img src="~assets/image/red_wine.png" width="100" height="100">赤ワイン</button> |
14 | | - <button @click=""><img src="~assets/image/white_wine.png" width="100" height="100">白ワイン</button> |
15 | | - <button @click=""><img src="~assets/image/drink_cocktail.png" width="100" height="100">カクテル</button> |
| 4 | + <img src="~assets/image/main-logo-white.png" /> |
| 5 | + <h1>今日のあなたはどのお酒?</h1> |
| 6 | + <ul v-for="alchole in alcoholicBeverages" :key="alchole.id"> |
| 7 | + <li> |
| 8 | + <img :src="alchole.image" @click="redirectSwipe(alchole)" width="100" height="100" /> |
| 9 | + </li> |
| 10 | + </ul> |
16 | 11 | </div> |
17 | 12 | </div> |
18 | 13 | </template> |
19 | 14 |
|
20 | 15 | <script> |
21 | | -export default {} |
| 16 | +export default { |
| 17 | + data() { |
| 18 | + return { |
| 19 | + alcoholicBeverages: [], |
| 20 | + } |
| 21 | + }, |
| 22 | + created() { |
| 23 | + this.alcoholicBeverages = this.fetchAlcoholicBeverages(); |
| 24 | + }, |
| 25 | + methods: { |
| 26 | + fetchAlcoholicBeverages() { |
| 27 | + // APIを叩く |
| 28 | + // バックエンドは実装中のためとりあえずダミーデータ |
| 29 | + return [ |
| 30 | + { |
| 31 | + id: 1, |
| 32 | + name: "白ワイン", |
| 33 | + image: require("~/assets/image/white_wine.png"), |
| 34 | + }, |
| 35 | + { |
| 36 | + id: 2, |
| 37 | + name: "ビール", |
| 38 | + image: require("~/assets/image/drink_beer.png"), |
| 39 | + }, |
| 40 | + { |
| 41 | + id: 3, |
| 42 | + name: "日本酒", |
| 43 | + image: require("~/assets/image/drink_nihonsyu.png"), |
| 44 | + }, |
| 45 | + { |
| 46 | + id: 4, |
| 47 | + name: "カクテル", |
| 48 | + image: require("~/assets/image/drink_cocktail.png"), |
| 49 | + }, |
| 50 | + { |
| 51 | + id: 5, |
| 52 | + name: "赤ワイン", |
| 53 | + image: require("~/assets/image/red_wine.png"), |
| 54 | + }, |
| 55 | + { |
| 56 | + id: 6, |
| 57 | + name: "ハイボール", |
| 58 | + image: require("~/assets/image/party_highball_glass.png"), |
| 59 | + } |
| 60 | + ]; |
| 61 | + }, |
| 62 | + redirectSwipe(alchole) { |
| 63 | + // 遷移先にalchole情報も渡す |
| 64 | + this.$router.push("/swipe"); |
| 65 | + }, |
| 66 | + } |
| 67 | +} |
22 | 68 | </script> |
23 | 69 |
|
24 | 70 | <style> |
25 | | -/* Sample `apply` at-rules with Tailwind CSS |
26 | | -.container { |
27 | | -@apply min-h-screen flex justify-center items-center text-center mx-auto; |
28 | | -} |
29 | | -*/ |
30 | | -.container { |
31 | | - margin: 0 auto; |
32 | | - min-height: 100vh; |
33 | | - display: flex; |
34 | | - justify-content: center; |
35 | | - align-items: center; |
36 | | - text-align: center; |
37 | | -} |
38 | | -
|
39 | | -.title { |
40 | | - font-family: |
41 | | - 'Quicksand', |
42 | | - 'Source Sans Pro', |
43 | | - -apple-system, |
44 | | - BlinkMacSystemFont, |
45 | | - 'Segoe UI', |
46 | | - Roboto, |
47 | | - 'Helvetica Neue', |
48 | | - Arial, |
49 | | - sans-serif; |
50 | | - display: block; |
51 | | - font-weight: 300; |
52 | | - font-size: 100px; |
53 | | - color: #35495e; |
54 | | - letter-spacing: 1px; |
55 | | -} |
56 | | -
|
57 | | -.subtitle { |
58 | | - font-weight: 300; |
59 | | - font-size: 42px; |
60 | | - color: #526488; |
61 | | - word-spacing: 5px; |
62 | | - padding-bottom: 15px; |
63 | | -} |
64 | | -
|
65 | | -.links { |
66 | | - padding-top: 15px; |
67 | | -} |
68 | | -
|
69 | | -.background { |
70 | | - background-color: #ef93b6 |
71 | | -} |
72 | 71 | </style> |
0 commit comments