Skip to content

Commit

Permalink
Merge pull request #16 from fabd/feature/merge-pr11-new-cursor-and-se…
Browse files Browse the repository at this point in the history
…archbar-by-zapobyte

Feature/merge pr11 new cursor and searchbar by zapobyte
  • Loading branch information
fabd committed Oct 7, 2021
2 parents 87d35f3 + 60c1827 commit 9d6833a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="mr-16">
<runes />
</div>
<div class="flex-1">
<div class="overflow-auto flex-1">
<runewords-table />
</div>
</main>
Expand Down
Binary file added src/assets/images/mouse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions src/assets/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ body {
@apply font-sans;
}

div {
/* stylelint-disable-next-line declaration-no-important */
cursor: url("@/assets/images/mouse.png") 2 2, pointer !important;
}

h1,
h2,
h3,
Expand Down Expand Up @@ -153,6 +158,32 @@ object {
}
}

// --------------------------------------------------------------------
// runeword search box
// --------------------------------------------------------------------
.rw-Search {
label {
color: #a29f9d;
}

&-input {
@apply w-full rounded text-[#444];
padding: 0.5rem;
background: #000;
@apply border border-gold;
@apply text-gold-light;
}

&-input:focus {
@apply outline-none;
@apply border-gold-light;
}

&-input::placeholder {
@apply text-[#686047];
}
}

// --------------------------------------------------------------------
// the "Help" toggle
// --------------------------------------------------------------------
Expand Down
28 changes: 21 additions & 7 deletions src/components/RunewordsTable.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<template>
<div class="flex justify-between items-center mb-2">
<h2 class="rw-Title-h2 mb-0"
>Runewords<span v-if="availableCount">
({{ availableCount }} available)</span
></h2
>
<div class="rw-Search flex items-center mb-4">
<label class="text-gold whitespace-nowrap mr-4">{{ "Search" }}</label>
<input v-model="searchTitle" type="text" class="rw-Search-input" />
</div>

<h2 class="rw-Title-h2 mb-2">
Runewords<span v-if="availableCount">({{ availableCount }} available)</span>
</h2>

<runeword-popup ref="popup" />

<table class="rw-Table w-full">
Expand Down Expand Up @@ -34,7 +35,7 @@
</thead>
<tbody>
<tr
v-for="(item, i) in itemsBySort"
v-for="(item, i) in searchedItems"
:key="i"
class="rw-Table-tr"
:class="cssCompleteRuneword(item)"
Expand Down Expand Up @@ -117,6 +118,8 @@ export default defineComponent({
{ key: "ttypes", label: "Type" },
{ key: "level", label: "Level" },
],
searchTitle: "",
};
},
Expand Down Expand Up @@ -150,6 +153,17 @@ export default defineComponent({
return runewordsData;
},
/** @return {Runeword[]} */
searchedItems() {
const list = this.itemsBySort;
const newList = list.filter((item) => {
return item.title
.toLowerCase()
.includes(this.searchTitle.toLowerCase());
});
return newList;
},
/** @return {Runeword[]} */
itemsBySort() {
const list = this.items.slice();
Expand Down

0 comments on commit 9d6833a

Please sign in to comment.