Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responsive sponsor ad #7228

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/assets/ag-charts-logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/ag-charts-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/ag-grid-logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/ag-grid-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion src/components/Site/Site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@
flex: 1 1 auto;
position: relative;
display: flex;
margin-top: 110px;

@media (min-width: 1525px) {
margin-top: 110px;
}

@media (max-width: 1524px) {
margin-top: 350px;
}

@media (max-width: 641px) {
margin-top: 350px;
}

@media print {
margin-top: 0px;
Expand Down
72 changes: 44 additions & 28 deletions src/components/Sponsors/Sponsors.jsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,57 @@
// Import External Dependencies
import Link from '../Link/Link';

// Imports for Ad Content
import AGLogo from '../../assets/ag-grid-logo.png';
import AGChartsLogo from '../../assets/ag-charts-logo.png';
import WebpackIcon from '../../assets/icon-square-small.svg';

// Load Styling
import '../Sponsors/Sponsors.scss';

// Create and export the component
const Sponsors = () => {
return (
<div className="sponsors">
<Link
className="sponsors__content"
to="https://www.ag-grid.com/?utm_source=webpack&utm_medium=banner&utm_campaign=sponsorship"
>
<img
src={AGLogo}
width={260}
height={140}
alt="ag grid"
loading="lazy"
/>
<img
className="sponsors__img__webpack"
src={WebpackIcon}
alt="webpack"
width={150}
height={150}
loading="lazy"
/>
<div className="sponsors__content-cont">
ag-grid is proud to partner with webpack
<div className="sponsors__content">
<div className="sponsors__buttons__wrapper">
<div className="sponsors__link-wrapper">
<Link to="https://www.ag-grid.com/?utm_source=webpack&utm_medium=banner&utm_campaign=sponsorship">
<img
className="agGridLogo"
src={AGLogo}
alt="ag grid"
loading="lazy"
/>
</Link>
</div>
<div className="sponsors__link-wrapper">
<Link to="https://charts.ag-grid.com/?utm_source=webpack&utm_medium=banner&utm_campaign=sponsorship">
<img
className="agChartsLogo"
src={AGChartsLogo}
alt="ag charts"
loading="lazy"
/>
</Link>
</div>
</div>
</Link>
<div className="sponsors__link-wrapper-2">
<Link to="https://www.ag-grid.com/?utm_source=webpack&utm_medium=banner&utm_campaign=sponsorship">
<div className="sponsors__tagline">
Datagrid and Charting for Enterprise Applications
</div>
<div className="sponsors__img__wrapper">
<img
src={WebpackIcon}
alt="webpack"
width={150}
height={150}
loading="lazy"
/>
</div>
<div className="sponsors__footer">
Proud to partner with webpack
</div>
</Link>
</div>
</div>
</div>
);
};

export default Sponsors;
261 changes: 229 additions & 32 deletions src/components/Sponsors/Sponsors.scss
Original file line number Diff line number Diff line change
@@ -1,43 +1,240 @@
@import 'functions';
@import 'mixins';

.sponsors {
position: absolute;
height: 100%;
width: 250px;
margin-left: -250px;

&__content-cont {
margin-top: 1rem;
font-size: 2em;
text-align: center;
color: #535353;
}
&__content {
position: sticky;
display: none;
margin-top: 1.5em;
top: 1.5em;
padding: 0 1.5em 3em;
flex-wrap: wrap;
justify-content: center;
align-items: flex-start;
align-content: flex-start;
border-right: 2px solid getColor(concrete);
overflow: hidden;
transition: background-color 250ms;

@include break(xlarge) {
$sponsor-text-color-dark: #cecece;
$sponsor-text-color-light: #535353;
$background-color-hover: rgb(50, 50, 50);
$link-wrapper-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.2);
$link-wrapper-shadow-dark: 0 3px 10px 0px rgba(255, 255, 255, 0.2);
$link-wrapper-radius: 8px;
$link-wrapper-margin: 8px;
$tagline-font-size: 2em;
$footer-font-size: 1.7em;
$tagline-font-size-mobile: 1.4em;
$footer-font-size-mobile: 1.2em;

[data-theme='dark'] {
.agGridLogo {
content: url('../../assets/ag-grid-logo-dark.png');
}

.agChartsLogo {
content: url('../../assets/ag-charts-logo-dark.png');
}

.sponsors {
&__tagline,
&__footer {
margin: 1rem 0;
text-align: center;
color: $sponsor-text-color-dark;
}
&__tagline {
font-size: $tagline-font-size;
}
&__footer {
font-size: $footer-font-size;
font-style: italic;
}
&__link-wrapper {
background: rgb(12, 12, 12);
box-shadow: $link-wrapper-shadow-dark;
border-radius: $link-wrapper-radius;
margin: $link-wrapper-margin;
transition: transform 0.2s;
&:hover {
background-color: $background-color-hover;
transform: scale(1.05);
}
}
}
}

@media (max-width: 642px) {
.agGridLogo {
height: 50px;
}

.agChartsLogo {
height: 50px;
}

.sponsors {
position: absolute;
height: auto;
width: 100%;
margin-top: -275px;

&__link-wrapper {
box-shadow: $link-wrapper-shadow;
border-radius: $link-wrapper-radius;
margin: $link-wrapper-margin;
transition: transform 0.2s;
&:hover {
background-color: getColor(concrete);
transform: scale(1.05);
}
}
&__tagline,
&__footer {
margin: 1rem 0;
text-align: center;
color: $sponsor-text-color-light;
}
&__tagline {
font-size: $tagline-font-size-mobile;
}
&__footer {
font-size: $footer-font-size-mobile;
font-style: italic;
}
&__content {
position: sticky;
display: flex;
margin: 1.5em 0;
top: 6em;
padding-bottom: 16px;
flex-wrap: wrap;
justify-content: center;
align-items: flex-start;
overflow: hidden;
transition: background-color 250ms;
}
&__img {
&__wrapper {
display: none;
}
}
}
}

@media (min-width: 642px) and (max-width: 1524px) {
.agGridLogo {
height: 50px;
}

.agChartsLogo {
height: 50px;
}

.sponsors {
position: absolute;
height: auto;
width: 100%;
margin-top: -240px;

&:hover {
background-color: getColor(concrete);
&__buttons__wrapper {
display: flex;
width: 100%;
flex-direction: row;
justify-content: center;
}
&__link-wrapper {
box-shadow: $link-wrapper-shadow;
border-radius: $link-wrapper-radius;
margin: $link-wrapper-margin;
transition: transform 0.2s;
&:hover {
background-color: getColor(concrete);
transform: scale(1.05);
}
}
&__tagline,
&__footer {
margin: 1rem 0;
text-align: center;
color: $sponsor-text-color-light;
}
&__tagline {
font-size: $tagline-font-size-mobile;
}
&__footer {
font-size: $footer-font-size-mobile;
font-style: italic;
}
&__content {
position: sticky;
display: flex;
flex-direction: column;
margin: 1.5em 0;
top: 6em;
flex-wrap: wrap;
justify-content: center;
align-items: center;
border-bottom: 2px solid getColor(concrete);
overflow: hidden;
transition: background-color 250ms;
padding-bottom: 32px;
}
&__img {
background: red !important;
&__wrapper {
display: none;
}
}
}
&__img {
&__webpack {
width: 100px;
}

@media (min-width: 1525px) {
.agGridLogo {
max-width: 220px;
height: auto;
}

.agChartsLogo {
max-width: 220px;
height: auto;
}

.sponsors {
position: absolute;
height: 100%;
width: 250px;
margin-left: -250px;
margin-right: 8px;

&__link-wrapper {
box-shadow: $link-wrapper-shadow;
border-radius: $link-wrapper-radius;
margin: $link-wrapper-margin;
transition: transform 0.2s;
&:hover {
background-color: getColor(concrete);
transform: scale(1.05);
}
}
&__tagline,
&__footer {
margin: 1rem 0;
text-align: center;
color: $sponsor-text-color-light;
}
&__tagline {
font-size: $tagline-font-size;
}
&__footer {
font-size: $footer-font-size;
font-style: italic;
}
&__content {
position: sticky;
display: flex;
margin: 1.5em 0;
top: 6em;
padding: 0 1.5em 3em;
flex-wrap: wrap;
justify-content: center;
align-items: flex-start;
border-right: 2px solid getColor(concrete);
overflow: hidden;
transition: background-color 250ms;
}
&__img {
&__wrapper {
display: flex;
justify-content: center;
width: 100%;
}
}
}
}
3 changes: 0 additions & 3 deletions src/styles/dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ body {
.footer__inner {
border-color: #252525;
}
.sponsors__content:hover {
background-color: #272727;
}
a,
button.as-link {
color: #69a8ee;
Expand Down