ISSUE-031 - Big update. AngledFlag component is born!
It's not 100% complete - I still need to add the second, slightly offset sub flag that goes beneath the main flag, creating a sort of refractive-glass/parallax effect. Needed to add a new workspace. Thankfully it's pretty easy to add a new workspace. So, kinda nice. Did a lot of work making 2:1 versions of each flag in vector. Was a bit of a pain in the ass. Renamed a prop for ProgressSlider, "onBarColor" because prefixing a prop with "on" is special for React and it gets upset and spits out an error.
This commit is contained in:
1 parent
55e07a444e
commit
4a9c124832
46 files changed
+1063
-70
No files matched your search
@@ -0,0 +1,107 @@
|
||||
import styled from "styled-components";
|
||||
import { Px } from "../../../../types/style";
|
||||
|
||||
type ContainerProps = {
|
||||
height: Px,
|
||||
width: Px,
|
||||
};
|
||||
export const Container = styled.div<ContainerProps>`
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
width: ${({ width }) => `${width}px`};
|
||||
height: ${({ height }) => `${height}px`};
|
||||
mask-image: linear-gradient(
|
||||
to bottom,
|
||||
transparent 0%,
|
||||
transparent 10%,
|
||||
black 40%,
|
||||
black 60%,
|
||||
transparent 90%,
|
||||
transparent 100%
|
||||
);
|
||||
`;
|
||||
|
||||
type NationalFlagProps = {
|
||||
height: Px,
|
||||
};
|
||||
export const NationalFlag = styled.img<NationalFlagProps>`
|
||||
max-inline-size: unset;
|
||||
height: ${({ height }) => `${height}px`};
|
||||
clip-path: polygon(50% 0, 100% 0, 100% 30%, 60% 100%, 0 100%, 0 100%);
|
||||
mask-image: linear-gradient(
|
||||
to right,
|
||||
transparent 0%,
|
||||
black 15%,
|
||||
black 85%,
|
||||
transparent 100%
|
||||
);
|
||||
mask-image: radial-gradient(
|
||||
circle at center,
|
||||
black 0%,
|
||||
black 80%,
|
||||
transparent 96%,
|
||||
transparent 100%
|
||||
);
|
||||
`;
|
||||
NationalFlag.displayName = "NationalFlag";
|
||||
|
||||
type SlashProps = {
|
||||
x: Px,
|
||||
height: Px,
|
||||
girth: Px,
|
||||
};
|
||||
export const Sheen = styled.div<SlashProps>`
|
||||
position: absolute;
|
||||
height: ${({ height }) => `${height}px`};
|
||||
width: ${({ girth }) => `${girth}px`};
|
||||
|
||||
background: linear-gradient(
|
||||
to top,
|
||||
transparent 0%,
|
||||
transparent 20%,
|
||||
rgba(255, 255, 255, 0.15) 45%,
|
||||
rgba(255, 255, 255, 0.15) 55%,
|
||||
transparent 80%,
|
||||
transparent 100%
|
||||
);
|
||||
font-size: ${({ height }) => `${height}px`}; // Hack to let me use em.
|
||||
|
||||
box-shadow:
|
||||
0.02em 0 0.005em 0.015em rgba(0, 0, 0, 0.2),
|
||||
1em 0 0 1em rgba(0, 0, 0, 0.1);
|
||||
transform: skew(-45deg, 0deg) translateX(${({ x }) => `${x}px`});
|
||||
|
||||
border-left: 0.015em solid rgba(255, 255, 255, 0.25);
|
||||
`;
|
||||
Sheen.displayName = "Sheen";
|
||||
|
||||
export const Slant = styled.div<SlashProps>`
|
||||
position: absolute;
|
||||
height: ${({ height }) => `${height}px`};
|
||||
width: ${({ girth }) => `${girth}px`};
|
||||
|
||||
background: #1a1a28;
|
||||
transform: skewX(-45deg) translateX(${({ x }) => `${x}px`});
|
||||
`;
|
||||
Slant.displayName = "Slant";
|
||||
|
||||
export const NationalFlagEdge = styled.div<SlashProps>`
|
||||
position: absolute;
|
||||
height: ${({ height }) => `${height}px`};
|
||||
width: ${({ girth }) => `${girth}px`};
|
||||
|
||||
background: ${p => p.theme.colors.lightGrey};
|
||||
opacity: 0.5;
|
||||
transform: skewX(-45deg) translateX(${({ x }) => `${x}px`});
|
||||
|
||||
mask-image: linear-gradient(
|
||||
to top,
|
||||
transparent 0%,
|
||||
transparent 10%,
|
||||
black 100%
|
||||
);
|
||||
`;
|
||||
Reference in new issue
Block a user