Skip to content

Commit

Permalink
Merge pull request #4400 from Shivam-AfA/caseStudyBanner
Browse files Browse the repository at this point in the history
  • Loading branch information
Chadha93 authored Jun 21, 2023
2 parents e55fdd4 + 5881181 commit e084757
Show file tree
Hide file tree
Showing 3 changed files with 255 additions and 0 deletions.
241 changes: 241 additions & 0 deletions src/components/Case-study-banner/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
import React, { useState, useEffect } from "react";
import styled from "styled-components";
import MesheryLogo from "../../assets/images/meshery/icon-only/meshery-logo-light.svg";
import SpireLogo from "../../collections/integrations/spire/icon/color/spire-color.svg";
import MesheryAndSpire from "../../collections/resources/articles/hpes-adoption-of-meshery-and-meshmap/meshery-and-hpe.svg";


const BannerWrapper = styled.div`
.large-screen {
display: flex;
max-width: 100%;
overflow: hidden;
margin: 5% 0%;
@media screen and (max-width: 600px) {
display: none;
}
}
.left-img {
display: flex;
background: ${props => props.theme.bannerGradientBackgroundToWhite};
flex: 0 0 20%;
text-align: center;
justify-content: center;
/* border: 1px solid;
border-color: ${props => props.theme.whiteToBlack};
border-bottom-width: 2px; */
border: 2px solid transparent;
border-image: ${props => props.theme.borderGradientTransitionBefore};
border-image-slice: 1 1 1 1;
transition: border 0.4s ease-in-out;
transform-origin: top right;
transform: skewX(-25deg);
padding: 3%;
}
.left-img > * {
transition: transform 0.4s ease;
transform: skewX(25deg); /* Counteract the parent's skew */
width: 40%;
}
.desc {
display: flex;
background:${props => props.theme.bannerDescriptionGradient};
flex: 0 0 60%;
text-align: center;
border: 2px solid #00b39f;
/* border-image: ${props => props.theme.borderGradientTransitionBefore} ;
border-image-slice: 1 1 1 1; */
transition: border 0.4s ease-in-out;
justify-content: center;
align-items: center;
transform: skewX(-25deg);
h2 {
text-align: center;
width: 80%;
color: #fff;
@media screen and (max-width: 800px) {
font-size: 1.25rem;
}
@media screen and (max-width: 600px) {
font-size: 1rem;
}
}
}
.desc > * {
transform: skewX(25deg); /* Counteract the parent's skew */
}
.right-img {
display: flex;
background: ${props => props.theme.bannerGradientBackground2ToWhite};
flex: 0 0 20%;
text-align: center;
justify-content: center;
/* border: 1px solid;
border-bottom-width: 2px;
border-color: #00b39f; */
border: 2px solid transparent;
border-image: ${props => props.theme.borderGradientTransitionBefore};
border-image-slice: 1 1 1 1;
transition: border 0.4s ease-in-out;
transform-origin: bottom left;
transform: skewX(-25deg);
padding: 3%;
}
.right-img > * {
transition: transform 0.4s ease;
transform: skewX(25deg); /* Counteract the parent's skew */
width: 40%;
}
.scale-on-hover {
border-image: ${props => props.theme.borderGradientTransitionAfter} ;
border-image-slice: 1 1 1 1;
transition: 0.4s ease-in-out;
> * {
transition: transform 0.4s ease;
transform: skewX(25deg) scale(1.4);
}
}
.desc-hover {
/* border-image: ${props => props.theme.borderGradientTransitionAfter} ;
border-image-slice: 1 1 1 1;
transition: 0.4s ease-in-out; */
}
.ribbon {
display: flex;
align-items: center;
position: absolute;
right: -3px;
top: -5px;
z-index: 1;
overflow: hidden;
width: 120px;
height: 120px;
text-align: right;
span {
padding-left: 1.75rem;
font-size: 13px;
font-weight: bold;
color: ${props => props.theme.whiteToBlack};
text-transform: uppercase;
text-align: center;
line-height: 20px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
width: 150px;
display: block;
background: #79A70A;
background: ${props => props.theme.yellowEBC0EBToGradient};
box-shadow: 0 3px 10px -5px #000;
position: absolute;
top: 20px;
right: -19px;
}
span:before {
content: "";
position: absolute;
left: 0px;
top: 100%;
z-index: -1;
border-left: 3px solid #00B39F;
border-right: 3px solid transparent;
border-bottom: 3px solid transparent;
border-top: 3px solid #00B39F;
}
span:after {
content: "";
position: absolute;
right: 0px;
top: 100%;
z-index: -1;
border-left: 3px solid transparent;
border-right: 3px solid #00B39F;
border-bottom: 3px solid transparent;
border-top: 3px solid #00B39F;
}
}
.small-screen {
display: none;
text-align: center;
align-items: center;
justify-content: center;
flex-direction: column;
@media screen and (max-width: 600px) {
display: flex;
}
.small-screen-desc {
width: 80%;
}
.meshery-and-spire {
margin-top: 5%;
width: 80%;
border: 1px solid #fff;
}
}
`;

const CaseStudyBanner = () => {

const [hover, setHover] = useState(false);

const handleHover = () => {
setHover(true);
};

const handleLeave = () => {
setHover(false);
};

return (
<>
<a href="/resources/cloud-native/hpes-adoption-of-meshery-and-meshmap">
<BannerWrapper>
<div className="small-screen">
<div className="small-screen-desc">
<h2>Discover how HPE uses Meshery to manage SPIRE</h2>
</div>
<div className="meshery-and-spire">
<img src={MesheryAndSpire} alt="meshery-and-spire" />
</div>
</div>
<div className="large-screen">
<div className={`left-img ${hover ? "scale-on-hover" : ""}`} onMouseEnter={handleHover} onMouseLeave={handleLeave}>
<img src={MesheryLogo} alt="meshery-logo" />
</div>
<div className={`desc ${hover ? "desc-hover" : ""}`} onMouseEnter={handleHover} onMouseLeave={handleLeave}>
<h2>Discover how HPE uses Meshery to manage SPIRE</h2>
<div className="ribbon">
<span>Case Study</span>
</div>
</div>
<div className={`right-img ${hover ? "scale-on-hover" : ""}`} onMouseEnter={handleHover} onMouseLeave={handleLeave}>
<img src={SpireLogo} alt="spire-logo" />
</div>
</div>
</BannerWrapper>
</a>
</>
);
};

export default CaseStudyBanner;
2 changes: 2 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import CornerPopup from "../components/Corner-popup";
const CloudNativeManagement = loadable(() => import("../sections/Home/CloudNativeManagement"));
const SubscribeSection = loadable(() => import("../sections/subscribe/subscribe"));
const ServiceMeshFocussed = loadable(() => import("../sections/Home/Service-mesh-focussed"));
import CaseStudyBanner from "../components/Case-study-banner";


const SoSpecial = loadable(() => import("../sections/Home/So-Special-Section"));
Expand All @@ -23,6 +24,7 @@ const IndexPage = () => {
<Banner />
<Integrations />
<Partners />
<CaseStudyBanner/>
<CornerPopup/>
{/* <Features /> */}
{/* <ServiceMeshManagement /> */}
Expand Down
12 changes: 12 additions & 0 deletions src/theme/app/themeStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,13 @@ const lighttheme = {
whiteZeroFiveToBlackZeroFive: "rgb(0 0 0 / 0.05)",
whiteZeroThreeToBlackZeroOne: "rgb(0 0 0 / 0.01)",
whiteZeroThreeToBlackZeroThree: "rgb(0 0 0 / 0.03)",
yellowEBC0EBToGradient: "rgb(235, 192, 23)",
integrationsGraphicGradient: "linear-gradient(90deg, #000000 0%, #00D3A9 100%)",
bannerGradientBackgroundToWhite: "#fff",
bannerGradientBackground2ToWhite: "#fff",
bannerDescriptionGradient: "linear-gradient(122.25deg, #00B39F 26.92%, #195E4A 46.51%, #1F787D 74.85%)",
borderGradientTransitionBefore: "linear-gradient(to right bottom, #00b39f, #fff 110%)",
borderGradientTransitionAfter: "linear-gradient(to left top, #00b39f, #fff 120%)",

//DarkTheme
DarkTheme: false,
Expand Down Expand Up @@ -429,11 +435,17 @@ export const darktheme = {
whiteToGreyB3B3B3: "#FFFFFF",
whiteToGreyE6E6E6: "#FFFFFF",
whiteToRed662839: "#FFFFFF",
yellowEBC0EBToGradient: "linear-gradient(#00D3A9 0%, #00B39F 100%)",
whiteZeroEightToBlackZeroEight: "rgb(255 255 255 / 0.08)",
whiteZeroFiveToBlackZeroFive: "rgb(255 255 255 / 0.05)",
whiteZeroThreeToBlackZeroOne: "rgb(255 255 255 / 0.03)",
whiteZeroThreeToBlackZeroThree: "rgb(255 255 255 / 0.03)",
integrationsGraphicGradient: "linear-gradient(90.01deg, rgba(18, 18, 18, 0.16) 0.01%, rgba(71, 126, 150, 0.26) 51.1%, rgba(0, 179, 159, 0.54) 99.99%)",
bannerGradientBackgroundToWhite: "linear-gradient(90.01deg, rgba(0, 179, 159, 0.54) 0.53%, rgba(71, 126, 150, 0.26) 51.1%, rgba(18, 18, 18, 0.16) 99.99%)",
bannerGradientBackground2ToWhite: "linear-gradient(90.01deg, rgba(18, 18, 18, 0.16) 0.01%, rgba(71, 126, 150, 0.26) 49.9%, rgba(0, 179, 159, 0.54) 99.47%)",
bannerDescriptionGradient: "#121212",
borderGradientTransitionBefore: "linear-gradient(to right top, #00b39f, #121212 80%)",
borderGradientTransitionAfter: "linear-gradient(to left top, #00b39f, #121212 100%)",

//DarkTheme
DarkTheme: true,
Expand Down

0 comments on commit e084757

Please sign in to comment.