File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
packages/repl/src/lib/Input Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 189189 {#if download }
190190 <button onclick ={download }>Download app</button >
191191 {/if }
192+
193+ <button
194+ class =" copy-button"
195+ title =" Copy `npx sv create --from-playground=" ..." ` to clipboard"
196+ aria-label =" Copy `npx sv create --from-playground=" ..." ` to clipboard"
197+ onclick ={() => {
198+ navigator .clipboard .writeText (
199+ ` npx sv create --from-playground="${window .location .href }" `
200+ );
201+ }}
202+ >
203+ Set up locally
204+ </button >
192205 </Toolbox >
193206 </div >
194207</div >
360373 stroke-linejoin : round ;
361374 fill : none ;
362375 }
376+
377+ .copy-button {
378+ position : relative ;
379+
380+ &::before,
381+ &::after {
382+ content : ' ' ;
383+ display : block ;
384+ position : absolute ;
385+ width : 100% ;
386+ height : 100% ;
387+ right : 0 ;
388+ top : 0 ;
389+ background : currentColor ;
390+ mask : no-repeat calc (100% - 1rem ) 50% / 1.6rem 1.6rem ;
391+ transition : opacity 0.2s ;
392+ transition-delay : 0.6s ;
393+ }
394+
395+ &::before {
396+ mask-image : url (icons/copy-to-clipboard );
397+ }
398+
399+ &::after {
400+ mask-image : url (icons/check );
401+ opacity : 0 ;
402+ }
403+
404+ &:active ::before {
405+ opacity : 0 ;
406+ transition : none ;
407+ }
408+
409+ &:active ::after {
410+ opacity : 1 ;
411+ transition : none ;
412+ }
413+ }
363414 </style >
You can’t perform that action at this time.
0 commit comments