aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorCadey Dodrill <me@christine.website>2016-12-14 06:20:25 -0800
committerCadey Dodrill <me@christine.website>2016-12-14 06:20:25 -0800
commit90f176019a1723aa0d4b7cbb97009944e60e963d (patch)
treea816f40b0c8c823aef2c8efe60ba4ef8891d876b /frontend
parent060a7c913a6eb1f30052504678e04fccc404b930 (diff)
downloadxesite-90f176019a1723aa0d4b7cbb97009944e60e963d.tar.xz
xesite-90f176019a1723aa0d4b7cbb97009944e60e963d.zip
add API backend
Diffstat (limited to 'frontend')
-rw-r--r--frontend/.psc-ide-port1
-rw-r--r--frontend/src/BlogIndex.purs12
-rw-r--r--frontend/src/Layout.purs2
-rw-r--r--frontend/support/index.html27
4 files changed, 35 insertions, 7 deletions
diff --git a/frontend/.psc-ide-port b/frontend/.psc-ide-port
deleted file mode 100644
index c421713..0000000
--- a/frontend/.psc-ide-port
+++ /dev/null
@@ -1 +0,0 @@
-15098 \ No newline at end of file
diff --git a/frontend/src/BlogIndex.purs b/frontend/src/BlogIndex.purs
index bd6e303..8f2c919 100644
--- a/frontend/src/BlogIndex.purs
+++ b/frontend/src/BlogIndex.purs
@@ -8,8 +8,9 @@ import Network.HTTP.Affjax (AJAX, get)
import Prelude (($), bind, map, const, show, (<>), pure, (<<<))
import Pux (EffModel, noEffects)
import Pux.Html (Html, br, div, h1, ol, li, button, text, span, p)
-import Pux.Html.Attributes (key, className)
+import Pux.Html.Attributes (key, className, id_)
import Pux.Html.Events (onClick)
+import Pux.Router (link)
data Action = RequestPosts
| ReceivePosts (Either String Posts)
@@ -58,9 +59,9 @@ update RequestPosts state =
post :: Post -> Html Action
post (Post state) =
div
- [ className "col s4" ]
+ [ className "col s6" ]
[ div
- [ className "card pink lighten-1" ]
+ [ className "card pink lighten-4" ]
[ div
[ className "card-content black-text" ]
[ span [ className "card-title" ] [ text state.title ]
@@ -68,6 +69,9 @@ post (Post state) =
, p [] [ text ("Posted on: " <> state.date) ]
, span [] [ text state.summary ]
]
+ , div
+ [ className "card-action pink" ]
+ [ link state.link [] [ text "Read More" ] ]
]
]
@@ -76,5 +80,5 @@ view state =
div
[]
[ h1 [] [ text state.status ]
- , button [ onClick (const RequestPosts) ] [ text "Fetch posts" ]
+ , button [ onClick (const RequestPosts), id_ "requestbutton", className "hidden" ] [ text "Fetch posts" ]
, div [ className "row" ] $ map post state.posts ]
diff --git a/frontend/src/Layout.purs b/frontend/src/Layout.purs
index 0507aef..93ffa4a 100644
--- a/frontend/src/Layout.purs
+++ b/frontend/src/Layout.purs
@@ -47,7 +47,7 @@ view state =
navbar :: State -> Html Action
navbar state =
nav
- [ className "light-blue lighten-1", role "navigation" ]
+ [ className "pink lighten-1", role "navigation" ]
[ div
[ className "nav-wrapper container" ]
[ link "/" [ className "brand-logo", id_ "logo-container" ] [ text "Christine Dodrill" ] ]
diff --git a/frontend/support/index.html b/frontend/support/index.html
index b37e676..3b53f83 100644
--- a/frontend/support/index.html
+++ b/frontend/support/index.html
@@ -4,7 +4,7 @@
<meta charset="UTF-8"/>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>Pux Starter App</title>
+ <title>Christine Dodrill</title>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/css/materialize.min.css">
@@ -14,5 +14,30 @@
</head>
<body>
<div id="app"></div>
+
+ <script>
+ // Forgive me
+ function eventFire(el, etype){
+ if (el.fireEvent) {
+ el.fireEvent('on' + etype);
+ } else {
+ var evObj = document.createEvent('Events');
+ evObj.initEvent(etype, true, false);
+ el.dispatchEvent(evObj);
+ }
+ }
+
+ interval = setInterval(function() {
+ e = document.getElementById("requestbutton");
+ if(e != null) {
+ eventFire(e, "click");
+ } else {
+ console.log("Tried so hard been so far")
+ }
+ clearInterval(interval);
+
+ e.style.display = "none";
+ }, 250);
+ </script>
</body>
</html>