Skip to content

Commit 3f44038

Browse files
committed
Update bsky likes design
1 parent 3b5e6a7 commit 3f44038

File tree

7 files changed

+70
-11
lines changed

7 files changed

+70
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ npm install
1616

1717
### Run the site locally
1818

19-
Use the Netlify CLI to inject environment variables stored against the Netlify site — no local `.env` file needed!
19+
Use the Netlify CLI to inject environment variables stored against the Netlify site — no local `.env` file needed.
2020

2121
```bash
2222
ntl dev

src/_client_scripts/bsky_post_likes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function drawLikes(likesActors, postLikesCount) {
2525

2626
if (like.actor.avatar !== undefined) {
2727
likeEl.innerHTML = `
28-
<img class="post__like__avatar" src="${like.actor.avatar.replace("avatar", "avatar_thumbnail")}" alt="${
28+
<img class="post__like__avatar" src="${like.actor.avatar.replace("avatar", "avatar_thumbnail")}" alt="${
2929
like.actor.displayName
3030
}" />`;
3131
} else {

src/_components/svg/heartIcon.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
function HeartIcon() {
2+
return /*html*/ `
3+
<svg
4+
xmlns="http://www.w3.org/2000/svg"
5+
height="40"
6+
width="40"
7+
viewBox="0 0 512 512"
8+
aria-label="Heart"
9+
role="img">
10+
<path
11+
fill="currentColor"
12+
d="M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"
13+
/>
14+
</svg>
15+
`;
16+
}
17+
18+
module.exports = HeartIcon;

src/_css/main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/_css/main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/_sass/_post.scss

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,15 @@
458458
line-height: 1.2;
459459
margin-bottom: 1rem;
460460
color: var(--color-fg-copy);
461+
display: flex;
462+
flex-direction: row;
463+
justify-content: flex-start;
464+
gap: 0.5rem;
465+
align-items: center;
466+
467+
svg {
468+
color: var(--pink);
469+
}
461470
}
462471

463472
.post__likesCta {
@@ -467,6 +476,10 @@
467476
font-style: italic;
468477
margin-bottom: 2rem;
469478
display: block;
479+
480+
&:focus-visible {
481+
@include utils.link_focus;
482+
}
470483
}
471484

472485
.post__likesList {
@@ -481,13 +494,33 @@
481494
.post__like {
482495
width: 4rem;
483496
aspect-ratio: 1/1;
484-
margin-right: -1rem;
485-
border-radius: 100%;
486-
filter: var(--base-shadow-filter);
497+
filter: contrast(150%);
498+
display: flex;
499+
overflow: hidden;
500+
501+
&::before {
502+
top: -50%;
503+
left: -50%;
504+
right: -50%;
505+
bottom: -50%;
506+
content: "";
507+
position: absolute;
508+
transform: rotate(20deg);
509+
background: radial-gradient(circle at center, #000, #fff);
510+
background-size: 0.15em 0.15em;
511+
}
487512
}
488513

489514
.post__like__avatar {
490-
border-radius: 100%;
515+
width: 100%;
516+
filter: grayscale(1) brightness(90%) contrast(150%);
517+
height: auto;
518+
transition: all 500ms cubic-bezier(0.42, 0, 0.58, 1);
519+
mix-blend-mode: hard-light;
520+
521+
&:hover {
522+
filter: unset;
523+
}
491524
}
492525

493526
.post__like--placeholder,
@@ -500,6 +533,11 @@
500533
align-items: center;
501534
font-size: 1rem;
502535
font-style: italic;
503-
background-color: #208bfe;
536+
background-color: var(--pink);
504537
color: #fff;
538+
filter: unset;
539+
540+
&::before {
541+
content: unset;
542+
}
505543
}

src/blog/blog-pages.11ty.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const PublishedDate = require("../_components/publishedDate");
77
const TableOfContents = require("../_components/tableOfContents");
88
const isSponsored = require("../_components/isSponsored");
99
const Card = require("../_components/card");
10+
const HeartIcon = require("../_components/svg/heartIcon");
1011
const PostStructuredData = require("../_components/postStructuredData");
1112
const OpenGraph = require("../../lib/openGraph");
1213

@@ -126,8 +127,10 @@ exports.render = async function (data) {
126127
post.blueskyPostId
127128
? `
128129
<section class="post__likes" data-bsky-container>
129-
<h3 class="post__likesTitle">🦋 <span data-bsky-likes-count></span> likes on Bluesky</h3>
130-
<a class="post__likesCta" href="https://bsky.app/profile/whitep4nth3r.com/post/${post.blueskyPostId}" target="_blank">Like this post on Bluesky to see your face on this page</a>
130+
<h3 class="post__likesTitle">${HeartIcon()} <span data-bsky-likes-count></span> likes</h3>
131+
<a class="post__likesCta" href="https://bsky.app/profile/whitep4nth3r.com/post/${
132+
post.blueskyPostId
133+
}" target="_blank">Like this post on Bluesky to see your face on this page</a>
131134
<ul data-bsky-likes class="post__likesList"></ul>
132135
</section>`
133136
: ""

0 commit comments

Comments
 (0)