Skip to content

Commit aa3e08e

Browse files
committed
chore: prettier
1 parent 167f43e commit aa3e08e

File tree

7 files changed

+3640
-1741
lines changed

7 files changed

+3640
-1741
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { onMessage } from "@/entrypoints/background/messaging.ts";
22

33
export function backgroundFetch() {
4-
console.log('backgroundFetch');
4+
console.log("backgroundFetch");
55
onMessage("backgroundFetch", (message) => {
66
const msg = message.data;
77
return new Promise<void>((resolve, reject) => {
88
fetch(msg.url, msg.options)
9-
.then(data => resolve())
10-
.catch(error => reject(error));
9+
.then((data) => resolve())
10+
.catch((error) => reject(error));
1111
});
1212
});
1313
}

entrypoints/background/messaging.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineExtensionMessaging } from '@webext-core/messaging';
1+
import { defineExtensionMessaging } from "@webext-core/messaging";
22

33
interface BackgroundFetchMessageProps {
44
url: string | URL | globalThis.Request;
@@ -10,4 +10,5 @@ interface ProtocolMap {
1010
backgroundFetch(msg: BackgroundFetchMessageProps): void;
1111
}
1212

13-
export const { sendMessage, onMessage } = defineExtensionMessaging<ProtocolMap>();
13+
export const { sendMessage, onMessage } =
14+
defineExtensionMessaging<ProtocolMap>();

entrypoints/content/components/shine-border.tsx

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,38 +24,38 @@ interface ShineBorderProps {
2424
* @param children contains react node elements.
2525
*/
2626
export default function ShineBorder({
27-
borderRadius = 8,
28-
borderWidth = 1,
29-
duration = 14,
30-
color = "#000000",
31-
className,
32-
children,
33-
}: ShineBorderProps) {
27+
borderRadius = 8,
28+
borderWidth = 1,
29+
duration = 14,
30+
color = "#000000",
31+
className,
32+
children,
33+
}: ShineBorderProps) {
3434
return (
3535
<div
3636
style={
37-
{
38-
"--border-radius": `${borderRadius}px`,
39-
} as React.CSSProperties
40-
}
41-
className={clsx(
42-
"relative grid min-h-[60px] w-fit min-w-[300px] place-items-center rounded-[--border-radius] bg-white p-3 text-black dark:bg-black dark:text-white",
43-
className,
44-
)}
45-
>
46-
<div
47-
style={
48-
{
49-
"--border-width": `${borderWidth}px`,
50-
"--border-radius": `${borderRadius}px`,
51-
"--shine-pulse-duration": `${duration}s`,
52-
"--mask-linear-gradient": `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,
53-
"--background-radial-gradient": `radial-gradient(transparent,transparent, ${color instanceof Array ? color.join(",") : color},transparent,transparent)`,
54-
} as React.CSSProperties
55-
}
56-
className={`before:bg-shine-size before:absolute before:inset-0 before:aspect-square before:size-full before:rounded-[--border-radius] before:p-[--border-width] before:will-change-[background-position] before:content-[""] before:![-webkit-mask-composite:xor] before:![mask-composite:exclude] before:[background-image:--background-radial-gradient] before:[background-size:300%_300%] before:[mask:--mask-linear-gradient] motion-safe:before:animate-[shine-pulse_var(--shine-pulse-duration)_infinite_linear]`}
57-
></div>
58-
{children}
59-
</div>
60-
);
37+
{
38+
"--border-radius": `${borderRadius}px`,
39+
} as React.CSSProperties
40+
}
41+
className={clsx(
42+
"relative grid min-h-[60px] w-fit min-w-[300px] place-items-center rounded-[--border-radius] bg-white p-3 text-black dark:bg-black dark:text-white",
43+
className,
44+
)}
45+
>
46+
<div
47+
style={
48+
{
49+
"--border-width": `${borderWidth}px`,
50+
"--border-radius": `${borderRadius}px`,
51+
"--shine-pulse-duration": `${duration}s`,
52+
"--mask-linear-gradient": `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,
53+
"--background-radial-gradient": `radial-gradient(transparent,transparent, ${color instanceof Array ? color.join(",") : color},transparent,transparent)`,
54+
} as React.CSSProperties
55+
}
56+
className={`before:bg-shine-size before:absolute before:inset-0 before:aspect-square before:size-full before:rounded-[--border-radius] before:p-[--border-width] before:will-change-[background-position] before:content-[""] before:![-webkit-mask-composite:xor] before:![mask-composite:exclude] before:[background-image:--background-radial-gradient] before:[background-size:300%_300%] before:[mask:--mask-linear-gradient] motion-safe:before:animate-[shine-pulse_var(--shine-pulse-duration)_infinite_linear]`}
57+
></div>
58+
{children}
59+
</div>
60+
);
6161
}

entrypoints/content/components/tweet-card.tsx

Lines changed: 36 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect } from "react";
22
import {
33
extractData,
4-
TweetData
4+
TweetData,
55
} from "@/entrypoints/content/lib/data-analysis.ts";
66
import ShineBorder from "@/entrypoints/content/components/shine-border.tsx";
77

@@ -23,10 +23,7 @@ export function TweetCard({ element }: TweetCardProps) {
2323

2424
return (
2525
<>
26-
<ShineBorder
27-
className=""
28-
color={["#A07CFE", "#FE8FB5", "#FFBE7B"]}
29-
>
26+
<ShineBorder className="" color={["#A07CFE", "#FE8FB5", "#FFBE7B"]}>
3027
<div className="css-175oi2r r-18kxxzh r-1wron08 r-onrtq4 r-1awozwy">
3128
<div className="css-175oi2r" data-testid="Tweet-User-Avatar">
3229
<div className="css-175oi2r r-18kxxzh r-1wbh5a2 r-13qz1uu">
@@ -41,8 +38,7 @@ export function TweetCard({ element }: TweetCardProps) {
4138
css="padding-bottom: 100%;"
4239
></div>
4340
<div className="r-1p0dtai r-1pi2tsx r-1d2f490 r-u8s1d r-ipm5af r-13qz1uu">
44-
<div
45-
className="css-175oi2r r-1adg3ll r-1pi2tsx r-13qz1uu r-45ll9u r-u8s1d r-1v2oles r-176fswd r-bztko3">
41+
<div className="css-175oi2r r-1adg3ll r-1pi2tsx r-13qz1uu r-45ll9u r-u8s1d r-1v2oles r-176fswd r-bztko3">
4642
<div
4743
className="r-1adg3ll r-13qz1uu"
4844
css="padding-bottom: 100%;"
@@ -88,10 +84,8 @@ export function TweetCard({ element }: TweetCardProps) {
8884
css="padding-bottom: 100%;"
8985
></div>
9086
<div className="r-1p0dtai r-1pi2tsx r-1d2f490 r-u8s1d r-ipm5af r-13qz1uu">
91-
<div
92-
className="css-175oi2r r-1mlwlqe r-1udh08x r-417010 r-1p0dtai r-1d2f490 r-u8s1d r-zchlnj r-ipm5af">
93-
<div
94-
className="css-175oi2r r-1niwhzg r-vvn4in r-u6sd8q r-1p0dtai r-1pi2tsx r-1d2f490 r-u8s1d r-zchlnj r-ipm5af r-13qz1uu r-1wyyakw r-4gszlv"></div>
87+
<div className="css-175oi2r r-1mlwlqe r-1udh08x r-417010 r-1p0dtai r-1d2f490 r-u8s1d r-zchlnj r-ipm5af">
88+
<div className="css-175oi2r r-1niwhzg r-vvn4in r-u6sd8q r-1p0dtai r-1pi2tsx r-1d2f490 r-u8s1d r-zchlnj r-ipm5af r-13qz1uu r-1wyyakw r-4gszlv"></div>
9589
</div>
9690
</div>
9791
</div>
@@ -100,8 +94,7 @@ export function TweetCard({ element }: TweetCardProps) {
10094
className="css-175oi2r r-sdzlij r-1udh08x r-45ll9u r-u8s1d r-1v2oles r-176fswd"
10195
css="width: calc(100% - 4px); height: calc(100% - 4px);"
10296
>
103-
<div
104-
className="css-175oi2r r-12181gd r-1pi2tsx r-13qz1uu r-o7ynqc r-6416eg r-1ny4l3l"></div>
97+
<div className="css-175oi2r r-12181gd r-1pi2tsx r-13qz1uu r-o7ynqc r-6416eg r-1ny4l3l"></div>
10598
</div>
10699
</a>
107100
</div>
@@ -135,41 +128,40 @@ export function TweetCard({ element }: TweetCardProps) {
135128
dir="ltr"
136129
className="css-146c3p1 r-bcqeeo r-1ttztb7 r-qvutc0 r-37j5jr r-a023e6 r-rjixqe r-b88u0q r-1awozwy r-6koalj r-1udh08x r-3s2u2q"
137130
css="text-overflow: unset; color: rgb(15, 20, 25);"
138-
>
139-
<span
140-
className="css-1jxf684 r-dnmrzs r-1udh08x r-3s2u2q r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"
141-
css="text-overflow: unset;"
142131
>
143132
<span
144-
className="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"
133+
className="css-1jxf684 r-dnmrzs r-1udh08x r-3s2u2q r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"
145134
css="text-overflow: unset;"
146135
>
147-
Tweet Talk
136+
<span
137+
className="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"
138+
css="text-overflow: unset;"
139+
>
140+
Tweet Talk
141+
</span>
148142
</span>
149-
</span>
150143
</div>
151144
<div
152145
dir="ltr"
153146
className="css-146c3p1 r-bcqeeo r-1ttztb7 r-qvutc0 r-37j5jr r-a023e6 r-rjixqe r-16dba41 r-xoduu5 r-18u37iz r-1q142lx"
154147
css="text-overflow: unset; color: rgb(15, 20, 25);"
155148
>
156-
<span
157-
className="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1awozwy r-xoduu5"
158-
css="text-overflow: unset;"
159-
>
160-
<svg
161-
viewBox="0 0 22 22"
162-
aria-label="Verified account"
163-
role="img"
164-
className="r-4qtqp9 r-yyyyoo r-1xvli5t r-bnwqim r-lrvibr r-m6rgpd r-1cvl2hr r-f9ja8p r-og9te1 r-3t4u6i"
165-
data-testid="icon-verified"
149+
<span
150+
className="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1awozwy r-xoduu5"
151+
css="text-overflow: unset;"
166152
>
167-
<g>
168-
<path
169-
d="M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.087.705-1.443 1.245-.356.54-.555 1.17-.574 1.817.02.647.218 1.276.574 1.817.356.54.856.972 1.443 1.245-.224.606-.274 1.263-.144 1.896.13.634.433 1.218.877 1.688.47.443 1.054.747 1.687.878.633.132 1.29.084 1.897-.136.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.296 1.903.164.636-.132 1.22-.447 1.68-.907.46-.46.776-1.044.908-1.681s.075-1.299-.165-1.903c.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z"></path>
170-
</g>
171-
</svg>
172-
</span>
153+
<svg
154+
viewBox="0 0 22 22"
155+
aria-label="Verified account"
156+
role="img"
157+
className="r-4qtqp9 r-yyyyoo r-1xvli5t r-bnwqim r-lrvibr r-m6rgpd r-1cvl2hr r-f9ja8p r-og9te1 r-3t4u6i"
158+
data-testid="icon-verified"
159+
>
160+
<g>
161+
<path d="M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.087.705-1.443 1.245-.356.54-.555 1.17-.574 1.817.02.647.218 1.276.574 1.817.356.54.856.972 1.443 1.245-.224.606-.274 1.263-.144 1.896.13.634.433 1.218.877 1.688.47.443 1.054.747 1.687.878.633.132 1.29.084 1.897-.136.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.296 1.903.164.636-.132 1.22-.447 1.68-.907.46-.46.776-1.044.908-1.681s.075-1.299-.165-1.903c.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z"></path>
162+
</g>
163+
</svg>
164+
</span>
173165
</div>
174166
</div>
175167
</a>
@@ -198,16 +190,14 @@ export function TweetCard({ element }: TweetCardProps) {
198190
css="text-overflow: unset; color: rgb(83, 100, 113);"
199191
>
200192
<div className="css-175oi2r r-xoduu5">
201-
<div
202-
className="css-175oi2r r-xoduu5 r-1p0dtai r-1d2f490 r-u8s1d r-zchlnj r-ipm5af r-1niwhzg r-sdzlij r-xf4iuw r-o7ynqc r-6416eg r-1ny4l3l"></div>
193+
<div className="css-175oi2r r-xoduu5 r-1p0dtai r-1d2f490 r-u8s1d r-zchlnj r-ipm5af r-1niwhzg r-sdzlij r-xf4iuw r-o7ynqc r-6416eg r-1ny4l3l"></div>
203194
<svg
204195
viewBox="0 0 24 24"
205196
aria-hidden="true"
206197
className="r-4qtqp9 r-yyyyoo r-dnmrzs r-bnwqim r-lrvibr r-m6rgpd r-1xvli5t r-1hdv0qi"
207198
>
208199
<g>
209-
<path
210-
d="M3 12c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2zm9 2c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm7 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"></path>
200+
<path d="M3 12c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2zm9 2c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm7 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"></path>
211201
</g>
212202
</svg>
213203
</div>
@@ -229,12 +219,12 @@ export function TweetCard({ element }: TweetCardProps) {
229219
data-testid="tweetText"
230220
css="-webkit-line-clamp: 10; text-overflow: unset; color: rgb(15, 20, 25);"
231221
>
232-
<span
233-
className="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"
234-
css="text-overflow: unset;"
235-
>
236-
就你会刷 Twitter ?
237-
</span>
222+
<span
223+
className="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"
224+
css="text-overflow: unset;"
225+
>
226+
就你会刷 Twitter ?
227+
</span>
238228
</div>
239229
</div>
240230
</div>

0 commit comments

Comments
 (0)