Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions frontend/src/components/WikiCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,18 @@ export function WikiCard({ article }: WikiCardProps) {

return (
<div className="h-screen w-full flex items-center justify-center snap-start relative" onDoubleClick={() => toggleLike(article)}>
<div className="h-full w-full relative">
<div className="h-full w-full relative bg-white">
{article.thumbnail ? (
<div className="absolute inset-0">
<div
style={{ '--bg-image': `url('${article.thumbnail.source}')` }}
className={`absolute inset-0 lg:bg-cover lg:bg-[image:var(--bg-image)]`}
>
<div className="absolute inset-0 lg:bg-black lg:opacity-50"/>
<img
loading="lazy"
src={article.thumbnail.source}
alt={article.displaytitle}
className={`w-full h-full object-cover transition-opacity duration-300 bg-white ${imageLoaded ? 'opacity-100' : 'opacity-0'
className={`w-full h-full lg:relative lg:inset-1/20 lg:w-9/10 lg:h-9/10 object-cover lg:object-contain transition-opacity duration-300 bg-white lg:bg-transparent ${imageLoaded ? 'opacity-100' : 'opacity-0'
}`}
onLoad={() => setImageLoaded(true)}
onError={(e) => {
Expand Down