Skip to content

Commit

Permalink
refactor: use UIcon replace span icon
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Aug 12, 2024
1 parent 2af73fc commit dade09c
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 33 deletions.
10 changes: 8 additions & 2 deletions apps/client/components/Landing/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@
<div
class="absolute flex translate-x-0 items-center justify-center text-purple-600 opacity-100 transition group-hover:-translate-x-6 group-hover:opacity-0"
>
<span class="i-ph-star-fill h-5 w-5"></span>
<UIcon
name="i-ph-star-fill"
class="h-5 w-5"
></UIcon>
</div>
<span
class="bg-gradient-to-r from-purple-600 to-gray-300 bg-clip-text pl-6 font-medium text-transparent"
Expand All @@ -65,7 +68,10 @@
<div
class="absolute right-0 flex translate-x-12 items-center justify-center text-purple-400 opacity-0 transition group-hover:translate-x-6 group-hover:opacity-100"
>
<span class="i-ph-arrow-right h-5 w-5"></span>
<UIcon
name="i-ph-arrow-right"
class="h-5 w-5"
></UIcon>
</div>
</div>
</a>
Expand Down
12 changes: 8 additions & 4 deletions apps/client/components/Landing/Comments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
{{ "@" + item.account }}
</p>
</div>
<span class="i-simple-icons-twitter h-6 w-6 self-start text-[#03a9f4]"></span>
<UIcon
name="i-simple-icons-twitter"
class="h-6 w-6 self-start text-[#03a9f4]"
></UIcon>
</div>
<p class="mt-4 text-sm text-gray-700 dark:text-gray-300 lg:text-base">
{{ item.chinese }}
Expand All @@ -42,9 +45,10 @@
<div class="mx-auto my-4"></div>
<div class="mt-4 flex items-center justify-between text-xs">
<div class="flex items-center">
<span
class="i-ph-heart-straight-fill mr-2 h-5 w-5 fill-current text-pink-300 dark:text-blue-300"
></span>
<UIcon
name="i-ph-heart-straight-fill"
class="mr-2 h-5 w-5 fill-current text-pink-300 dark:text-blue-300"
></UIcon>
<span class="text-gray-500 dark:text-gray-400">{{ item.likeCount }} likes</span>
</div>
<a
Expand Down
17 changes: 12 additions & 5 deletions apps/client/components/Landing/Contact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
target="_blank"
>
<span class="sr-only">Twitter</span>
<span class="icon-link icon-link-gray i-simple-icons-x"></span>
<UIcon
name="i-simple-icons-x"
class="icon-link icon-link-gray"
></UIcon>
</a>
</li>
<li>
Expand All @@ -39,8 +42,10 @@
rel="noreferrer"
target="_blank"
>
<span class="sr-only">Telegram</span>
<span class="icon-link icon-link-gray i-simple-icons-telegram"></span>
<UIcon
name="i-simple-icons-telegram"
class="icon-link icon-link-gray"
></UIcon>
</a>
</li>
<li>
Expand All @@ -49,8 +54,10 @@
rel="noreferrer"
target="_blank"
>
<span class="sr-only">GitHub</span>
<span class="icon-link icon-link-gray i-simple-icons-github"></span>
<UIcon
name="i-simple-icons-github"
class="icon-link icon-link-gray"
></UIcon>
</a>
</li>
</ul>
Expand Down
12 changes: 8 additions & 4 deletions apps/client/components/Landing/PayCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
class="button-unlock"
v-if="feature.type === '终身付费'"
>
<span class="crown i-ph-crown-simple-fill h-6 w-6 text-[#f09f33]"></span>
<UIcon
name="i-ph-crown-simple-fill"
class="crown h-6 w-6 text-[#f09f33]"
></UIcon>
解锁 Pro
</button>

Expand Down Expand Up @@ -72,10 +75,11 @@
:key="`feature-${index}-item-${itemIndex}`"
class="mb-6 mt-6 flex items-center"
>
<span
class="i-ph-check-bold mr-2 h-5 w-5"
<UIcon
name="i-ph-check-bold"
class="mr-2 h-5 w-5"
:class="item.unique ? 'text-green-500' : 'text-gray-500'"
></span>
></UIcon>
{{ item.text }}
</li>
</ul>
Expand Down
5 changes: 4 additions & 1 deletion apps/client/components/Landing/Questions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
<h2 class="text-base font-medium text-black dark:text-gray-300 lg:text-lg">
{{ qsItem.title }}
</h2>
<span class="icon i-ph-caret-right-bold h-6 w-6"></span>
<UIcon
name="i-ph-caret-right-bold"
class="icon h-6 w-6"
></UIcon>
</summary>
<div
class="transition-max-height mb-4 overflow-hidden duration-500 ease-in-out dark:text-gray-500"
Expand Down
7 changes: 4 additions & 3 deletions apps/client/components/common/BackTop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
:data-content="route.path === '/' ? 'Back to Top' : 'Go to Home'"
@click="scrollToTop"
>
<span
class="svgIcon i-ph-arrow-up-bold h-5 w-5 fill-black transition-all duration-300 dark:fill-white"
></span>
<UIcon
name="i-ph-arrow-up-bold"
class="svgIcon h-5 w-5 fill-black transition-all duration-300 dark:fill-white"
></UIcon>
</button>
</template>

Expand Down
7 changes: 4 additions & 3 deletions apps/client/components/main/Answer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
@click="handlePlayWordSound(word)"
>{{ word }}</span
>
<span
class="i-ph-speaker-simple-high ml-1 inline-block h-7 w-7 cursor-pointer text-gray-500 hover:text-fuchsia-500"
<UIcon
name="i-ph-speaker-simple-high"
class="ml-1 inline-block h-7 w-7 cursor-pointer text-gray-500 hover:text-fuchsia-500"
@click="handlePlayEnglishSound"
></span>
></UIcon>
</div>
<div class="my-6 text-xl text-gray-500">
{{ courseStore.currentStatement?.soundmark }}
Expand Down
12 changes: 7 additions & 5 deletions apps/client/components/main/AnswerTip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
<div class="card bg-base-100 shadow-xl">
<div class="card-body relative">
<div class="absolute right-2 top-1 mt-0">
<button
class="h-5 w-5 text-gray-400 outline-none dark:text-gray-300"
<UButton
color="gray"
variant="ghost"
icon="i-heroicons-x-mark-20-solid"
@click="hiddenAnswerTip"
>
<span class="i-ph-x-bold h-full w-full"></span>
</button>
tabindex="-1"
:ui="{ color: { gray: { ghost: 'dark:hover:bg-gray-600' } } }"
/>
</div>

<div class="text-3xl">{{ courseStore.currentStatement?.english }}</div>
Expand Down
8 changes: 4 additions & 4 deletions apps/client/components/main/LearningTimer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
ref="clockIcon"
class="mr-1 flex items-center justify-center"
>
<span
class="i-ph-alarm-bold"
style="width: 30px; height: 30px"
></span>
<UIcon
name="i-ph-alarm-bold"
class="h-8 w-8"
></UIcon>
</div>
<p class="text-lg font-bold">{{ formattedTime }}</p>
</div>
Expand Down
10 changes: 8 additions & 2 deletions apps/client/components/main/PrevAndNextBtn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
@click="goToPreviousQuestion"
@mouseenter="$lazyTippy"
>
<span class="i-ph-caret-left h-12 w-12"></span>
<UIcon
name="i-ph-caret-left"
class="h-12 w-12"
></UIcon>
</button>
</div>

Expand All @@ -20,7 +23,10 @@
@click="goToNextQuestion"
@mouseenter="$lazyTippy"
>
<span class="i-ph-caret-right h-12 w-12"></span>
<UIcon
name="i-ph-caret-right"
class="h-12 w-12"
></UIcon>
</button>
</div>
</div>
Expand Down

0 comments on commit dade09c

Please sign in to comment.