Skip to content

Commit e35d138

Browse files
committed
add glass bg
1 parent 30a86c0 commit e35d138

File tree

3 files changed

+27
-19
lines changed

3 files changed

+27
-19
lines changed
Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
.hoverInfo {
2-
z-index: 0;
1+
@import '../../../../style/mixins';
32

4-
&::before {
5-
filter: blur(10px);
6-
background-color: rgb(255 255 255 / 15%);
7-
height: 100%;
8-
width: 100%;
9-
content: ' ';
10-
position: absolute;
11-
inset: 0;
12-
z-index: -1;
13-
}
3+
.hoverInfo {
4+
@include glassBackground;
145

156
position: absolute;
16-
padding: 10px;
7+
z-index: 0;
178
max-width: 480px;
189
border-radius: 5px;
1910
}

src/features/cyberlinks/CyberlinksGraph/GraphHoverInfo/GraphHoverInfo.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,7 @@ function HoverInfo({ node, camera, size }: Props) {
4949
left: posX,
5050
}}
5151
>
52-
{isCid ? (
53-
// <CIDResolver cid={node.id} />
54-
<ContentItem cid={node.id} />
55-
) : (
56-
<Display>{node.id}</Display>
57-
)}
52+
{isCid ? <ContentItem cid={node.id} /> : <Display>{node.id}</Display>}
5853
</div>
5954
);
6055
}

src/style/mixins.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,25 @@
2525
height: 2px;
2626
}
2727
}
28+
29+
@mixin glass {
30+
backdrop-filter: blur(15px);
31+
box-shadow: 0px 0px 10px rgba(75, 0, 130, 0.09);
32+
background-color: rgba(75, 0, 130, 0.09);
33+
}
34+
35+
@mixin glassBackground {
36+
position: relative;
37+
38+
&:before {
39+
content: '';
40+
position: absolute;
41+
top: 0;
42+
left: 0;
43+
right: 0;
44+
bottom: 0;
45+
z-index: -1;
46+
47+
@include glass;
48+
}
49+
}

0 commit comments

Comments
 (0)