Skip to content

Commit 3e615e2

Browse files
committed
feat: updated code
1 parent c988f1e commit 3e615e2

2 files changed

Lines changed: 44 additions & 11 deletions

File tree

packages/website/src/Pages/Home/home.css

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@
139139
display: flex;
140140
justify-content: center;
141141
align-items: center;
142-
filter: drop-shadow(0 2px 8px #ff6a1a22);
142+
background: var(--color-bg);
143+
border-radius: 5px;
143144
}
144145

145146
.portfolio-asset {
@@ -572,6 +573,39 @@
572573
line-height: 1.7;
573574
color: var(--color-text-secondary);
574575
margin: 0 0 2rem 0;
576+
max-height: 3.4em; /* ~2 lines */
577+
overflow: hidden;
578+
position: relative;
579+
transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
580+
opacity: 0.95;
581+
}
582+
583+
.featured-excerpt.see-more {
584+
max-height: 100vh;
585+
opacity: 1;
586+
transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
587+
}
588+
589+
.featured-excerpt::after {
590+
content: '';
591+
display: block;
592+
position: absolute;
593+
left: 0;
594+
right: 0;
595+
bottom: 0;
596+
height: 1.2em;
597+
background: linear-gradient(
598+
to bottom,
599+
rgba(255, 255, 255, 0),
600+
var(--color-bg) 90%
601+
);
602+
pointer-events: none;
603+
transition: opacity 0.3s;
604+
opacity: 1;
605+
}
606+
607+
.featured-excerpt.see-more::after {
608+
opacity: 0;
575609
}
576610

577611
.related-posts {
@@ -832,23 +866,22 @@
832866
width: 100%;
833867
}
834868
.see-more-blogs-btn {
835-
flex: 0 0 150px;
836-
min-width: 130px;
837-
max-width: 180px;
838-
margin-left: 0.5rem;
869+
flex: 0 0 30px;
870+
margin-left: 0.1rem;
839871
background: linear-gradient(
840872
90deg,
841873
var(--color-primary) 70%,
842874
var(--color-primary-two) 100%
843875
);
844876
color: var(--color-bg);
845877
border: none;
846-
border-radius: 12px;
878+
border-radius: 5px;
847879
font-size: 1.08rem;
848880
font-weight: 700;
849881
padding: 1.1rem 0.5rem;
850882
cursor: pointer;
851-
align-self: center;
883+
height: 90px;
884+
align-self: baseline;
852885
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
853886
display: flex;
854887
align-items: center;

packages/website/src/Pages/Home/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ const BlogList: React.FC<{ data: BlogPost[] }> = ({ data }) => {
513513
</div>
514514
<h2 className="featured-title">{featuredPost?.title}</h2>
515515
<p className="featured-excerpt">{featuredPost?.excerpt}</p>
516-
<button className="portfolio-btn">Read Article</button>
517516
{isMobile && (
518517
<div className="blog-preview-scroll">
519518
{previewPosts.map((post) => (
@@ -528,14 +527,15 @@ const BlogList: React.FC<{ data: BlogPost[] }> = ({ data }) => {
528527
</div>
529528
))}
530529
<button className="see-more-blogs-btn">
531-
See more blog posts <span className="see-more-icon"></span>
530+
<span className="see-more-icon"></span>
532531
</button>
533532
</div>
534533
)}
534+
<button className="portfolio-btn">Read Article</button>
535535
</div>
536536
</article>
537537

538-
<div className="related-posts">
538+
{!isMobile && <div className="related-posts">
539539
<div className="related-grid">
540540
<div className="featured-badge">Latest</div>
541541
{allPosts.map((post) => (
@@ -557,7 +557,7 @@ const BlogList: React.FC<{ data: BlogPost[] }> = ({ data }) => {
557557
</article>
558558
))}
559559
</div>
560-
</div>
560+
</div>}
561561
</div>
562562
</div>
563563
);

0 commit comments

Comments
 (0)