Skip to content

Commit

Permalink
fix: blog header mobile responsiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave-lab12 committed Sep 19, 2023
1 parent fa852b1 commit 0868d00
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
11 changes: 7 additions & 4 deletions src/components/Blog/Hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ const url = `/blog/${id}`;
<div class="hero__background__decoration"></div>
<div class="hero__content">
<h1 class="hero__title">{title}</h1>
<p class="hero__description" set:html={description} />
<div class="hero__description">
<p set:html={description} />
</div>
<div class="hero__cta">
<GlowingBtn href={url} text="Read more" fontSize="22px" />
<GlowingBtn href={url} text="Read more" fontSize="20px" />
</div>
</div>
<div class="hero__image">
<div class="hero__image m-auto md:m-0">
<img src={photo_url} alt="Image description" />
</div>
</section>
Expand Down Expand Up @@ -91,6 +93,7 @@ const url = `/blog/${id}`;
.hero__image img {
width: 100%;
max-width: 715px;
border-radius: 10px;
}
.hero_cta_img {
display: block;
Expand All @@ -112,7 +115,7 @@ const url = `/blog/${id}`;
display: inline-block;
width: 100%;
height: 100%;
max-width: 570px;
max-width: 500px;
max-height: 570px;
pointer-events: none;
}
Expand Down
10 changes: 5 additions & 5 deletions src/components/GlowingBtn.astro
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
export interface Props {
text: string;
href: string;
fontSize ?:string;
href: string;
fontSize?: string;
}
const { text, href ,fontSize} = Astro.props;
const { text, href, fontSize } = Astro.props;
---

<a class="btn" href={href} target="_blank">{text}</a>

<style define:vars={{ fontSize }}>
<style define:vars={{ fontSize }}>
.btn {
background: #ff8b92;
box-shadow: 0px 0px 10px #ff2358;
Expand All @@ -21,7 +21,7 @@ const { text, href ,fontSize} = Astro.props;
padding: 10px 16px;
text-align: center;
color: #343045;
font-weight: 700;
font-weight: 400;
font-size: var(--fontSize);
line-height: 28px;
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import GlowingBtn from "./GlowingBtn.astro";
<style>
.hero {
display: flex;
justify-content: space-between;
justify-content: space-around;
flex-direction: column-reverse;
align-items: center;
margin-top: 14px;
Expand Down

0 comments on commit 0868d00

Please sign in to comment.