mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-30 01:49:40 +05:00
refactor: change Image Optimization to custom url
This commit is contained in:
parent
61e8b74d11
commit
ff11a90a5e
11 changed files with 100 additions and 28 deletions
app/components/CollectionLink
|
@ -1,5 +1,6 @@
|
|||
import Link from "next/link";
|
||||
import { Chip } from "#/components/Chip/Chip";
|
||||
import Image from "next/image";
|
||||
|
||||
export const CollectionLink = (props: any) => {
|
||||
return (
|
||||
|
@ -8,9 +9,20 @@ export const CollectionLink = (props: any) => {
|
|||
<div
|
||||
className="relative w-full h-full overflow-hidden bg-center bg-no-repeat bg-cover rounded-sm group-hover:animate-bg_zoom animate-bg_zoom_rev group-hover:[background-size:110%] "
|
||||
style={{
|
||||
backgroundImage: `linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.9) 100%), url(${props.image})`,
|
||||
backgroundImage: `linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.9) 100%)`,
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
src={props.image}
|
||||
fill={true}
|
||||
alt={props.title}
|
||||
className="-z-[1] object-cover"
|
||||
sizes="
|
||||
(max-width: 768px) 300px,
|
||||
(max-width: 1024px) 600px,
|
||||
900px
|
||||
"
|
||||
/>
|
||||
<div className="absolute flex flex-wrap items-start justify-start gap-0.5 sm:gap-1 left-2 top-2">
|
||||
<Chip
|
||||
icon_name="material-symbols--favorite"
|
||||
|
@ -38,7 +50,9 @@ export const CollectionLink = (props: any) => {
|
|||
</p>
|
||||
</div>
|
||||
<p className="text-xs font-light text-white md:text-sm lg:text-base xl:text-lg">
|
||||
{`${props.description.slice(0, 125)}${props.description.length > 125 ? "..." : ""}`}
|
||||
{`${props.description.slice(0, 125)}${
|
||||
props.description.length > 125 ? "..." : ""
|
||||
}`}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue