summaryrefslogtreecommitdiff
path: root/Hero/Core.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-07-25 15:40:24 -0700
committerBen Sima <ben@bsima.me>2020-07-25 15:40:24 -0700
commit2f32da5812583c6675bdc9ff88a3a3d5cefbb82f (patch)
tree1eb7b49b3b45a7a410cf8a82d97094412ef6c17c /Hero/Core.hs
parent22139c06244d224f543dc6c5c38e8f05cddc4b51 (diff)
hero: rename Assets -> Pack and lint fixes
Diffstat (limited to 'Hero/Core.hs')
-rw-r--r--Hero/Core.hs52
1 files changed, 26 insertions, 26 deletions
diff --git a/Hero/Core.hs b/Hero/Core.hs
index 3870c59..9f67bd7 100644
--- a/Hero/Core.hs
+++ b/Hero/Core.hs
@@ -30,9 +30,9 @@ import Data.String.Quote
import Data.Text (Text, replace, toLower)
import GHC.Generics (Generic)
import qualified GHC.Show as Legacy
-import qualified Hero.Assets as Assets
import Hero.Look as Look
import Hero.Look.Typography
+import qualified Hero.Pack as Pack
import Miso
import qualified Miso (for_)
import Miso.Extend
@@ -145,49 +145,49 @@ instance Elemental Button where
el (Arrow act) =
button_
[class_ "button is-large turn-page", onClick act]
- [img_ [src_ $ ms $ Assets.demo <> image <> ".png"]]
+ [img_ [src_ $ ms $ Pack.demo <> image <> ".png"]]
where
image = case act of
PrevPage -> "prev-page"
NextPage -> "next-page"
_ -> "prev-page"
el (Save c u) =
- if c `elem` (userLibrary u) -- in library
+ if c `elem` userLibrary u -- in library
then
a_
[class_ "wrs-button saved", onClick $ ToggleInLibrary c]
- [ img_ [src_ $ ms $ Assets.icon <> "save.svg"],
+ [ img_ [src_ $ ms $ Pack.icon <> "save.svg"],
span_ [] [text "saved"]
]
else-- not in library
a_
[class_ "wrs-button", onClick $ ToggleInLibrary c]
- [ img_ [src_ $ ms $ Assets.icon <> "save.svg"],
+ [ img_ [src_ $ ms $ Pack.icon <> "save.svg"],
span_ [] [text "save"]
]
el (SaveIcon c u) =
- if c `elem` (userLibrary u) -- in library
+ if c `elem` userLibrary u -- in library
then
button_
[ class_ "button is-large has-background-black",
onClick $ ToggleInLibrary c
]
- [img_ [src_ $ ms $ Assets.demo <> "library-add.png"]]
+ [img_ [src_ $ ms $ Pack.demo <> "library-add.png"]]
else-- not in library
button_
[ class_ "button is-large has-background-black-bis",
onClick $ ToggleInLibrary c
]
- [img_ [src_ $ ms $ Assets.demo <> "library-add.png"]]
+ [img_ [src_ $ ms $ Pack.demo <> "library-add.png"]]
el (ZoomIcon zmodel comic page) =
button_
[ id_ "zoom-button",
class_ "button is-large",
onClick $ ToggleZoom comic page
]
- [ img_ [src_ $ ms $ Assets.demo <> "zoom.png"],
+ [ img_ [src_ $ ms $ Pack.demo <> "zoom.png"],
input_
[ type_ "range",
min_ "0",
@@ -204,13 +204,13 @@ instance Elemental Button where
el (Read c) =
a_
[class_ "wrs-button", onClick $ SelectExperience c]
- [ img_ [src_ $ ms $ Assets.icon <> "read.svg"],
+ [ img_ [src_ $ ms $ Pack.icon <> "read.svg"],
span_ [] [text "read"]
]
el (Watch c) =
a_
[class_ "wrs-button", onClick $ StartWatching c]
- [ img_ [src_ $ ms $ Assets.icon <> "watch.svg"],
+ [ img_ [src_ $ ms $ Pack.icon <> "watch.svg"],
span_ [] [text "watch"]
]
@@ -378,7 +378,7 @@ login _ =
[id_ "login-inner"]
[ img_
[ class_ fadeIn,
- src_ $ ms $ Assets.cdnEdge <> "/old-assets/images/icons/hero-large.png"
+ src_ $ ms $ Pack.cdnEdge <> "/old-assets/images/icons/hero-large.png"
],
hr_ [class_ fadeIn],
form_
@@ -406,7 +406,7 @@ login _ =
img_
[ id_ "hero-logo",
class_ "blur-out",
- src_ $ ms $ Assets.cdnEdge <> "/old-assets/images/icons/success-her-image.png"
+ src_ $ ms $ Pack.cdnEdge <> "/old-assets/images/icons/success-her-image.png"
]
]
]
@@ -468,7 +468,7 @@ discoverFooter =
],
div_
[css euro, id_ "app-foot-logo", onClick DumpModel]
- [ a_ [class_ "social-icon", href_ "#"] [img_ [src_ $ ms $ Assets.icon <> "hero-logo.svg"]],
+ [ a_ [class_ "social-icon", href_ "#"] [img_ [src_ $ ms $ Pack.icon <> "hero-logo.svg"]],
span_ [] [text "© Hero Records, Inc. All Rights Reserved"]
]
]
@@ -478,7 +478,7 @@ discoverFooter =
smallImg x lnk =
a_
(attrs lnk)
- [img_ [src_ $ ms $ Assets.cdnEdge <> "/old-assets/images/icons/" <> x]]
+ [img_ [src_ $ ms $ Pack.cdnEdge <> "/old-assets/images/icons/" <> x]]
-- * comic
@@ -508,7 +508,7 @@ instance IsMediaObject Comic where
id_ $ "comic-" <> ms comicId,
onClick $ SetMediaInfo $ Just c
]
- [ img_ [src_ $ ms $ Assets.demo <> comicSlug c <> ".png"],
+ [ img_ [src_ $ ms $ Pack.demo <> comicSlug c <> ".png"],
span_ [] [text $ "Issue #" <> ms comicIssue],
span_ [] [text $ ms comicName]
]
@@ -518,7 +518,7 @@ instance IsMediaObject Comic where
[id_ "featured-comic"]
[ img_
[ id_ "featured-banner",
- src_ $ ms $ Assets.demo <> "feature-banner.png"
+ src_ $ ms $ Pack.demo <> "feature-banner.png"
],
div_
[id_ "featured-content"]
@@ -532,7 +532,7 @@ instance IsMediaObject Comic where
[ img_
[ src_
$ ms
- $ Assets.demo <> comicSlug comic <> "-logo.png"
+ $ Pack.demo <> comicSlug comic <> "-logo.png"
]
],
div_ [class_ "comic-action-menu"] $
@@ -548,7 +548,7 @@ instance IsMediaObject Comic where
[class_ "media-info", css euro]
[ div_
[class_ "media-info-meta"]
- [ column [img_ [src_ $ ms $ Assets.demo <> "dmc-widethumb.png"]],
+ [ column [img_ [src_ $ ms $ Pack.demo <> "dmc-widethumb.png"]],
column
[ span_ [style_ title] [text $ ms comicName],
span_ [style_ subtitle] [text $ "Issue #" <> ms comicIssue],
@@ -625,7 +625,7 @@ chooseExperiencePage comic page model =
[onClick $ StartReading c]
[ div_
[]
- [ img_ [src_ $ ms $ Assets.demo <> name <> ".png"],
+ [ img_ [src_ $ ms $ Pack.demo <> name <> ".png"],
span_ [] [text $ ms name]
],
span_ [css thicc] [text $ ms artist],
@@ -685,7 +685,7 @@ zoomScreen comic page model =
]
where
comicImg =
- ms Assets.demo
+ ms Pack.demo
<> ms (comicSlug comic)
<> "-"
<> padLeft page
@@ -726,13 +726,13 @@ comicSpread comic page model =
where
comicImgLeft, comicImgRight :: MisoString
comicImgLeft =
- ms Assets.demo
+ ms Pack.demo
<> ms (comicSlug comic)
<> "-"
<> padLeft page
<> ".png"
comicImgRight =
- ms Assets.demo
+ ms Pack.demo
<> ms (comicSlug comic)
<> "-"
<> padLeft (1 + page)
@@ -828,7 +828,7 @@ appmenu = aside_ [id_ "appmenu"] $ btn </ links
[ class_ "button",
onPreventClick $ ChangeURI lnk
]
- [ img_ [src_ $ ms $ Assets.icon <> img],
+ [ img_ [src_ $ ms $ Pack.icon <> img],
span_ [] [text label]
]
@@ -878,7 +878,7 @@ comicControls comic page model =
]
[ audio_
[id_ audioId, loop_ True, crossorigin_ "anonymous"]
- [source_ [src_ $ ms $ Assets.demo <> "stars-instrumental.mp3"]],
+ [source_ [src_ $ ms $ Pack.demo <> "stars-instrumental.mp3"]],
el $ PlayPause audioId $ cpAudioState model,
span_
[css $ euro <> thicc <> smol <> wide]
@@ -912,7 +912,7 @@ topbar =
[ class_ "button is-medium is-black",
onClick $ ChangeURI discoverLink
]
- [img_ [src_ $ ms $ Assets.icon <> "hero-logo.svg"]],
+ [img_ [src_ $ ms $ Pack.icon <> "hero-logo.svg"]],
div_
[id_ "app-head-right"]
[ button_