File tree Expand file tree Collapse file tree 3 files changed +22
-22
lines changed
Expand file tree Collapse file tree 3 files changed +22
-22
lines changed Original file line number Diff line number Diff line change 11<script lang =" ts" >
2- import { PUBLIC_EMAIL } from ' $env/static/public' ;
32 import { nav } from ' $lib/data/nav' ;
43 import { links } from ' $lib/data/profile' ;
4+ import { email } from ' $lib/rigs/email.svelte' ;
55 import { getLinkAttributes } from ' $lib/rigs/link.svelte' ;
66 import { ArrowUp , CopyCheck , Mail } from ' lucide-svelte' ;
77 import Ripple from ' ./ripple.svelte' ;
8-
9- let copied = $state <ReturnType <typeof setTimeout >>();
108 </script >
119
1210<footer
5149 {/each }
5250 <button
5351 class =" button-ghost aspect-square cursor-copy"
54- aria-pressed ={copied != null || undefined }
55- onpointerdown ={() => {
56- navigator .clipboard .writeText (PUBLIC_EMAIL );
57- clearTimeout (copied );
58- copied = setTimeout (() => {
59- copied = undefined ;
60- }, 1500 );
61- }}
52+ aria-pressed ={email .copied != null || undefined }
53+ onpointerdown ={email .copy }
6254 >
6355 <Ripple />
6456 <Mail
Original file line number Diff line number Diff line change 1+ import { PUBLIC_EMAIL } from '$env/static/public' ;
2+
3+ let copied = $state < ReturnType < typeof setTimeout > > ( ) ;
4+
5+ export const email = {
6+ get copied ( ) {
7+ return copied ;
8+ } ,
9+ copy ( ) {
10+ navigator . clipboard . writeText ( PUBLIC_EMAIL ) ;
11+ clearTimeout ( copied ) ;
12+ copied = setTimeout ( ( ) => {
13+ copied = undefined ;
14+ } , 1500 ) ;
15+ } ,
16+ } ;
Original file line number Diff line number Diff line change 11<script lang =" ts" >
2- import { PUBLIC_EMAIL } from ' $env/static/public' ;
32 import { tags_details } from ' $lib/data/meta' ;
43 import { skills } from ' $lib/data/profile' ;
4+ import { email } from ' $lib/rigs/email.svelte' ;
55 import * as m from ' $messages' ;
66 import { AtSign , CopyCheck , Send } from ' lucide-svelte' ;
77 import { on } from ' svelte/events' ;
88
99 const phrases = m .skills_phrases ().split (/ (?<=,)/ );
10-
11- let copied = $state <ReturnType <typeof setTimeout >>();
1210 </script >
1311
1412<section
113111 </li >
114112 </ul >
115113 <button
116- aria-pressed ={copied != null || undefined }
114+ aria-pressed ={email . copied != null || undefined }
117115 class =" group flex cursor-copy items-center gap-[1em] self-end"
118- onpointerdown ={() => {
119- navigator .clipboard .writeText (PUBLIC_EMAIL );
120- clearTimeout (copied );
121- copied = setTimeout (() => {
122- copied = undefined ;
123- }, 1500 );
124- }}
116+ onpointerdown ={email .copy }
125117 >
126118 <div class =" button-cta" >
127119 <span
You can’t perform that action at this time.
0 commit comments