diff --git a/public/site/css/ad.css b/public/site/css/ad.css index ba960531c..08785c73b 100644 --- a/public/site/css/ad.css +++ b/public/site/css/ad.css @@ -8,6 +8,7 @@ background-position: center; background-repeat: no-repeat; } + header .ad { width: 100vw; height: 0; @@ -54,6 +55,7 @@ header .ad .ad-content .ad-close { background: rgba(0, 0, 0, 0.2); transition: all 0.3s; } + header .ad .ad-content .ad-close:hover { background: rgba(0, 0, 0, 0.15); } @@ -438,3 +440,118 @@ footer.ad-footer .footer-layout { grid-template-columns: repeat(1, 1fr); } } + +.ad-dialog { + position: fixed; + z-index: 10000; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: none; +} + +.ad-dialog.show { + display: flex; + justify-content: center; + align-items: center; +} + +.ad-dialog .ad-dialog-backdrop { + position: absolute; + z-index: 10010; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: #0000001f; +} + +.ad-dialog .ad-dialog-wrapper { + z-index: 10020; + min-height: 200px; + min-width: 200px; + max-width: 320px; + max-height: 480px; + + background-color: #fff; + border-radius: 16px; + padding: 24px; + + box-shadow: 0px 4px 16px 8px #00000014; + + display: flex; + flex-direction: column; +} + +.ad-dialog .ad-dialog-wrapper .ad-dialog-header { + display: flex; + justify-content: center; + align-items: center; + + flex-grow: 0; + flex-shrink: 0; + padding: 8px 12px; +} + +.ad-dialog .ad-dialog-wrapper .ad-dialog-header .ad-dialog-header-img { + height: 240px; + width: 240px; + background-image: url(../img/side_nav_wechat.png); + background-size: cover; + background-position: center; + background-repeat: no-repeat; +} + +.ad-dialog .ad-dialog-wrapper .ad-dialog-content { + display: flex; + justify-content: center; + align-items: center; + + flex-grow: 1; + flex-shrink: 0; + padding: 8px 12px; + + font-size: 14px; + color: #727570; +} + +.ad-dialog .ad-dialog-wrapper .ad-dialog-footer { + display: flex; + justify-content: center; + align-items: center; + + flex-grow: 0; + flex-shrink: 0; + padding: 8px 12px; +} + +.ad-dialog .ad-dialog-wrapper .ad-dialog-footer .ad-dialog-footer-btn { + width: 100%; + + height: 40px; + padding: 10px 16px 10px 16px; + border-radius: 8px; + background: linear-gradient( + 104.43deg, + #ff7155 1.18%, + #ef3e56 46.98%, + #ee61d4 93.24% + ); + border: none; + font-size: 16px; + font-weight: 500; + line-height: 20px; + text-align: center; + color: #fff; + cursor: pointer; +} + +.ad-dialog .ad-dialog-wrapper .ad-dialog-footer .ad-dialog-footer-btn:hover { + background: linear-gradient( + -104.43deg, + #ff7155 1.18%, + #ef3e56 46.98%, + #ee61d4 93.24% + ); +} diff --git a/public/site/en/ad.html b/public/site/en/ad.html index d13e21d3d..aeae39608 100644 --- a/public/site/en/ad.html +++ b/public/site/en/ad.html @@ -27,6 +27,22 @@ + +
+
+
+
+
+
+
+ Please scan the QR code to add our WeChat customer service representative for purchase +
+ +
+
+
diff --git a/public/site/js/ad.js b/public/site/js/ad.js index f87e705fc..bdb1da634 100644 --- a/public/site/js/ad.js +++ b/public/site/js/ad.js @@ -28,6 +28,8 @@ document.addEventListener("DOMContentLoaded", function () { fetchAdIntro(language); manageAnimate(); + + handleDialog(); } else { // 如果不是广告页面,插入广告样式表并获取广告栏 insertAdStylesheet(); @@ -370,8 +372,7 @@ async function handleAdPlanPlans(plans) { const planItemEl = document.createElement("div"); planItemEl.className = `plan-item ${plan.activated ? "active" : "" }`; - planItemEl.innerHTML = - ` + planItemEl.innerHTML = `
${plan.title}
@@ -382,12 +383,14 @@ async function handleAdPlanPlans(plans) { ${plan.price.payment ?? ""} - + ${plan.price.original ?? ""}
- + @@ -395,21 +398,24 @@ async function handleAdPlanPlans(plans) {
    - ${plan.features.map((feature) => { - const iconUrl = feature.icon.data - ? getMediaUrl(feature.icon) - : "../img/ad/checked.svg"; - return ` + ${plan.features + .map((feature) => { + const iconUrl = feature.icon.data + ? getMediaUrl(feature.icon) + : "../img/ad/checked.svg"; + return `
  • ${feature.title} - + ${feature.text}
  • `; - }).join("")} + }) + .join("")}
`; @@ -420,16 +426,26 @@ async function handleAdPlanPlans(plans) { "animate__faster", "animate__delay-1s" ); - couldAdPlanElAnimate[`${plan.id}`] = false - planItemEl.addEventListener("animationend", () => { - planItemEl.classList.remove("animate__backInUp", "animate__faster", "animate__delay-1s") - couldAdPlanElAnimate[`${plan.id}`] = true - }, { once: true }) + couldAdPlanElAnimate[`${plan.id}`] = false; + planItemEl.addEventListener( + "animationend", + () => { + planItemEl.classList.remove( + "animate__backInUp", + "animate__faster", + "animate__delay-1s" + ); + couldAdPlanElAnimate[`${plan.id}`] = true; + }, + { once: true } + ); await new Promise((resolve) => { setTimeout(resolve, 150); }); } + + overridePlanButton(); } } @@ -493,8 +509,7 @@ async function handleAdIntroIntros(intros) { ? getMediaUrl(intro.cover) : `../img/ad/intro-card-img${intro.priority + 1}.svg`; introItemEl.className = "ad-intro-item"; - introItemEl.innerHTML = - ` + introItemEl.innerHTML = `
intro-bar
@@ -514,13 +529,19 @@ async function handleAdIntroIntros(intros) { "animate__zoomIn", "animate__delay-1s" ); - couldAdIntroElAnimate[`${intro.id}`] = false + couldAdIntroElAnimate[`${intro.id}`] = false; - - introItemEl.addEventListener("animationend", () => { - introItemEl.classList.remove("animate__zoomIn", "animate__delay-1s") - couldAdIntroElAnimate[`${intro.id}`] = true - }, { once: true }) + introItemEl.addEventListener( + "animationend", + () => { + introItemEl.classList.remove( + "animate__zoomIn", + "animate__delay-1s" + ); + couldAdIntroElAnimate[`${intro.id}`] = true; + }, + { once: true } + ); await new Promise((resolve) => { setTimeout(resolve, 150); }); @@ -535,8 +556,7 @@ function handleError(error) { // 插入广告栏元素 function insertAdBarElement() { - const adBarHTML = - ` + const adBarHTML = `