Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weekly promotion of develop to main #210

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
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
91 changes: 91 additions & 0 deletions src/AppStore/AppThumbnail.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
const appDetailsUrl = `#/${REPL_ACCOUNT}/widget/ComponentDetailsPage?src=${props.author}/widget/${props.widgetName}`;

const Thumbnail = styled.a`
display: block;
aspect-ratio: 1 / 1;
overflow: hidden;
border-radius: 1.25rem;
border: 1px solid var(--sand6);
position: relative;
cursor: pointer;
text-decoration: none !important;
outline: none;
transition: all 200ms;

img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
border: none;
}

&:hover,
&:focus {
box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
}
`;

const ThumbnailContent = styled.span`
display: flex;
flex-direction: column;
gap: 0.25rem;
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 1.25rem;
padding-top: 3.5rem;
background: linear-gradient(
to top,
rgba(0, 0, 0, 0.85) 20%,
rgba(0, 0, 0, 0)
);
font: var(--text-xs);
color: var(--white);
text-shadow: 0 0 2px rgba(0, 0, 0, 0.75);

b {
font-weight: 600;
}

@media (max-width: 650px) {
padding: 0.75rem;
}
`;

const ThumbnailTag = styled.span`
display: inline-flex;
border-bottom-right-radius: 1.25rem;
background: var(--violet7);
color: #fff;
font: var(--text-xs);
font-weight: 700;
padding: 0.25rem 0.75rem;
position: absolute;
top: 0;
left: 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
border-right: 1px solid rgba(0, 0, 0, 0.1);
`;

return (
<Thumbnail href={appDetailsUrl}>
<Widget
src="${REPL_MOB}/widget/Image"
props={{
image: props.image,
fallbackUrl:
"https://ipfs.near.social/ipfs/bafkreifc4burlk35hxom3klq4mysmslfirj7slueenbj7ddwg7pc6ixomu",
alt: props.widgetName,
}}
/>

<ThumbnailContent>
<span>
<b>{props.name ?? props.widgetName}</b>
</span>
<span>{props.author}</span>
</ThumbnailContent>
</Thumbnail>
);
68 changes: 68 additions & 0 deletions src/AppStore/ArticleSummary.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
const Text = styled.p`
font: var(--${(p) => p.size ?? "text-base"});
font-weight: ${(p) => p.fontWeight};
color: var(--${(p) => p.color ?? "sand12"});
margin: 0;
`;

const ArticleImage = styled.div`
width: 100%;
aspect-ratio: 26 / 15;
border-radius: 1rem;
border: 1px solid var(--sand6);
overflow: hidden;
transition: all 200ms;

img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
border: none;
}
`;

const ArticleContent = styled.div`
display: flex;
flex-direction: column;
gap: 0.25rem;
`;

const Article = styled.a`
display: flex;
flex-direction: column;
gap: 1rem;
align-items: row;
cursor: pointer;
text-decoration: none !important;

&:hover,
&:focus {
${ArticleImage} {
box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
}
}
`;

return (
<Article url={props.url}>
<ArticleImage>
<Widget
src="${REPL_MOB}/widget/Image"
props={{
image: props.image,
fallbackUrl:
"https://ipfs.near.social/ipfs/bafkreifc4burlk35hxom3klq4mysmslfirj7slueenbj7ddwg7pc6ixomu",
alt: props.title,
}}
/>
</ArticleImage>

<ArticleContent>
<Text size="text-base" fontWeight={600}>
{props.title}
</Text>
<Text size="text-xs">{props.author}</Text>
</ArticleContent>
</Article>
);
Loading