|
1 | 1 | <script setup lang="ts"> |
| 2 | +import { Button, Card, Divider, Input, Select } from '@dolanske/vui' |
2 | 3 |
|
| 4 | +const search = ref('') |
| 5 | +
|
| 6 | +const gameOptions = [{ label: 'Minecraft', value: 0 }, { label: 'GMod', value: 1 }, { label: 'Counter Strike Source', value: 3 }] |
| 7 | +const game = ref() |
| 8 | +
|
| 9 | +function clearFilters() { |
| 10 | + game.value = undefined |
| 11 | + search.value = '' |
| 12 | +} |
3 | 13 | </script> |
4 | 14 |
|
5 | 15 | <template> |
6 | | - <div>Gameservers</div> |
| 16 | + <div class="container gameservers-page"> |
| 17 | + <h3>Game servers</h3> |
| 18 | + <Divider /> |
| 19 | + <div class="flex g-s y-center x-start mb-l"> |
| 20 | + <Input v-model="search" placeholder="Search servers"> |
| 21 | + <template #start> |
| 22 | + <Icon name="ph:magnifying-glass" /> |
| 23 | + </template> |
| 24 | + </Input> |
| 25 | + <Select v-model="game" :options="gameOptions" placeholder="Select game" /> |
| 26 | + <Button v-if="game || search" plain outline @click="clearFilters"> |
| 27 | + Clear |
| 28 | + </Button> |
| 29 | + </div> |
| 30 | + <div class="gameservers-wrap"> |
| 31 | + <div> |
| 32 | + <div class="grid col-2 g-m"> |
| 33 | + <Card v-for="item in 12" :key="item"> |
| 34 | + <template #header> |
| 35 | + Server {{ item }} |
| 36 | + </template> |
| 37 | + <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Atque, illum. Perspiciatis dolorum a non aliquam numquam eveniet in cum similique qui dicta voluptas, hic accusantium aut soluta, architecto saepe fugit?</p> |
| 38 | + </Card> |
| 39 | + </div> |
| 40 | + </div> |
| 41 | + |
| 42 | + <div> |
| 43 | + <strong class="flex g-s y-center mb-xs"> |
| 44 | + GMOD |
| 45 | + <div class="counter">3</div> |
| 46 | + </strong> |
| 47 | + <ul class="game-server-list"> |
| 48 | + <li class="game-server-item"> |
| 49 | + <div class="game-server-indicator online" /> |
| 50 | + <span class="flex-1">Prop hunt</span> |
| 51 | + <Button size="s"> |
| 52 | + Join |
| 53 | + </Button> |
| 54 | + </li> |
| 55 | + <li class="game-server-item"> |
| 56 | + <div class="game-server-indicator online" /> |
| 57 | + <span class="flex-1">TTT #1</span> |
| 58 | + <Button size="s"> |
| 59 | + Join |
| 60 | + </Button> |
| 61 | + </li> |
| 62 | + <li class="game-server-item"> |
| 63 | + <div class="game-server-indicator offline" /> |
| 64 | + <span class="flex-1">Deathrun</span> |
| 65 | + </li> |
| 66 | + </ul> |
| 67 | + <Divider margin="16px 0" /> |
| 68 | + <strong class="flex g-s y-center mb-xs"> |
| 69 | + CS Source |
| 70 | + <div class="counter">1</div> |
| 71 | + </strong> |
| 72 | + <ul class="game-server-list"> |
| 73 | + <li class="game-server-item"> |
| 74 | + <div class="game-server-indicator online" /> |
| 75 | + <span class="flex-1">Server #1</span> |
| 76 | + <Button size="s"> |
| 77 | + Join |
| 78 | + </Button> |
| 79 | + </li> |
| 80 | + </ul> |
| 81 | + </div> |
| 82 | + </div> |
| 83 | + </div> |
7 | 84 | </template> |
| 85 | + |
| 86 | +<style lang="scss"> |
| 87 | +.gameservers-page { |
| 88 | + padding-block: 6.5rem; |
| 89 | +} |
| 90 | +
|
| 91 | +.gameservers-wrap { |
| 92 | + display: grid; |
| 93 | + grid-template-columns: 1fr 300px; |
| 94 | + gap: 64px; |
| 95 | +} |
| 96 | +
|
| 97 | +.vui-card { |
| 98 | + --color-bg: white; |
| 99 | +} |
| 100 | +
|
| 101 | +:root.dark .vui-card { |
| 102 | + --color-bg: var(--color-bg-medium); |
| 103 | +} |
| 104 | +
|
| 105 | +.game-server-list { |
| 106 | + display: flex; |
| 107 | + flex-direction: column; |
| 108 | + gap: var(--space-xs); |
| 109 | + padding-left: var(--space-m); |
| 110 | +} |
| 111 | +
|
| 112 | +.game-server-item { |
| 113 | + display: flex; |
| 114 | + align-items: center; |
| 115 | + gap: var(--space-s); |
| 116 | + height: 28px; |
| 117 | +
|
| 118 | + // .vui-button { |
| 119 | + // visibility: hidden; |
| 120 | + // } |
| 121 | +
|
| 122 | + // &:hover { |
| 123 | + // .vui-button { |
| 124 | + // visibility: visible; |
| 125 | + // } |
| 126 | + // } |
| 127 | +} |
| 128 | +
|
| 129 | +.game-server-indicator { |
| 130 | + width: 10px; |
| 131 | + height: 10px; |
| 132 | + border-radius: 99px; |
| 133 | +
|
| 134 | + &.online { |
| 135 | + background-color: var(--color-text-green); |
| 136 | + } |
| 137 | +
|
| 138 | + &.offline { |
| 139 | + background-color: var(--color-text-red); |
| 140 | + } |
| 141 | +} |
| 142 | +</style> |
0 commit comments