diff --git a/frontend/public/assets/svg/elevator/coin.svg b/frontend/public/assets/svg/elevator/coin.svg new file mode 100644 index 0000000..5e8f79d --- /dev/null +++ b/frontend/public/assets/svg/elevator/coin.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/frontend/public/assets/svg/elevator/mainnet/ape-jump.svg b/frontend/public/assets/svg/elevator/mainnet/ape-jump.svg new file mode 100644 index 0000000..411061f --- /dev/null +++ b/frontend/public/assets/svg/elevator/mainnet/ape-jump.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/frontend/public/assets/svg/elevator/testnet/ape-jump.svg b/frontend/public/assets/svg/elevator/testnet/ape-jump.svg new file mode 100644 index 0000000..ba6606a --- /dev/null +++ b/frontend/public/assets/svg/elevator/testnet/ape-jump.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/frontend/src/components/elevator/block-modal.tsx b/frontend/src/components/elevator/block-modal.tsx index 806d018..cd5adb2 100644 --- a/frontend/src/components/elevator/block-modal.tsx +++ b/frontend/src/components/elevator/block-modal.tsx @@ -5,7 +5,7 @@ import { useAtomValue } from "jotai"; import { createBlockLink, createTransactionLink } from "../../util/link"; import { BlockResponse, Network } from "../../service/type"; import { useChainService } from "../../context/chain"; -import { ccc, Hex } from "@ckb-ccc/core"; +import { Hex } from "@ckb-ccc/core"; import { calcBlockOccupation, calcTotalTxSize, diff --git a/frontend/src/components/elevator/miner.tsx b/frontend/src/components/elevator/miner.tsx index 5e78d57..c178b04 100644 --- a/frontend/src/components/elevator/miner.tsx +++ b/frontend/src/components/elevator/miner.tsx @@ -46,13 +46,40 @@ const ElevatorMiner: FunctionComponent = ({ const minerApeRunning = getApeRunningGif(chainTheme, speedClass); const minerJumpSvg = + chainTheme === ChainTheme.mainnet + ? "/assets/svg/elevator/mainnet/ape-jump.svg" + : "/assets/svg/elevator/testnet/ape-jump.svg"; + const jumpClass = doorClosing ? "w-2/3 animate-jump" : ""; + + const minerStandSvg = chainTheme === ChainTheme.mainnet ? "/assets/svg/elevator/mainnet/miner-ape.svg" : "/assets/svg/elevator/testnet/miner-ape.svg"; return (
-
+
+ {/* 气泡元素 */} + {doorClosing && ( +
+
+
+
+ Nonce {nonce.slice(0, 10)}.. +
+
+
+
+ )} +
@@ -70,35 +97,26 @@ const ElevatorMiner: FunctionComponent = ({
-
-
- Miner Ape +
+ Miner Ape +
Miner Wheel - - {/* 气泡元素 */} - {doorClosing && ( -
- Found a new nonce {nonce} -
- )}
diff --git a/frontend/src/styles/animate.css b/frontend/src/styles/animate.css index 854ac07..af90119 100644 --- a/frontend/src/styles/animate.css +++ b/frontend/src/styles/animate.css @@ -107,5 +107,18 @@ } .animate-bubble-up { - animation: bubble-up 3s ease-out forwards; + animation: bubble-up 3s ease-in forwards; +} + +@keyframes jump { + 0% { + transform: translateY(0%) translateX(0); + } + 100% { + transform: translateY(-50%) translateX(0); + } +} + +.animate-jump { + animation: jump 2s ease-out forwards; } diff --git a/src/core/subscriber.ts b/src/core/subscriber.ts index 55b355c..5cc810e 100644 --- a/src/core/subscriber.ts +++ b/src/core/subscriber.ts @@ -8,7 +8,6 @@ import type { DB } from "../db"; import { logger } from "../util/logger"; import type { JsonRpcPoolTransactionEntry, - Network, PoolTransactionReject, } from "./type"; @@ -119,7 +118,12 @@ export class Subscriber { } async run() { - await this.db.cleanOrphanedTransaction(this.httpRpcClient); + try { + await this.db.cleanOrphanedTransaction(this.httpRpcClient); + } catch (error) { + logger.debug("cleanOrphanedTransaction error:", error); + logger.debug("skip cleaning..."); + } this.ws = new WebSocket(this.ckbRpcUrl); const topics = this.createTopicSubscriber();