Skip to content

Commit d65920a

Browse files
fix: lighthouse (#67)
1 parent 59c14fb commit d65920a

17 files changed

+45
-17
lines changed

analyzer/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
/>
5858
<meta name="twitter:site" content="@DevToRater" />
5959
<meta name="theme-color" content="#ffffff" />
60+
61+
<link rel="preconnect" href="https://iconfinder.com" />
62+
<link rel="preconnect" href="https://cdn3.iconfinder.com" />
6063
</head>
6164
<style>
6265
@import url('https://fonts.googleapis.com/css2?family=Playwrite+IS&display=swap');

analyzer/package-lock.json

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analyzer/public/manifest.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,21 @@
88
"theme_color": "#ffffff",
99
"icons": [
1010
{
11-
"src": "icons/icon-192x192.png",
12-
"sizes": "192x192",
13-
"type": "image/png"
14-
},
15-
{
16-
"src": "icons/icon-512x512.png",
17-
"sizes": "512x512",
18-
"type": "image/png"
11+
"src": "https://i.postimg.cc/3NFg6y0Q/Analyze-your-Dev-to-posts-httpsdev-to-rater-xyz-2-photoaidcom-cropped.png",
12+
"type": "image/png",
13+
"sizes": "512x512"
1914
}
2015
],
2116
"routes": [
2217
{
2318
"path": "/",
2419
"name": "Home",
25-
"title": "DevTo Rater - Home"
20+
"title": "DevTo Rater | Homepage"
2621
},
2722
{
2823
"path": "/rater",
2924
"name": "Post Analyzer",
30-
"title": "DevTo Post Analyzer"
25+
"title": "DevTo Post | Analyzer"
3126
},
3227
{
3328
"path": "/blogs",

analyzer/src/components/Blogs/BlogsSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ const BlogsSection = () => {
109109
transition={{ delay: index * 0.2, duration: 0.5 }}
110110
>
111111
<img
112+
loading="lazy"
112113
src={post.image}
113114
alt={post.title}
114115
className="w-full h-48 sm:h-56 object-cover"

analyzer/src/components/Features/ReadingTimeBox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const ReadingTimeBox = () => {
1717
</div>
1818
</div>
1919
<img
20+
loading="lazy"
2021
src={readingTime}
2122
alt="Dev.to Rater - Reading time of blog post"
2223
className="w-full mt-5 h-full overflow-auto object-cover select-none"

analyzer/src/components/Features/WordFrequencyBox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const WordFrequencyBox = () => {
2020
</div>
2121
<div className="flex justify-center h-full p-8 w-full">
2222
<img
23+
loading="lazy"
2324
className="select-none object-contain"
2425
src={wordFrequency}
2526
alt="Dev.to Rater - Word repetition frequency"

analyzer/src/components/Footer/Footer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ const Footer = () => {
4242
className="flex items-center mb-4 sm:mb-0 space-x-3 rtl:space-x-reverse"
4343
onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
4444
>
45-
<img src={logo} className="h-8" alt="Dev.to Rater Logo" />
45+
<img
46+
loading="lazy"
47+
src={logo}
48+
className="h-8"
49+
alt="Dev.to Rater Logo"
50+
/>
4651
</Link>
4752

4853
<ul className="flex flex-wrap items-center mb-6 text-sm font-medium text-gray-400 sm:mb-0 dark:text-gray-400">

analyzer/src/components/Header.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ const Header = () => (
88
Dev.to Rater
99
</h1>
1010
<Link to={'/'}>
11-
<img className="ml-4 w-13 h-13" src={logo} alt="Dev.to Rater Logo" />
11+
<img
12+
className="w-13 h-13 transition-transform duration-300 hover:rotate-10 ease-in-out"
13+
src={logo}
14+
alt="Dev.to Rater Logo"
15+
/>
1216
</Link>
1317
</div>
1418
<div className="flex justify-start w-full mt-3 text-gray-800 dark:text-white">

analyzer/src/components/HomePage/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ const Card: React.FC<CardProps> = React.memo(
3131
<div className="flex flex-col justify-between h-full">
3232
<Suspense fallback={<Spinner />}>
3333
<img
34+
loading="lazy"
3435
height={'100px'}
3536
width={'100px'}
3637
src={card.imgSrc}
37-
loading="lazy"
3838
className="m-auto"
3939
alt="Dev.to Rater's social media"
4040
/>

analyzer/src/components/HomePage/Header.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ const Header = () => {
3939
<header className="sticky top-0 flex justify-between items-center w-full px-6 md:px-10 border-b border-gray-800 h-18 backdrop-blur-sm z-50 bg-opacity-60">
4040
<div className="flex items-center">
4141
<Link to="/" className="flex items-center">
42-
<img src={logo} alt="Dev.to Rater Logo" className="w-8 mr-2" />
42+
<img
43+
src={logo}
44+
alt="Dev.to Rater Logo"
45+
className="w-8 mr-2"
46+
loading="lazy"
47+
/>
4348
</Link>
4449

4550
<nav className="hidden md:flex items-center ml-8">

analyzer/src/components/HomePage/TrustedBySection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const TrustedBySection = () => {
1919
<div key={index} className="relative mb-4">
2020
<a href={image.link} target="_blank" rel="noopener noreferrer">
2121
<img
22+
loading="lazy"
2223
src={image.src}
2324
alt={`Dev.to Writer ${index + 1}`}
2425
className={`rounded-full w-16 h-16 object-cover z-10 transition-transform duration-300 ease-in-out transform hover:scale-110 hover:-rotate-3`}

analyzer/src/components/PromotedPosts.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const PromotedPosts = ({ triggerRefetch }: { triggerRefetch: boolean }) => {
7373
className="hover:opacity-70 post-history-item flex items-center space-x-4 bg-white p-1 rounded-xl shadow-md hover:shadow-lg cursor-pointer transition duration-300"
7474
>
7575
<img
76+
loading="lazy"
7677
src={
7778
post.post_thumbnail ||
7879
'https://static-00.iconduck.com/assets.00/dev-to-icon-2048x2048-4i261myk.png'

analyzer/src/components/RepeatedWords.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const RepeatedWords = ({ content }: { content: FinalResponse | null }) => {
110110
position="right"
111111
textAnchor="middle"
112112
dx={1}
113-
fill={'#fff'}
113+
fill={'#000'}
114114
/>
115115
</Bar>
116116
</BarChart>

analyzer/src/components/ScannedPostsHistory.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const ScannedPostsHistory: React.FC<ScannedPostsHistoryProps> = ({
7272
className="post-history-item flex items-center space-x-4 backdrop-blur-2xl hover:scale-101 p-5 rounded-xl shadow-md hover:shadow-lg cursor-pointer transition duration-300"
7373
>
7474
<img
75+
loading="lazy"
7576
src={
7677
post.imageUrl ||
7778
'https://static-00.iconduck.com/assets.00/dev-to-icon-2048x2048-4i261myk.png'
@@ -92,6 +93,7 @@ const ScannedPostsHistory: React.FC<ScannedPostsHistoryProps> = ({
9293
.map((reaction, index) => (
9394
<p key={index} className="flex items-center">
9495
<img
96+
loading="lazy"
9597
src={
9698
reactionEmojis[
9799
reaction.category as keyof typeof reactionEmojis

analyzer/src/components/ScrollToTopButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const ScrollToTopButton = () => {
2929
rel="noopener noreferrer"
3030
>
3131
<img
32+
loading="lazy"
3233
src={productHunt}
3334
alt="Dev.to Rater - Analyze blog posts to uncover trends and metrics | Product Hunt"
3435
width="65"

analyzer/src/components/SubHeader.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const SubHeader = () => {
4444
onClick={handleRepoClick}
4545
>
4646
<img
47+
loading="lazy"
4748
alt="GitHub repository stars badge"
4849
src="https://img.shields.io/github/stars/perisicnikola37/dev-to-rater"
4950
/>

analyzer/src/pages/DevToPostAnalyzer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ const DevToPostAnalyzer = () => {
5454
trackSubmitEvent(inputURL)
5555
setSubmittedURL(inputURL)
5656
fetchHTMLContent(inputURL)
57+
changeScannedPostsCount(1)
5758
}
58-
changeScannedPostsCount(1)
5959
}
6060

6161
useEffect(() => {

0 commit comments

Comments
 (0)