aboutsummaryrefslogtreecommitdiff
path: root/src/components/RightPanel.svelte
blob: 5ede942daf6e70666e05e1389dae18c9ff306401 (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<script lang="ts">

import CardThumb from './CardThumb.svelte';

let cardList = $state([]);

</script>

<div class="right-panel">
    <div class="search-bar">
        <input type="text" placeholder="搜索卡牌...">
    </div>
    <div class="card-list">
        {#if cardList.length > 0}
            <div class="card-item">
                {#each cardList as card}
                    <div class="card-thumbnail">
                        <CardThumb id= {card.id} />
                    </div>
                    <span>{card.name}</span>
                {/each}
            </div>
        {/if}
    </div>
    <div class="pagination">
        <button class="page-btn">上一页</button>
        <button class="page-btn">下一页</button>
    </div>
</div>


<style>

.right-panel {
    width: 20%;
    padding: 20px;
    background-color: #f8f8f8;
    display: flex;
    flex-direction: column;
}

.search-bar input {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.card-list {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

.card-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
}

.pagination {
    display: flex;
    gap: 10px;
}

.page-btn {
    flex: 1;
    padding: 8px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.card-thumbnail {
    width: 50px;
    height: 70px;
    background-color: #eee;
    margin-right: 10px;
    border-radius: 3px;
}

</style>