Skip to content

Commit

Permalink
docs: fix sponsored by breaking mobile view on home page and add carb…
Browse files Browse the repository at this point in the history
…on ads on home page
  • Loading branch information
danielbarion committed Sep 18, 2023
1 parent 01d9afb commit 3cb6308
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/src/components/HomepageSponsored/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.features {
display: flex;
align-items: center;
padding: 2rem 0;
width: 100%;
flex-direction: column;
}

.featureSvg {
Expand All @@ -15,3 +13,13 @@
display: flex;
justify-content: center;
}

@media screen and (min-width: 1024px) {
.features {
display: flex;
align-items: center;
flex-direction: row;
padding: 2rem 0;
width: 100%;
}
}
56 changes: 56 additions & 0 deletions docs/src/pages/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,62 @@
overflow: hidden;
}

.heroAds {
position: absolute;
left: 0;
top: 12px;
}

@media screen and (min-width: 375px) {
.heroAds {
top: 4rem;
}
}

@media screen and (min-width: 425px) {
.heroAds {
left: unset;
top: 8px;
}
}

@media screen and (min-width: 768px) {
.heroAds {
transform: translateX(calc(50% - 30px));
}
}

@media screen and (min-width: 1024px) {
.heroAds {
top: 10rem;
transform: unset;
}
}

@media screen and (min-width: 1256px) {
.heroAds {
left: 4rem;
}
}

@media screen and (min-width: 1440px) {
.heroAds {
left: 8rem;
}
}

@media screen and (min-width: 2000px) {
.heroAds {
left: 16rem;
}
}

@media screen and (min-width: 2560px) {
.heroAds {
left: 32rem;
}
}

@media screen and (max-width: 996px) {
.heroBanner {
padding: 2rem;
Expand Down
4 changes: 4 additions & 0 deletions docs/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
import Layout from '@theme/Layout'
import HomepageFeatures from '@site/src/components/HomepageFeatures'
import HomepageSponsored from '@site/src/components/HomepageSponsored'
import AdsContainerElement from '@site/src/components/AdsContainerElement'

import styles from './index.module.css'

Expand All @@ -28,6 +29,9 @@ function HomepageHeader() {
</Link>
</div>
</div>
<div className={styles.heroAds}>
<AdsContainerElement />
</div>
</header>
)
}
Expand Down

0 comments on commit 3cb6308

Please sign in to comment.