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

버블 컴포넌트 구현 완료 #20

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 14 additions & 0 deletions src/components/common/bubble/KeywordBubble.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Bubble.js
import { StyledBubbleDiv } from "./KeywordBubble.style";

export default function Bubble(props) {
return (
<StyledBubbleDiv
width={props.width}
height={props.height}
opacity={props.opacity}
>
{props.content}
</StyledBubbleDiv>
);
}
52 changes: 52 additions & 0 deletions src/components/common/bubble/KeywordBubble.style.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import styled from "styled-components";

export const StyledBubbleDiv = styled.div`
width: ${(props) => props.width || "100px"};
height: ${(props) => props.height || "100px"};
opacity: ${(props) => props.opacity || "1"};
background: radial-gradient(
circle,
white 0%,
white 30%,
rgba(196, 196, 196, 0.1) 40%,
#bfe9f6 90%,
#bfe9f6 100%
);
border: none;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
position: relative;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
font-size: ${(props) => parseInt(props.width || "100px") * 0.12}px;
color: #2a5676;

&:before {
content: "";
width: calc(${(props) => props.width || "100px"} * 0.35);
height: calc(${(props) => props.height || "100px"} * 0.13);
filter: blur(2px);
background: white;
position: absolute;
opacity: 0.6;
top: calc(${(props) => props.height || "100px"} * 0.08);
left: calc(50% - ${(props) => parseInt(props.width || "100px") * 0.35}px);
transform: rotate(-27deg);
border-radius: 50%;
z-index: 2;
}

&:after {
content: "";
width: calc(${(props) => props.width || "100px"} * 0.43);
height: calc(${(props) => props.height || "100px"} * 0.1);
filter: blur(3px);
background-color: #ccf3ff;
position: absolute;
opacity: 0.6;
top: calc(${(props) => props.height || "100px"} * 0.01);
left: calc(50% - ${(props) => parseInt(props.width || "100px") * 0.2}px);
border-radius: 50%;
}
`;