const component = () => {
return (
<Wrapper>
<Box backgroundImageSrc="https://picsum.photos/1500/1500">
<BoxContainer>
<Title>Man</Title>
<Menu>
<MenuItem>Clothes</MenuItem>
<MenuItem>Shoes</MenuItem>
<MenuItem>Bags</MenuItem>
</Menu>
</BoxContainer>
</Box>
<Box backgroundImageSrc="https://picsum.photos/1500/2200">
<BoxContainer>
<Title>Woman</Title>
<Menu>
<MenuItem>Clothes</MenuItem>
<MenuItem>Shoes</MenuItem>
<MenuItem>Bags</MenuItem>
</Menu>
</BoxContainer>
</Box>
</Wrapper>
);
};
export default component;
import styled from "styled-components";
export const Wrapper = styled.section`
margin: 40px auto;
width: 90%;
height: 780px;
display: flex;
`;
export const Menu = styled.ul`
margin-top: 80px;
display: none;
`;
export const MenuItem = styled.li`
cursor: pointer;
text-transform: uppercase;
text-align: center;
padding: 20px 80px;
font-family: Quicksand;
font-style: normal;
font-weight: 500;
font-size: 32px;
line-height: 40px;
color: #fff;
&:hover {
margin: -1px;
border: 1px solid rgba(255, 255, 255, 0.5);
}
`;
export const Box = styled.div`
width: 50%;
height: 100%;
background-image: url(${({ backgroundImageSrc }) => backgroundImageSrc});
background-blend-mode: overlay;
background-repeat: no-repeat;
background-size: cover;
&:hover {
background-image: url(${({ backgroundImageSrc }) => backgroundImageSrc}),
linear-gradient(rgba(61, 34, 21, 0.7), rgba(61, 34, 21, 0.7));
${Menu} {
display: block;
}
}
`;
export const BoxContainer = styled.div`
padding: 20% 25%;
height: 100%;
display: flex;
flex-flow: column nowrap;
align-items: center;
justify-content: flex-end;
`;
export const Title = styled.h1`
font-family: Rozha One;
font-style: normal;
font-weight: normal;
font-size: 72px;
line-height: 87%;
color: #fff;
`;
const path = require("path");
const webpackNodeExternals = require("webpack-node-externals");
module.exports = {
target: "node",
entry: "./server.js",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "build"),
publicPath: "/build"
},
module: {
rules: [
{
test: /\.js$/,
loader: "babel-loader",
exclude: "/node_modules/",
options: {
presets: [
"react",
"stage-0",
["env", { target: { browser: ["last 2 versions"] } }]
]
}
}
]
},
externals: [webpackNodeExternals()]
};