Skip to content

Commit

Permalink
🐛 [Cursors] Bring back preloading
Browse files Browse the repository at this point in the history
  • Loading branch information
beefchimi committed Jul 26, 2024
1 parent 4b3720c commit cc8bfc3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/components/ContentBlock.astro
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ const inactive = !title || !subtitle;
/* Just a small nudge for better vertical centering */
padding-top: calc(var(--space-tightest) + 0.1rem);

/* Consider improveing the legibility of text */
/*
background-color: rgb(255, 255, 255, 0.04);
backdrop-filter: blur(2px);
*/

& > h3 {
font-weight: 800;
}
Expand Down
7 changes: 4 additions & 3 deletions src/sections/Intro.astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ const {id, thumbnail} = Astro.props;
Background image photographed by: Curtis Dulmage
</p>

<p class="paragraph visually-hidden">
<p class="paragraph visually-hidden preload-cursors">
<b>Curtis Dulmage.</b>
<u>Front end web developer.</u>
<i>Ottawa, Canada.</i> Here are a few of my most recent projects. Please
get in touch if you have any questions. Thank you.
<i>Ottawa, Canada.</i>
<strong>Here are a few of my most recent projects.</strong>
<em>Please get in touch if you have any questions. Thank you.</em>
</p>
</div>

Expand Down
25 changes: 25 additions & 0 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,28 @@ button {
cursor: url('../assets/svg/cursors/CursorPointerClicked.svg'), pointer;
}
}

.preload-cursors {
/*
Required to preload the variant cursor. Otherwise, there will be
a delay upon click when switching to the different cursor asset.
*/

> b {
cursor: url('../assets/svg/cursors/CursorDeadClicked.svg'), auto;
}

> u {
cursor: url('../assets/svg/cursors/CursorHornsClicked.svg'), pointer;
}

> i {
cursor: url('../assets/svg/cursors/CursorPointerClicked.svg'), pointer;
}

/*
> strong {
cursor: url('../assets/svg/cursors/CursorGrabClicked.svg'), pointer;
}
*/
}

0 comments on commit cc8bfc3

Please sign in to comment.