Skip to content

Commit

Permalink
feat: add 1024 activity banner (#5171)
Browse files Browse the repository at this point in the history
  • Loading branch information
zjy365 authored Oct 24, 2024
1 parent 786c518 commit a46c48a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 38 deletions.
52 changes: 26 additions & 26 deletions docs/website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,32 +75,32 @@ const config = {

themeConfig: { // @type {import('@docusaurus/preset-classic').ThemeConfig}
metadata: [{ name: 'title', content: 'Sealos by 环界云' }],
announcementBar: {
id: 'sealos_tip',
content: `
<div class="sealos-banner-box">
<div>${isDomesticSite ? 'If you are an international user, please visit 👉' : '如果您是国内用户,请直接访问 👉 '}</div>
<div class="sealos-banner-btn" onclick="window.open('${isDomesticSite ? 'https://sealos.io' : 'https://sealos.run'}', '_blank');">
${isDomesticSite ? 'International Site' : '国内官网'}
</div>
<svg
onclick="handleBannerClose()"
width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_1145_366)">
<path d="M12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22Z" fill="white" fill-opacity="0.16"/>
<path d="M12 21.75C6.61507 21.75 2.25 17.3849 2.25 12C2.25 6.61507 6.61507 2.25 12 2.25C17.3849 2.25 21.75 6.61507 21.75 12C21.75 17.3849 17.3849 21.75 12 21.75Z" stroke="white" stroke-opacity="0.1" stroke-width="0.5"/>
<path d="M9.17184 7.75696L11.9998 10.586L14.8278 7.75696L16.2428 9.17196L13.4138 12L16.2428 14.828L14.8278 16.243L11.9998 13.414L9.17184 16.243L7.75684 14.828L10.5858 12L7.75684 9.17196L9.17184 7.75696Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_1145_366">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>
</div>
`,
isCloseable: true,
},
// announcementBar: {
// id: 'sealos_tip',
// content: `
// <div class="sealos-banner-box">
// <div>${isDomesticSite ? 'If you are an international user, please visit 👉' : '如果您是国内用户,请直接访问 👉 '}</div>
// <div class="sealos-banner-btn" onclick="window.open('${isDomesticSite ? 'https://sealos.io' : 'https://sealos.run'}', '_blank');">
// ${isDomesticSite ? 'International Site' : '国内官网'}
// </div>
// <svg
// onclick="handleBannerClose()"
// width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
// <g clip-path="url(#clip0_1145_366)">
// <path d="M12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22Z" fill="white" fill-opacity="0.16"/>
// <path d="M12 21.75C6.61507 21.75 2.25 17.3849 2.25 12C2.25 6.61507 6.61507 2.25 12 2.25C17.3849 2.25 21.75 6.61507 21.75 12C21.75 17.3849 17.3849 21.75 12 21.75Z" stroke="white" stroke-opacity="0.1" stroke-width="0.5"/>
// <path d="M9.17184 7.75696L11.9998 10.586L14.8278 7.75696L16.2428 9.17196L13.4138 12L16.2428 14.828L14.8278 16.243L11.9998 13.414L9.17184 16.243L7.75684 14.828L10.5858 12L7.75684 9.17196L9.17184 7.75696Z" fill="white"/>
// </g>
// <defs>
// <clipPath id="clip0_1145_366">
// <rect width="24" height="24" fill="white"/>
// </clipPath>
// </defs>
// </svg>
// </div>
// `,
// isCloseable: true,
// },
algolia: {
// Algolia 提供的应用 ID
appId: "SLTSB7B9Y0",
Expand Down
19 changes: 8 additions & 11 deletions docs/website/src/components/SaleBanner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ export default function SaleBanner() {
setIsBannerVisible(false);
};

const goDetailFeishu = () => {
window.open(
`https://fael3z0zfze.feishu.cn/wiki/SzKowEuQji5coRkm5o8cm8oJn3L?from=from_copylink`,
'_blank'
);
const goDetail = () => {
window.open(`https://mp.weixin.qq.com/s/jzOfviMgXD85r2zMQWskvA`, '_blank');
};

useEffect(() => {
Expand All @@ -36,8 +33,8 @@ export default function SaleBanner() {
return (
<>
<div className="sealos-banner-box">
<Translate>🎉Sealos 6.18 福利大放送!充值优惠限时开启,多充多送还有精美周边!</Translate>
<div className="sealos-banner-btn" onClick={goDetailFeishu}>
<Translate>🎉 1024 程序员节福利 Sealos 免费送你云资源</Translate>
<div className="sealos-banner-btn" onClick={goDetail}>
活动详情
<DrawIcon />
</div>
Expand All @@ -50,13 +47,13 @@ export default function SaleBanner() {
<span className="txt">Sealos</span>
</div>
<div className="sealos-banner-body">
<div className="banner-title">🎉Sealos 6.18 福利大放送!</div>
<div className="banner-subtitle">充值优惠限时开启</div>
<div className="banner-subtitle">多充多送还有精美周边!</div>
<div className="banner-title">🎉 Sealos 免费送你云资源</div>
<div className="banner-subtitle">1024 充值优惠限时开启</div>
<div className="banner-subtitle">体验Devbox,即送20余额</div>
<div
className="btn"
onClick={() => {
window.open(`${cloudUrl}/?openapp=system-costcenter?openRecharge=true`, '_blank');
window.open(`${cloudUrl}/?openapp=system-devbox?openRecharge=true`, '_blank');
closeBanner();
}}
>
Expand Down
2 changes: 1 addition & 1 deletion docs/website/src/pages/components/Header/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
justify-content: center;
align-items: center;
flex-direction: column;
// padding-top: 48px; // sale
padding-top: 48px; // sale

.header-img {
width: 100%;
Expand Down
1 change: 1 addition & 0 deletions docs/website/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const Home = () => {
</Helmet>
<Layout>
<div className="home">
<SaleBanner />
<HomeHeader isPc={isPc} />
<Capability isPc={isPc} />
<Introduce isPc={isPc} />
Expand Down

0 comments on commit a46c48a

Please sign in to comment.