Skip to content

Commit 94858ae

Browse files
committed
添加微信算法交流群悬浮球
1 parent 9564fde commit 94858ae

File tree

4 files changed

+108
-0
lines changed

4 files changed

+108
-0
lines changed

public/wechat-group.png

328 KB
Loading

src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import VisualizationTab from './components/layout/VisualizationTab';
55
import CodeTab from './components/layout/CodeTab';
66
import ProblemDescription from './components/ProblemDescription';
77
import LinkedListCreator from './components/LinkedListCreator';
8+
import WechatGroupFloat from './components/WechatGroupFloat';
89
import { useStateManagement } from './hooks/algorithmSteps';
910
import { useAlgorithmSteps } from './hooks/useAlgorithmSteps';
1011

@@ -86,6 +87,8 @@ const App: React.FC = () => {
8687
}}
8788
/>
8889
)}
90+
91+
<WechatGroupFloat />
8992
</div>
9093
);
9194
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React, { useState } from 'react';
2+
3+
const WechatGroupFloat: React.FC = () => {
4+
const [showQR, setShowQR] = useState(false);
5+
6+
return (
7+
<div
8+
className="wechat-float"
9+
onMouseEnter={() => setShowQR(true)}
10+
onMouseLeave={() => setShowQR(false)}
11+
>
12+
<div className="float-btn">
13+
<span>💬</span>
14+
<span className="float-text">交流群</span>
15+
</div>
16+
17+
{showQR && (
18+
<div className="qr-popup">
19+
<img src={`${process.env.PUBLIC_URL}/wechat-group.png`} alt="微信群二维码" />
20+
<p>扫码发送 <strong>leetcode</strong> 加入算法交流群</p>
21+
</div>
22+
)}
23+
</div>
24+
);
25+
};
26+
27+
export default WechatGroupFloat;

src/index.css

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,3 +2064,81 @@ select:focus {
20642064
margin: 0.5rem 0;
20652065
}
20662066
}
2067+
2068+
2069+
/* ===== 微信交流群悬浮球 ===== */
2070+
.wechat-float {
2071+
position: fixed;
2072+
right: 20px;
2073+
bottom: 20px;
2074+
z-index: 1000;
2075+
}
2076+
2077+
.float-btn {
2078+
display: flex;
2079+
flex-direction: column;
2080+
align-items: center;
2081+
justify-content: center;
2082+
width: 56px;
2083+
height: 56px;
2084+
background: linear-gradient(135deg, #07c160, #06ad56);
2085+
border-radius: 50%;
2086+
cursor: pointer;
2087+
box-shadow: 0 4px 12px rgba(7, 193, 96, 0.4);
2088+
transition: all 0.3s ease;
2089+
}
2090+
2091+
.float-btn:hover {
2092+
transform: scale(1.1);
2093+
box-shadow: 0 6px 16px rgba(7, 193, 96, 0.5);
2094+
}
2095+
2096+
.float-btn span:first-child {
2097+
font-size: 20px;
2098+
}
2099+
2100+
.float-text {
2101+
font-size: 10px;
2102+
color: white;
2103+
margin-top: 2px;
2104+
}
2105+
2106+
.qr-popup {
2107+
position: absolute;
2108+
bottom: 70px;
2109+
right: 0;
2110+
background: white;
2111+
border-radius: 12px;
2112+
padding: 16px;
2113+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
2114+
text-align: center;
2115+
min-width: 200px;
2116+
}
2117+
2118+
.qr-popup::after {
2119+
content: '';
2120+
position: absolute;
2121+
bottom: -8px;
2122+
right: 20px;
2123+
width: 16px;
2124+
height: 16px;
2125+
background: white;
2126+
transform: rotate(45deg);
2127+
box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1);
2128+
}
2129+
2130+
.qr-popup img {
2131+
width: 180px;
2132+
height: 180px;
2133+
border-radius: 8px;
2134+
}
2135+
2136+
.qr-popup p {
2137+
margin: 12px 0 0;
2138+
font-size: 13px;
2139+
color: #666;
2140+
}
2141+
2142+
.qr-popup strong {
2143+
color: #07c160;
2144+
}

0 commit comments

Comments
 (0)