Skip to content

Commit

Permalink
feat: update twitter icon & styles
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed Aug 17, 2024
1 parent 31dc745 commit 3ba9791
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/components/layout/share.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
const handleShare = () => {
const url = encodeURIComponent(window.location.href)
const title = encodeURIComponent(document.title || APP_META.title)
// https://developer.twitter.com/en/docs/twitter-for-websites/tweet-button/overview
const tweetURL = `https://twitter.com/intent/tweet?url=${url}&text=${title}`
openWindow(tweetURL, { name: `Share: ${props.repository}` })
}
Expand All @@ -18,7 +17,7 @@
<template>
<div id="share">
<button class="share-button" title="Share to Twitter" @click="handleShare">
<i class="iconfont icon-twitter"></i>
<i class="iconfont icon-twitter-x"></i>
<span class="text">Tweet</span>
</button>
</div>
Expand Down Expand Up @@ -54,18 +53,17 @@
cursor: pointer;
user-select: none;
border: 1px solid $body-bg;
border-top: 2px solid $twitter-primary;
border-left: none;
border-top-right-radius: $lg-radius;
border-bottom-right-radius: $lg-radius;
color: $twitter-primary;
color: $link-color;
background-color: $banner-bg;
transition:
background-color $transition-time,
color $transition-time;
&:hover {
color: $white;
background-color: $twitter-primary;
background-color: $twitter-x-primary;
}
.iconfont {
Expand Down
10 changes: 7 additions & 3 deletions src/styles/iconfont.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@font-face {
font-family: 'iconfont'; /* Project id 1492229 */
src:
url('//at.alicdn.com/t/c/font_1492229_yvmvg6pl0qo.woff2?t=1693569913342') format('woff2'),
url('//at.alicdn.com/t/c/font_1492229_yvmvg6pl0qo.woff?t=1693569913342') format('woff'),
url('//at.alicdn.com/t/c/font_1492229_yvmvg6pl0qo.ttf?t=1693569913342') format('truetype');
url('//at.alicdn.com/t/c/font_1492229_1mnieagq9va.woff2?t=1723905773870') format('woff2'),
url('//at.alicdn.com/t/c/font_1492229_1mnieagq9va.woff?t=1723905773870') format('woff'),
url('//at.alicdn.com/t/c/font_1492229_1mnieagq9va.ttf?t=1723905773870') format('truetype');
}

.iconfont {
Expand All @@ -14,6 +14,10 @@
-moz-osx-font-smoothing: grayscale;
}

.icon-twitter-x:before {
content: '\e61c';
}

.icon-system-theme:before {
content: '\e947';
}
Expand Down
2 changes: 1 addition & 1 deletion src/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $github-attention: #c69026;
$github-text-primary: #0366d6;
$github-sponsor-primary: rgb(234, 74, 170);
$twitter-primary: #1d9bf0;
$twitter-dimmed: #0c7abf;
$twitter-x-primary: #000000;

// theme
$header-bg: var(--theme-header);
Expand Down

0 comments on commit 3ba9791

Please sign in to comment.