summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Sima <nicksima@gmail.com>2019-02-01 09:36:21 -0800
committerBen Sima <ben@bsima.me>2019-02-01 10:20:52 -0800
commit7a1f2471b5b2c37a0582ae9c49e85b099bbd7260 (patch)
treec70f93a563abd11f2af3b2e00a4b819b4d9ac823
parent14f481f541335e418a7d034e9587fcf90d015acb (diff)
Changed html to better suite templates and data.
-rw-r--r--ibb/Main.hs127
1 files changed, 62 insertions, 65 deletions
diff --git a/ibb/Main.hs b/ibb/Main.hs
index bf94277..91112f0 100644
--- a/ibb/Main.hs
+++ b/ibb/Main.hs
@@ -17,10 +17,11 @@ render = html . renderHtml
main :: IO ()
main = scotty 3000 $
- get "/" $ render influencerCards
+ get "/" $ render homepage
data Person = Person
{ _name :: Text
+ , _pic :: Text
, _twitter :: Text
, _website :: Text
, _books :: [Book]
@@ -35,25 +36,73 @@ data Book = Book
allPeople =
[ Person { _name = "Joe Rogan"
+ , _pic = "https://pbs.twimg.com/profile_images/552307347851210752/vrXDcTFC_400x400.jpeg"
, _twitter = "joerogan"
, _website = "joerogan.com"
, _books = [ Book {_title = "Food of the Gods"
- , _author = "fixme"
- , _link = "fixme"
+ , _author = "Terence McKenna"
+ , _link = "https://www.amazon.com/Food-Gods-Original-Knowledge-Evolution/dp/0553371304"
}
, Book { _title = "The War of Art"
- , _author ="fixme"
- , _link ="fixme"
+ , _author ="Steven Pressfield"
+ , _link ="https://www.amazon.com/dp/B007A4SDCG/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1"
}
]
}
+ , Person { _name = "Beyoncé"
+ , _pic = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTxT84sF19lxdnSiblIXAp-Y4wAigpQn8sZ2GtAerIR_ApiiEJfFQ"
+ , _twitter = "Beyonce"
+ , _website = "beyonce.com"
+ , _books = [ Book { _title = "What Will It Take To Make A Woman President?"
+ , _author = "Marianne Schnall"
+ , _link = "https://www.amazon.com/dp/B00E257Y7G/ref=dp-kindle-redirect?_encoding=UTF8&btkr="}
+ ]
+ }
+ , Person { _name = "Barrack Obama"
+ , _pic = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQeLzftR36p0hYI-EKNa5fm7CYDuN-vyz23_R48ocqa8X1nPr6C"
+ , _twitter = "BarackObama"
+ , _website = "barackobama.com"
+ , _books = [ Book { _title = "An American Marriage"
+ , _author = "Tayari Jones"
+ , _link = "https://www.amazon.com/American-Marriage-Novel-Oprahs-Selection-ebook/dp/B01NCUXEFR"}
+ , Book { _title = "Americanah"
+ , _author = "Chimamanda Ngozi Adichie"
+ , _link = "https://www.amazon.com/dp/B00A9ET4MC/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1"}
+ ]
+ }
+ , Person { _name = "Warren Buffet"
+ , _pic = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQQbmnUykS6zqgzaf44tsq1RAsnHe6H7fapEoSqUwAoJGSFKbAPSw"
+ , _twitter = "WarrenBuffett"
+ , _website = "berkshirehathaway.com"
+ , _books = [ Book { _title = "The Intelligent Investor"
+ , _author = "Benjamin Graham"
+ , _link = "https://www.amazon.com/dp/B000FC12C8/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1"}
+ , Book { _title = "Security Analysis"
+ , _author = "enjamin Graham"
+ , _link = "https://www.amazon.com/Security-Analysis-Foreword-Buffett-Editions-ebook/dp/B0037JO5J8"}
+ ]
+ }
+ , Person { _name = "Micheal Jordan"
+ , _pic = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQfl_Dm2RUhknIxGEafGOlQC7Jj3Ky0nyQYk6GvG791sClzwFQb"
+ , _twitter = ""
+ , _website = "michaeljordansworld.com"
+ , _books = [ Book { _title = "Statistical Inference"
+ , _author = "George Casella"
+ , _link = "https://www.amazon.com/Statistical-Inference-George-Casella/dp/0534243126"}
+ , Book { _title = "A Course In Large Sample Therapy"
+ , _author = "Thomas S. Ferguson"
+ , _link = "https://www.amazon.com/Course-Sample-Chapman-Statistical-Science/dp/041204371"}
+ ]
+ }
]
displayPerson person = [shamlet|
-<h4>#{_name person}
-<ul>
- $forall book <- (_books person)
- <li>#{_title book}
+<div .card .ml-3 .mb-3 style=width:22rem;>
+ <img .card-img .img-fluid src=#{_pic person}>
+ <h4>#{_name person}
+ <ul>
+ $forall book <- (_books person)
+ <li><a href=#{_link book} class="text-dark">#{_title book}
|]
homepage = [shamlet|
@@ -61,60 +110,8 @@ homepage = [shamlet|
<head>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<body>
- $forall person <- allPeople
- #{displayPerson person}
-|]
-
-
-influencerCards :: Markup
-influencerCards = [shamlet|
-<nav .navbar .navbar-light .bg-light>
- <h3 .navbar-brand>IBB
- <button .navbar-toggler type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
- <span .navbar-toggler-icon>
- <div .collapse .navbar-collapse id="navbarIbb">
- <ul .navbar-nav .mr-auto .mt-2 .mt-lg-0>
- <li .nav-item .active>
- <p .nav-item>One
-<div .container>
- <div .row>
- <div .card .ml-3 .mb-3 style=width:22rem;>
- <img .card-img .img-fluid src="https://pbs.twimg.com/profile_images/552307347851210752/vrXDcTFC_400x400.jpeg">
- <h4>Joe Rogan
- <ul>
- <li><a href="https://www.amazon.com/Food-Gods-Original-Knowledge-Evolution/dp/0553371304/ref=as_li_ss_tl?s=books&ie=UTF8&qid=1510184452&sr=1-1&keywords=food+of+the+gods&linkCode=sl1&tag=jrebooks-20&linkId=2985689be53efde5cc377fe9c74de7a0" class="text-dark">Food of the Gods</a>
- <li><a href="https://www.amazon.com/War-Art-Through-Creative-Battles/dp/1936891026/ref=as_li_ss_tl?s=books&ie=UTF8&qid=1509600244&sr=1-1&keywords=the+war+of+art+steven+pressfield&dpID=41hM%252BLf2pLL&preST=_SY291_BO1,204,203,200_QL40_&dpSrc=srch&linkCode=sl1&tag=jrebooks-20&linkId=5fa2e21ba505d6b23d71e2f0d074e435" class="text-dark">The War of Art</a>
- <div .card-footer>
- <a .btn href="https://www.joerogan.com"> Personal Website
- <div .card .ml-3 .mb-3 style=width:22rem;>
- <img .card-img .img-fluid src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTxT84sF19lxdnSiblIXAp-Y4wAigpQn8sZ2GtAerIR_ApiiEJfFQ">
- <h4>Beyoncé
- <ul>
- <li><a href="https://www.amazon.com/dp/B00E257Y7G/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1" class="text-dark">What Will It Take To Make A Women President?</a>
- <div .card-footer>
- <a .btn href="https://www.beyonce.com"> Personal Website
- <div .card .ml-3 .mb-3 style=width:22rem;>
- <img .card-img .img-fluid src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQeLzftR36p0hYI-EKNa5fm7CYDuN-vyz23_R48ocqa8X1nPr6C">
- <h4>Barrack Obama
- <ul>
- <li><a href="https://www.amazon.com/American-Marriage-Novel-Oprahs-Selection-ebook/dp/B01NCUXEFR" class="text-dark">An American Marriage</a>
- <li><a href="https://www.amazon.com/dp/B00A9ET4MC/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1" class="text-dark">Americanah</a>
- <div .card-footer>
- <a .btn href="https://barackobama.com"> Personal Website
- <div .card .ml-3 .mb-3 style=width:22rem;>
- <img .card-img .img-fluid src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQQbmnUykS6zqgzaf44tsq1RAsnHe6H7fapEoSqUwAoJGSFKbAPSw">
- <h4>Warren Buffett
- <ul>
- <li><a href="https://www.amazon.com/dp/B000FC12C8/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1" class="text-dark">The Intelligent Investor</a>
- <li><a href="https://www.amazon.com/Security-Analysis-Foreword-Buffett-Editions-ebook/dp/B0037JO5J8" class="text-dark">Security Analysis</a>
- <div .card-footer>
- <a .btn href="http://www.berkshirehathaway.com"> Personal Website
- <div .card .ml-3 .mb-3 style=width:22rem;>
- <img .card-img .img-fluid src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQfl_Dm2RUhknIxGEafGOlQC7Jj3Ky0nyQYk6GvG791sClzwFQb">
- <h4>Micheal Jordan
- <ul>
- <li><a href="https://www.amazon.com/Statistical-Inference-George-Casella/dp/0534243126" class="text-dark">Statistical Inference</a>
- <li><a href="https://www.amazon.com/Course-Sample-Chapman-Statistical-Science/dp/0412043718" class="text-dark">A Course in Large Sample Theory</a>
- <div .card-footer>
- <a .btn href="http://www.michaeljordansworld.com"> Fanmade Website
+ <div .container>
+ <div .row>
+ $forall person <- allPeople
+ #{displayPerson person}
|]