Skip to content

Commit

Permalink
Remove countdown
Browse files Browse the repository at this point in the history
  • Loading branch information
ronanyeah committed Jul 29, 2024
1 parent 66dab83 commit 70ede19
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 63 deletions.
2 changes: 1 addition & 1 deletion elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"elm/html": "1.0.0",
"elm/json": "1.1.3",
"elm/svg": "1.0.1",
"elm/time": "1.0.0",
"elmcraft/core-extra": "2.0.0",
"mdgriffith/elm-ui": "1.1.8",
"ronanyeah/helpers": "6.0.0"
Expand All @@ -22,6 +21,7 @@
"elm/file": "1.0.5",
"elm/http": "2.0.0",
"elm/regex": "1.0.0",
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.2",
"myrho/elm-round": "1.0.5"
Expand Down
1 change: 0 additions & 1 deletion src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ init flags =
, claimStatus = Standby
, showSecret = False
, confirmDelete = False
, currentTime = flags.time
, tokenRefreshInProgress = False
, miningError = Nothing
, stats = Nothing
Expand Down
2 changes: 0 additions & 2 deletions src/Types.elm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ type alias Model =
, confirmDelete : Bool
, tokenRefreshInProgress : Bool
, addressInput : String
, currentTime : Int
, miningError : Maybe String
, hashesChecked : Int
, stats : Maybe (Maybe Ports.Stats)
Expand Down Expand Up @@ -55,7 +54,6 @@ type Msg
| MiningError String
| StatsCb Ports.Stats
| SwapDataCb Ports.SwapData
| Tick Int
| ManageCoins


Expand Down
7 changes: 0 additions & 7 deletions src/Update.elm
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ import Utils exposing (..)
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
Tick n ->
( { model
| currentTime = n
}
, Cmd.none
)

ClearWallet ->
if model.confirmDelete then
( { model
Expand Down
53 changes: 1 addition & 52 deletions src/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ import Types exposing (..)
import Utils exposing (..)


startTime =
0


view : Model -> Html Msg
view model =
[ [ logo 70
Expand All @@ -34,30 +30,7 @@ view model =
]
|> row [ spacing 10, centerX ]
|> when False
, if startTime < model.currentTime then
viewBody model

else
[ [ Img.x 20
, text ".com/MineralSupply"
|> el [ Font.size 22 ]
]
|> row []
|> linkOut "https://twitter.com/MineralSupply" []
, timeDifference model.currentTime startTime
|> (\( hours, mins, seconds ) ->
[ String.padLeft 2 '0' (String.fromInt hours)
, ":"
, String.padLeft 2 '0' (String.fromInt mins)
, ":"
, String.padLeft 2 '0' (String.fromInt seconds)
]
|> String.concat
)
|> text
|> el [ Font.size 50, centerX ]
]
|> column [ centerX, spacing 20 ]
, viewBody model
]
|> column
[ cappedWidth 450
Expand Down Expand Up @@ -881,30 +854,6 @@ horizRule =
el [ width fill, height <| px 2, Background.color white ] none


timeDifference : Int -> Int -> ( Int, Int, Int )
timeDifference timestamp1 timestamp2 =
let
diffMillis =
abs (timestamp1 - timestamp2)

totalSeconds =
diffMillis // 1000

hours =
totalSeconds // 3600

remainingSecondsAfterHours =
modBy 3600 totalSeconds

minutes =
remainingSecondsAfterHours // 60

seconds =
modBy 60 remainingSecondsAfterHours
in
( hours, minutes, seconds )


formatMINE n d =
formatFloatN d (toFloat n / 1000000000)

Expand Down

0 comments on commit 70ede19

Please sign in to comment.