Skip to content

Commit

Permalink
🎨 update favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnath committed Oct 10, 2023
1 parent a94830e commit fa0920d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
7 changes: 0 additions & 7 deletions workspaces/website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,4 @@
[ ] convert resume to web-component/lit
[ ] add linter
[ ] make work with testing-library
[ ] need favicon
* dual favicons on remotely.com (https://remotive.com/remotive_website_layout/static/refactoring/js/favicon.js?v=2)
* clown face and ??? (https://favicon.io/emoji-favicons/)
[ ] add github graph: https://github.com/enpitsuLin/wc-github-graph/blob/master/src/github-graph.ts

```js
const onVisibilityChange=()=>{const faviconTag=document.querySelector('[rel="shortcut icon"]');if(document.hidden){const initialFavicon=faviconTag.href;document.initialFavicon=initialFavicon;faviconTag.href="/remotive_website_job/static/src/img/dogeicon.png";}else{if(document.initialFavicon!==""){faviconTag.href=document.initialFavicon;}}};document.addEventListener("visibilitychange",onVisibilityChange,true);document.initialFavicon=document.querySelector('[rel="shortcut icon"]').href;
```
Binary file added workspaces/website/public/favicon-clown.ico
Binary file not shown.
Binary file not shown.
22 changes: 20 additions & 2 deletions workspaces/website/src/components/BaseHead.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ export interface Props {
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
const { title, description, image = '/placeholder-scottnath.jpeg' } = Astro.props;
const { title, description, image = '/scott-nath-profile-pic.jpeg' } = Astro.props;
---
<script defer data-domain="scottnath.com" src="https://plausible.io/js/script.js" type="text/partytown"></script>


<!-- Global Metadata -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" href="/favicon-mind-blown.ico" id="favicon" />
<meta name="generator" content={Astro.generator} />
<link rel="preload" as="image" href="/scott-nath-profile-pic.jpeg" />

Expand All @@ -45,3 +45,21 @@ const { title, description, image = '/placeholder-scottnath.jpeg' } = Astro.prop
<meta property="twitter:title" content={title} />
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content={new URL(image, Astro.url)} />

<script>
// triggers a different favicon when the user switches tabs
const onVisibilityChange=()=>{
const faviconTag=document.querySelector('#favicon');
if(document.hidden){
const initialFavicon=faviconTag?.href;
document.initialFavicon=initialFavicon;
faviconTag.href="/favicon-clown.ico";
} else {
if(document.initialFavicon!==""){
faviconTag.href=document.initialFavicon;
}
}
};
document.addEventListener("visibilitychange",onVisibilityChange,true);
document.initialFavicon=document.querySelector('#favicon').href;
</script>
6 changes: 5 additions & 1 deletion workspaces/website/src/components/codewall/assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ Use https://green-wall.vercel.app/ to generate a codewall for public github
For making any kind of component:
https://github.com/Codennnn/Green-Wall

Could be a /Codewall page on the site maybe
Could be a /Codewall page on the site maybe

shows a sneaky api call to get the data
https://github.com/sallar/github-contributions-chart/blob/master/src/utils/api/fetch.js
https://github-contribution-graph-example.vercel.app/

0 comments on commit fa0920d

Please sign in to comment.