Skip to content

Commit

Permalink
Update image width (#116)
Browse files Browse the repository at this point in the history
* feat: Adjust image width to 400px in Gallery and Image components

* refactor: Update padding in Image.vue component

Changed padding in the container div to include padding on the top and bottom for
better spacing consistency.

* refactor: Update image sizes and link icon source

- Decrease image width to 500px in Gallery.vue
- Update LinkIcon source to unavatar.io in LinkIcon.vue
- Remove rounded styling from link icon in Image.vue
  • Loading branch information
nexmoe authored May 2, 2024
1 parent cc9c85d commit 9536416
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions components/LinkIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ const props = defineProps<Props>()
function getOrigin(url: string) {
const urlx = new URL(url)
return urlx.origin.toString()
return urlx.host.toString()
}
</script>

<template>
<NuxtImg
class="rounded-md outline-2 hover:outline cursor-pointer"
:src="`https://lib.xiaoshuapp.com/icon/x?url=${getOrigin(props.url)}`"
:src="`https://unavatar.io/${getOrigin(props.url)}`"
:alt="props.url"
referrerpolicy="no-referrer"
loading="lazy"
Expand Down
4 changes: 2 additions & 2 deletions components/module/Gallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const props = defineProps<Props>()
<template>
<div class="module shu-card p-3 flex flex-col">
<div class="flex flex-row items-center pt-1 pb-3 gap-2 px-2">
<div class="w-5 h-5 block rounded-full overflow-hidden">
<div class="w-5 h-5 block overflow-hidden">
<LinkIcon
:width="20"
:url="props.module.url"
Expand All @@ -41,7 +41,7 @@ const props = defineProps<Props>()
:alt="module.title"
referrerpolicy="no-referrer"
loading="lazy"
:width="`600px`"
:width="`500px`"
/>
<div class="absolute bottom-0 left-0 px-5 pt-5 pb-4 bg-gradient-to-t from-black/35 to-transparent w-full">
<h3 class="drop-shadow-md text-white font-bold text-2xl tracking-tight">
Expand Down
7 changes: 3 additions & 4 deletions components/module/Image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const text = computed(() => extractTextFromHTML(props.module.content))
<div class="module shu-card p-3 gap-1 flex flex-col justify-between">
<div class="space-y-4">
<div class="flex flex-row items-center pt-1 gap-2 px-2.5">
<div class="w-5 h-5 block rounded-full overflow-hidden">
<div class="w-5 h-5 block overflow-hidden">
<LinkIcon :url="props.module.url" />
</div>
<div>
Expand All @@ -38,12 +38,11 @@ const text = computed(() => extractTextFromHTML(props.module.content))
:alt="module.title"
referrerpolicy="no-referrer"
loading="lazy"
:width="`${module.imageWidth}px`"
:height="`${module.imageHeight}px`"
:width="`400px`"
/>
</div>
</div>
<div class="space-y-4 px-3 pb-3 pt-0">
<div class="space-y-4 px-3 py-3">
<h3
v-if="!flow?.configNoTitle"
class="card-title font-bold text-2xl tracking-tight text-black"
Expand Down

0 comments on commit 9536416

Please sign in to comment.