@@ -4,6 +4,7 @@ import { ChainTheme, chainThemeAtom } from "../../states/atoms";
44import { Hex } from "@ckb-ccc/core" ;
55import { useMemo } from "preact/hooks" ;
66import { getApeRunningGif , getRunningSpeedClass } from "./util" ;
7+ import Tooltip from "../tooltip" ;
78
89export interface ElevatorUpButtonProps {
910 difficultyInEH : number ;
@@ -72,40 +73,49 @@ const ElevatorMiner: FunctionComponent<ElevatorUpButtonProps> = ({
7273 < div className = "w-[10px] h-[20px] bg-black" />
7374
7475 < div >
75- < div className = "relative" >
76- < img
77- className = "absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2"
78- src = { doorClosing ? minerJumpSvg : minerApeRunning }
79- alt = "Miner Ape"
80- />
81- < img
82- className = { `${ doorClosing ? "" : spinClass } ` }
83- src = { minerWheel }
84- alt = "Miner Wheel"
85- />
86-
87- { /* 气泡元素 */ }
88- { doorClosing && (
89- < div
90- className = { `absolute left-[calc(70%+8px)] top-1/4 -translate-y-1/2 ${ bgBrand } text-white px-3 py-1 rounded-full animate-bubble-up` }
91- >
92- Found a new nonce { nonce }
93- </ div >
94- ) }
95- </ div >
96-
97- < div className = "relative" >
98- < div className = "absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2 text-text-inverse" >
99- < div
76+ < Tooltip text = "I am a Miner, I work hard to find the nonce for the block for coins!" >
77+ < div className = "relative" >
78+ < img
10079 className = {
101- "truncate overflow-hidden whitespace-nowrap "
80+ "absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2 z-50 "
10281 }
103- >
104- Difficulty { difficultyInEH } EH
82+ src = {
83+ doorClosing ? minerJumpSvg : minerApeRunning
84+ }
85+ alt = "Miner Ape"
86+ />
87+
88+ < img
89+ className = { `${ doorClosing ? "" : spinClass } ` }
90+ src = { minerWheel }
91+ alt = "Miner Wheel"
92+ />
93+
94+ { /* 气泡元素 */ }
95+ { doorClosing && (
96+ < div
97+ className = { `absolute left-[calc(70%+8px)] top-1/4 -translate-y-1/2 ${ bgBrand } text-white px-3 py-1 rounded-full animate-bubble-up` }
98+ >
99+ Found a new nonce { nonce }
100+ </ div >
101+ ) }
102+ </ div >
103+ </ Tooltip >
104+
105+ < Tooltip text = "The miner difficulty is the number of leading zeros in the hash of the block header. The higher the difficulty, the harder it is to find the nonce." >
106+ < div className = "relative" >
107+ < div className = "absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2 text-text-inverse" >
108+ < div
109+ className = {
110+ "truncate overflow-hidden whitespace-nowrap"
111+ }
112+ >
113+ Difficulty { difficultyInEH } EH
114+ </ div >
105115 </ div >
116+ < img src = { minerBaseSvg } alt = "Miner Base" />
106117 </ div >
107- < img src = { minerBaseSvg } alt = "Miner Base" />
108- </ div >
118+ </ Tooltip >
109119 </ div >
110120 </ div >
111121 </ div >
0 commit comments