Skip to content

Commit

Permalink
Fix lottie & translation
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian0701 committed Mar 9, 2023
1 parent 1e3d0da commit 2bb297f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 17 deletions.
44 changes: 33 additions & 11 deletions src/components/home/bolt_introduction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,46 @@ function BoltIntro() {
path: "/animation/step03.json",
});

//const [animFrameStep1,setAnimFrameStep1] = useState<number>()

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);
Expand Down
4 changes: 2 additions & 2 deletions src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"title": "Use Case",
"case1": {
"title": "交易所審計:",
"descriptionLine1": "防止加密貨幣的雷曼時刻再次發生,加強交易所可性度",
"descriptionLine1": "防止加密貨幣的雷曼時刻再次發生,加強交易所可信度",
"descriptionLine2": "導入流程:",
"descriptionLine3": "Bolt Audit 使用零知識證明技術驗證,過程不需揭露交易所營運數據",
"descriptionLine4": "用戶得以隨時比對雙方證據是否吻合,並於發現異常時及時公佈給相關用戶。用戶亦可自行存證指定格式相關證據,並存證於 Bolt 透過 Bolt Explorer 確認資料成功寫入,提供用戶資料存證收據",
Expand All @@ -58,7 +58,7 @@
},
"case2": {
"title": "資料信任服務:",
"description": "解決資料信任問題,如:捐款資金走向等,將資料上到 BOLT 後,壓縮上到公鏈 讓大眾有管道進行驗證,提高資料的可信度,同時加強企業形象。",
"description": "解決資料信任問題,如:捐款資金走向等,將資料上到 BOLT 後,壓縮上到公鏈讓大眾有管道進行驗證,提高資料的可信度,同時加強企業形象。",
"image": "/img/usecase02.svg"
},
"case3": {
Expand Down
4 changes: 2 additions & 2 deletions src/locales/zh-CN/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"title": "应用场景",
"case1": {
"title": "交易所审计:",
"descriptionLine1": "防止加密货币的雷曼时刻再次发生,加强交易所可性度",
"descriptionLine1": "防止加密货币的雷曼时刻再次发生,加强交易所可信度",
"descriptionLine2": "导入流程:",
"descriptionLine3": "Bolt Audit 使用零知识证明技术验证,过程不需揭露交易所营运数据",
"descriptionLine4": "用户得以随时比对双方证据是否吻合,并于发现异常时及时公布给相关用户。用户亦可自行存证指定格式相关证据,并存证于 Bolt 透过 Bolt Explorer 确认资料成功写入,提供用户资料存证收据",
Expand All @@ -58,7 +58,7 @@
},
"case2": {
"title": "资料信任服务:",
"description": "解决资料信任问题,如:捐款资金走向等,将资料上到 BOLT 后,压缩上到公链 让大众有管道进行验证,提高资料的可信度,同时加强企业形象。",
"description": "解决资料信任问题,如:捐款资金走向等,将资料上到 BOLT 后,压缩上到公链让大众有管道进行验证,提高资料的可信度,同时加强企业形象。",
"image": "/img/usecase02.svg"
},
"case3": {
Expand Down
4 changes: 2 additions & 2 deletions src/locales/zh-TW/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"title": "應用場景",
"case1": {
"title": "交易所審計:",
"descriptionLine1": "防止加密貨幣的雷曼時刻再次發生,加強交易所可性度",
"descriptionLine1": "防止加密貨幣的雷曼時刻再次發生,加強交易所可信度",
"descriptionLine2": "導入流程:",
"descriptionLine3": "Bolt Audit 使用零知識證明技術驗證,過程不需揭露交易所營運數據",
"descriptionLine4": "用戶得以隨時比對雙方證據是否吻合,並於發現異常時及時公佈給相關用戶。用戶亦可自行存證指定格式相關證據,並存證於 Bolt 透過 Bolt Explorer 確認資料成功寫入,提供用戶資料存證收據",
Expand All @@ -58,7 +58,7 @@
},
"case2": {
"title": "資料信任服務:",
"description": "解決資料信任問題,如:捐款資金走向等,將資料上到 BOLT 後,壓縮上到公鏈 讓大眾有管道進行驗證,提高資料的可信度,同時加強企業形象。",
"description": "解決資料信任問題,如:捐款資金走向等,將資料上到 BOLT 後,壓縮上到公鏈讓大眾有管道進行驗證,提高資料的可信度,同時加強企業形象。",
"image": "/img/usecase02.svg"
},
"case3": {
Expand Down
2 changes: 2 additions & 0 deletions src/pages/api/news/see_more_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 2bb297f

Please sign in to comment.