Skip to content

Commit

Permalink
remove avatars #33
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed May 17, 2024
1 parent d3276e0 commit 8263557
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 4 additions & 0 deletions 2024-05-17/chat-gpt-http-server-with-npx.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions bookmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ javascript:(async function() {
const a = document.createElement('a');
const dom = document.querySelector('main > .h-full > .flex-1 > .h-full .flex');
const template = document.createElement('template');
const user_image = dom.querySelector('.items-end img.rounded-sm');
const content_images = dom.querySelectorAll('.empty\\:hidden > img');
const content_images_data = await get_content_images(content_images);
const avatar_data = await get_image_data(user_image);
const is_dark_mode = document.documentElement.matches('.dark');
const title = document.querySelector('ol li a.bg-gray-100')?.textContent ?? document.title;
const non_letters_re = /[^\p{L}\p{N}]+/gu;
Expand Down Expand Up @@ -415,14 +413,11 @@ function decode(array) {
const ua = new Uint8Array(array);
return URL.createObjectURL(new Blob([ua], {type : "image/jpeg"}));
}
const avatar_data = decode([${avatar_data.toString()}]);
const content_images = ${arr_stringify(content_images_data)}.map(decode);
document.querySelectorAll('img').forEach(img => {
if (img.matches('.empty\\\\:hidden > img')) {
const uri = content_images.shift();
img.src = uri;
} else {
img.src = avatar_data;
}
});
toggle.addEventListener('change', () => {
Expand Down

0 comments on commit 8263557

Please sign in to comment.