Something resembling of a front page
This commit is contained in:
1 parent
0579b6d3e1
commit
1e088afce4
5 files changed
+77
-1
No files matched your search
@@ -18,6 +18,8 @@ cabal-version: >=1.10
|
||||
executable ebook-manager
|
||||
main-is: Main.hs
|
||||
other-modules: Devel.Main
|
||||
, Server
|
||||
, API
|
||||
-- other-extensions:
|
||||
build-depends: base >=4.10 && <4.11
|
||||
, servant
|
||||
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
{-# Language DataKinds #-}
|
||||
{-# Language TypeFamilies #-}
|
||||
{-# Language TypeOperators #-}
|
||||
{-# Language NoImplicitPrelude #-}
|
||||
{-# Language MultiParamTypeClasses #-}
|
||||
{-# Language OverloadedStrings #-}
|
||||
{-# Language TemplateHaskell #-}
|
||||
{-# Language QuasiQuotes #-}
|
||||
{-# Language RecordWildCards #-}
|
||||
{-# Language DeriveGeneric #-}
|
||||
{-# Language FlexibleInstances #-}
|
||||
module API (API, handler) where
|
||||
|
||||
|
||||
import ClassyPrelude hiding (Handler, Index)
|
||||
import Servant
|
||||
import Servant.HTML.Lucid (HTML)
|
||||
import Lucid (HtmlT, ToHtml(..))
|
||||
import qualified Lucid.Html5 as H
|
||||
|
||||
data Index = Index
|
||||
|
||||
bulma :: Monad m => HtmlT m ()
|
||||
bulma = H.doctypehtml_ $ do
|
||||
H.meta_ [ H.name_ "viewport", H.content_ "width=device-width, initial-scale=1" ]
|
||||
H.meta_ [ H.charset_ "utf-8" ]
|
||||
H.title_ "Hello bulma!"
|
||||
H.link_ [ H.rel_ "stylesheet", H.href_ "/static/css/bulma.min.css" ]
|
||||
H.script_ [ H.defer_ "", H.src_ "https://use.fontawesome.com/releases/v5.1.0/js/all.js" ] ("" :: String)
|
||||
H.body_ $ do
|
||||
H.section_ [ H.class_ "section" ] $ do
|
||||
H.div_ [ H.class_ "container" ] $ do
|
||||
H.h1_ [ H.class_ "title" ] "Hello world"
|
||||
H.p_ [ H.class_ "subtitle" ] "My first website with bulma"
|
||||
|
||||
instance ToHtml Index where
|
||||
toHtml _ = bulma
|
||||
toHtmlRaw = toHtml
|
||||
|
||||
type API = Get '[HTML] Index
|
||||
|
||||
handler :: ServerT API Handler
|
||||
handler = return Index
|
||||
+4
-1
@@ -1,7 +1,10 @@
|
||||
module Main where
|
||||
|
||||
import Server (server)
|
||||
import Network.Wai.Handler.Warp (run)
|
||||
|
||||
defaultMain :: IO ()
|
||||
defaultMain = putStrLn "Hello haskell"
|
||||
defaultMain = run 8080 server
|
||||
|
||||
main :: IO ()
|
||||
main = defaultMain
|
||||
@@ -0,0 +1,27 @@
|
||||
{-# Language DataKinds #-}
|
||||
{-# Language TypeFamilies #-}
|
||||
{-# Language TypeOperators #-}
|
||||
{-# Language NoImplicitPrelude #-}
|
||||
{-# Language MultiParamTypeClasses #-}
|
||||
{-# Language OverloadedStrings #-}
|
||||
{-# Language TemplateHaskell #-}
|
||||
{-# Language QuasiQuotes #-}
|
||||
{-# Language RecordWildCards #-}
|
||||
{-# Language DeriveGeneric #-}
|
||||
{-# Language FlexibleInstances #-}
|
||||
module Server where
|
||||
|
||||
import qualified API as API
|
||||
import Servant
|
||||
|
||||
type API = API.API :<|> "static" :> Raw
|
||||
|
||||
handler :: ServerT API Handler
|
||||
handler = API.handler :<|> serveDirectoryFileServer "static"
|
||||
|
||||
|
||||
server :: Application
|
||||
server = serve api handler
|
||||
where
|
||||
api :: Proxy API
|
||||
api = Proxy
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
/*! bulma.io v0.7.1 | MIT License | github.com/jgthms/bulma */@-webkit-keyframes spinAround{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinAround{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.breadcrumb,.button,.delete,.file,.is-unselectable,.modal-close,.pagination-ellipsis,.pagination-link,.pagination-next,.pagination-previous,.tabs{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.navbar-link::after,.select:not(.is-multiple):not(.is-loading)::after{border:3px solid transparent;border-radius:2px;border-right:0;border-top:0;content:" ";display:block;height:.625em;margin-top:-.4375em;pointer-events:none;position:absolute;top:50%;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:center;transform-origin:center;width:.625em}.block:not(:last-child),.box:not(:last-child),.breadcrumb:not(:last-child),.content:not(:last-child),.highlight:not(:last-child),.level:not(:last-child),.message:not(:last-child),.notification:not(:last-child),.progress:not(:last-child),.subtitle:not(:last-child),.table-container:not(:last-child),.table:not(:last-child),.tabs:not(:last-child),.title:not(:last-child){margin-bottom:1.5rem}.delete,.modal-close{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(10,10,10,.2);border:none;border-radius:290486px;cursor:pointer;display:inline-block;flex-grow:0;flex-shrink:0;font-size:0;height:20px;max-height:20px;max-width:20px;min-height:20px;min-width:20px;outline:0;position:relative;vertical-align:top;width:20px}.delete::after,.delete::before,.modal-close::after,.modal-close::before{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;-webkit-transform:translateX(-50%) translateY(-50%) rotate(45deg);transform:translateX(-50%) translateY(-50%) rotate(45deg);-webkit-transform-origin:center center;transform-origin:center center}.delete::before,.modal-close::before{height:2px;width:50%}.delete::after,.modal-close::after{height:50%;width:2px}.delete:focus,.delete:hover,.modal-close:focus,.modal-close:hover{background-color:rgba(10,10,10,.3)}.delete:active,.modal-close:active{background-color:rgba(10,10,10,.4)}.is-small.delete,.is-small.modal-close{height:16px;max-height:16px;max-width:16px;min-height:16px;min-width:16px;width:16px}.is-medium.delete,.is-medium.modal-close{height:24px;max-height:24px;max-width:24px;min-height:24px;min-width:24px;width:24px}.is-large.delete,.is-large.modal-close{height:32px;max-height:32px;max-width:32px;min-height:32px;min-width:32px;width:32px}.button.is-loading::after,.control.is-loading::after,.loader,.select.is-loading::after{-webkit-animation:spinAround .5s infinite linear;animation:spinAround .5s infinite linear;border:2px solid #dbdbdb;border-radius:290486px;border-right-color:transparent;border-top-color:transparent;content:"";display:block;height:1em;position:relative;width:1em}.hero-video,.image.is-16by9 img,.image.is-1by1 img,.image.is-1by2 img,.image.is-1by3 img,.image.is-2by1 img,.image.is-2by3 img,.image.is-3by1 img,.image.is-3by2 img,.image.is-3by4 img,.image.is-3by5 img,.image.is-4by3 img,.image.is-4by5 img,.image.is-5by3 img,.image.is-5by4 img,.image.is-9by16 img,.image.is-square img,.is-overlay,.modal,.modal-background{bottom:0;left:0;position:absolute;right:0;top:0}.button,.file-cta,.file-name,.input,.pagination-ellipsis,.pagination-link,.pagination-next,.pagination-previous,.select select,.textarea{-moz-appearance:none;-webkit-appearance:none;align-items:center;border:1px solid transparent;border-radius:4px;box-shadow:none;display:inline-flex;font-size:1rem;height:2.25em;justify-content:flex-start;line-height:1.5;padding-bottom:calc(.375em - 1px);padding-left:calc(.625em - 1px);padding-right:calc(.625em - 1px);padding-top:calc(.375em - 1px);position:relative;vertical-align:top}.button:active,.button:focus,.file-cta:active,.file-cta:focus,.file-name:active,.file-name:focus,.input:active,.input:focus,.is-active.button,.is-active.file-cta,.is-active.file-name,.is-active.input,.is-active.pagination-ellipsis,.is-active.pagination-link,.is-active.pagination-next,.is-active.pagination-previous,.is-active.textarea,.is-focused.button,.is-focused.file-cta,.is-focused.file-name,.is-focused.input,.is-focused.pagination-ellipsis,.is-focused.pagination-link,.is-focused.pagination-next,.is-focused.pagination-previous,.is-focused.textarea,.pagination-ellipsis:active,.pagination-ellipsis:focus,.pagination-link:active,.pagination-link:focus,.pagination-next:active,.pagination-next:focus,.pagination-previous:active,.pagination-previous:focus,.select select.is-active,.select select.is-focused,.select select:active,.select select:focus,.textarea:active,.textarea:focus{outline:0}.button[disabled],.file-cta[disabled],.file-name[disabled],.input[disabled],.pagination-ellipsis[disabledLine truncated
|
||||
Reference in new issue
Block a user