|
1 | 1 | <template> |
2 | 2 | <div><MainHeader></MainHeader></div> |
| 3 | + |
| 4 | + <div :class="$style.container"> |
| 5 | + <div :class="$style.section"> |
| 6 | + <h2 :class="$style.sectionTitle">借りている物品</h2> |
| 7 | + <div :class="$style.scrollContainer"> |
| 8 | + <div |
| 9 | + v-for="(img, index) in borrowedItems" |
| 10 | + :key="index" |
| 11 | + :class="$style.itemCard" |
| 12 | + > |
| 13 | + <img :src="img.src" :alt="img.alt" :class="$style.image" /> |
| 14 | + <div :class="$style.itemName">{{ img.name }}</div> |
| 15 | + </div> |
| 16 | + </div> |
| 17 | + </div> |
| 18 | + |
| 19 | + <div :class="$style.section"> |
| 20 | + <h2 :class="$style.sectionTitle">貸している物品</h2> |
| 21 | + <div :class="$style.scrollContainer"> |
| 22 | + <div |
| 23 | + v-for="(img, index) in lendingItems" |
| 24 | + :key="index" |
| 25 | + :class="$style.itemCard" |
| 26 | + > |
| 27 | + <img :src="img.src" :alt="img.alt" :class="$style.image" /> |
| 28 | + <div :class="$style.itemName">{{ img.name }}</div> |
| 29 | + </div> |
| 30 | + </div> |
| 31 | + </div> |
| 32 | + </div> |
3 | 33 | </template> |
4 | 34 |
|
5 | 35 | <script lang="ts" setup> |
6 | 36 | import MainHeader from '@/shared/lib/components/MainHeader.vue'; |
| 37 | +
|
| 38 | +// APIが完成するまでのダミーデータ |
| 39 | +// publicフォルダの画像を使用 |
| 40 | +const borrowedItems = [ |
| 41 | + { src: '/apple-touch-icon.png', alt: '借りている物品1', name: '物品1' }, |
| 42 | + { src: '/favicon-32x32.png', alt: '借りている物品2', name: '物品2' }, |
| 43 | + { src: '/safari-pinned-tab.svg', alt: '借りている物品3', name: '物品3' }, |
| 44 | + { src: '/favicon-16x16.png', alt: '借りている物品4', name: '物品4' }, |
| 45 | + { src: '/apple-touch-icon.png', alt: '借りている物品5', name: '物品5' }, |
| 46 | +]; |
| 47 | +
|
| 48 | +const lendingItems = [ |
| 49 | + { src: '/favicon-16x16.png', alt: '貸している物品1', name: '物品A' }, |
| 50 | + { src: '/safari-pinned-tab.svg', alt: '貸している物品2', name: '物品B' }, |
| 51 | + { src: '/apple-touch-icon.png', alt: '貸している物品3', name: '物品C' }, |
| 52 | + { src: '/favicon-32x32.png', alt: '貸している物品4', name: '物品D' }, |
| 53 | + { src: '/favicon-16x16.png', alt: '貸している物品5', name: '物品E' }, |
| 54 | +]; |
7 | 55 | </script> |
8 | 56 |
|
9 | | -<style lang="scss" module></style> |
| 57 | +<style lang="scss" module> |
| 58 | +.container { |
| 59 | + max-width: 1200px; |
| 60 | + margin: 0 auto; |
| 61 | + padding: 0 16px; |
| 62 | +} |
| 63 | +
|
| 64 | +.section { |
| 65 | + margin: 20px 0; |
| 66 | + text-align: center; |
| 67 | +} |
| 68 | +
|
| 69 | +.sectionTitle { |
| 70 | + margin-bottom: 16px; |
| 71 | + font-size: 1.5rem; |
| 72 | + text-align: left; |
| 73 | +} |
| 74 | +
|
| 75 | +.scrollContainer { |
| 76 | + display: flex; |
| 77 | + overflow-x: auto; |
| 78 | + gap: 16px; |
| 79 | + padding: 16px 0; |
| 80 | + -webkit-overflow-scrolling: touch; |
| 81 | + scrollbar-width: thin; |
| 82 | +} |
| 83 | +
|
| 84 | +.itemCard { |
| 85 | + flex: 0 0 auto; |
| 86 | + text-align: center; |
| 87 | + border-radius: 8px; |
| 88 | + padding: 8px; |
| 89 | + background-color: $color-background; |
| 90 | + box-shadow: 0 2px 4px $color-background-dim; |
| 91 | +} |
| 92 | +
|
| 93 | +.image { |
| 94 | + width: 160px; |
| 95 | + height: 227px; |
| 96 | + object-fit: contain; |
| 97 | + border-radius: 4px; |
| 98 | +} |
| 99 | +
|
| 100 | +.itemName { |
| 101 | + margin-top: 8px; |
| 102 | + font-size: 14px; |
| 103 | + overflow: hidden; |
| 104 | + text-overflow: ellipsis; |
| 105 | + white-space: nowrap; |
| 106 | +} |
| 107 | +</style> |
0 commit comments