From 2bb297f6c9762b077febaf6d13143fa47d6ff44d Mon Sep 17 00:00:00 2001 From: Julian Date: Thu, 9 Mar 2023 14:10:35 +0800 Subject: [PATCH] Fix lottie & translation --- src/components/home/bolt_introduction.tsx | 44 +++++++++++++++++------ src/locales/en/common.json | 4 +-- src/locales/zh-CN/common.json | 4 +-- src/locales/zh-TW/common.json | 4 +-- src/pages/api/news/see_more_list.ts | 2 ++ 5 files changed, 41 insertions(+), 17 deletions(-) diff --git a/src/components/home/bolt_introduction.tsx b/src/components/home/bolt_introduction.tsx index 88ce5f4..86603f4 100644 --- a/src/components/home/bolt_introduction.tsx +++ b/src/components/home/bolt_introduction.tsx @@ -57,24 +57,46 @@ function BoltIntro() { path: "/animation/step03.json", }); + //const [animFrameStep1,setAnimFrameStep1] = useState() + function animatebodymovin(duration: number) { const scrollPosition = window.scrollY; - const maxFrames = animStep1.totalFrames; - const frameStep1 = maxFrames * ((scrollPosition - 350) / duration); + const frameStep1 = + animStep1.totalFrames * ((scrollPosition - 350) / duration); + const frameConne1 = - maxFrames * (((scrollPosition - 1200) / duration) * 2); - const frameStep2 = maxFrames * (((scrollPosition - 1600) / duration) * 2); + animConne1.totalFrames * (((scrollPosition - 1200) / duration) * 2); + + const frameStep2 = + animStep2.totalFrames * ((scrollPosition - 1600) / duration); + const frameConne2 = - maxFrames * (((scrollPosition - 2200) / duration) * 2); + animConne2.totalFrames * (((scrollPosition - 2200) / duration) * 2); + const frameStep3 = - maxFrames * (((scrollPosition - 2600) / duration) * 1.5); + animStep3.totalFrames * (((scrollPosition - 2600) / duration) * 1.5); + + // play animation + if (scrollPosition > 350 && scrollPosition < 1300) { + animStep1.goToAndStop(frameStep1, true); + } + + if (scrollPosition < 1700) { + animConne1.goToAndStop(frameConne1, true); + } + + if (scrollPosition > 1600 && scrollPosition < 2300) { + animStep2.goToAndStop(frameStep2, true); + } + + if (scrollPosition < 2700) { + animConne2.goToAndStop(frameConne2, true); + } - animStep1.goToAndStop(frameStep1, true); - animConne1.goToAndStop(frameConne1, true); - animStep2.goToAndStop(frameStep2, true); - animConne2.goToAndStop(frameConne2, true); - animStep3.goToAndStop(frameStep3, true); + if (scrollPosition > 2600 && scrollPosition < 3600) { + animStep3.goToAndStop(frameStep3, true); + } } const onScroll = () => { animatebodymovin(animDuration); diff --git a/src/locales/en/common.json b/src/locales/en/common.json index 83cf471..46d89f6 100644 --- a/src/locales/en/common.json +++ b/src/locales/en/common.json @@ -49,7 +49,7 @@ "title": "Use Case", "case1": { "title": "交易所審計:", - "descriptionLine1": "防止加密貨幣的雷曼時刻再次發生,加強交易所可性度", + "descriptionLine1": "防止加密貨幣的雷曼時刻再次發生,加強交易所可信度", "descriptionLine2": "導入流程:", "descriptionLine3": "Bolt Audit 使用零知識證明技術驗證,過程不需揭露交易所營運數據", "descriptionLine4": "用戶得以隨時比對雙方證據是否吻合,並於發現異常時及時公佈給相關用戶。用戶亦可自行存證指定格式相關證據,並存證於 Bolt 透過 Bolt Explorer 確認資料成功寫入,提供用戶資料存證收據", @@ -58,7 +58,7 @@ }, "case2": { "title": "資料信任服務:", - "description": "解決資料信任問題,如:捐款資金走向等,將資料上到 BOLT 後,壓縮上到公鏈 讓大眾有管道進行驗證,提高資料的可信度,同時加強企業形象。", + "description": "解決資料信任問題,如:捐款資金走向等,將資料上到 BOLT 後,壓縮上到公鏈,讓大眾有管道進行驗證,提高資料的可信度,同時加強企業形象。", "image": "/img/usecase02.svg" }, "case3": { diff --git a/src/locales/zh-CN/common.json b/src/locales/zh-CN/common.json index d07cd51..d552cd2 100644 --- a/src/locales/zh-CN/common.json +++ b/src/locales/zh-CN/common.json @@ -49,7 +49,7 @@ "title": "应用场景", "case1": { "title": "交易所审计:", - "descriptionLine1": "防止加密货币的雷曼时刻再次发生,加强交易所可性度", + "descriptionLine1": "防止加密货币的雷曼时刻再次发生,加强交易所可信度", "descriptionLine2": "导入流程:", "descriptionLine3": "Bolt Audit 使用零知识证明技术验证,过程不需揭露交易所营运数据", "descriptionLine4": "用户得以随时比对双方证据是否吻合,并于发现异常时及时公布给相关用户。用户亦可自行存证指定格式相关证据,并存证于 Bolt 透过 Bolt Explorer 确认资料成功写入,提供用户资料存证收据", @@ -58,7 +58,7 @@ }, "case2": { "title": "资料信任服务:", - "description": "解决资料信任问题,如:捐款资金走向等,将资料上到 BOLT 后,压缩上到公链 让大众有管道进行验证,提高资料的可信度,同时加强企业形象。", + "description": "解决资料信任问题,如:捐款资金走向等,将资料上到 BOLT 后,压缩上到公链,让大众有管道进行验证,提高资料的可信度,同时加强企业形象。", "image": "/img/usecase02.svg" }, "case3": { diff --git a/src/locales/zh-TW/common.json b/src/locales/zh-TW/common.json index e265d29..bc61d46 100644 --- a/src/locales/zh-TW/common.json +++ b/src/locales/zh-TW/common.json @@ -49,7 +49,7 @@ "title": "應用場景", "case1": { "title": "交易所審計:", - "descriptionLine1": "防止加密貨幣的雷曼時刻再次發生,加強交易所可性度", + "descriptionLine1": "防止加密貨幣的雷曼時刻再次發生,加強交易所可信度", "descriptionLine2": "導入流程:", "descriptionLine3": "Bolt Audit 使用零知識證明技術驗證,過程不需揭露交易所營運數據", "descriptionLine4": "用戶得以隨時比對雙方證據是否吻合,並於發現異常時及時公佈給相關用戶。用戶亦可自行存證指定格式相關證據,並存證於 Bolt 透過 Bolt Explorer 確認資料成功寫入,提供用戶資料存證收據", @@ -58,7 +58,7 @@ }, "case2": { "title": "資料信任服務:", - "description": "解決資料信任問題,如:捐款資金走向等,將資料上到 BOLT 後,壓縮上到公鏈 讓大眾有管道進行驗證,提高資料的可信度,同時加強企業形象。", + "description": "解決資料信任問題,如:捐款資金走向等,將資料上到 BOLT 後,壓縮上到公鏈,讓大眾有管道進行驗證,提高資料的可信度,同時加強企業形象。", "image": "/img/usecase02.svg" }, "case3": { diff --git a/src/pages/api/news/see_more_list.ts b/src/pages/api/news/see_more_list.ts index 2e745c9..6612bdf 100644 --- a/src/pages/api/news/see_more_list.ts +++ b/src/pages/api/news/see_more_list.ts @@ -12,5 +12,7 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) { ? allNews.slice(1, 2) : newsList.filter((news) => !(news.id === newsId)); + //random + res.status(200).send(seeMoreList); }