mirror of
https://github.com/avinal/avinal.github.io.git
synced 2026-07-03 23:30:09 +05:30
add font page design
Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
-20
@@ -1,20 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="public/foo-style.css">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="public/app.js"></script>
|
||||
<script>
|
||||
var app = Elm.Main.init({ node: document.getElementById("app") });
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
+6
-5
@@ -5,19 +5,20 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="/mdn-style.min.css">
|
||||
<link rel="stylesheet" href="/foo-style.min.css">
|
||||
<link rel="stylesheet" href="./mdn-style.min.css">
|
||||
<link rel="stylesheet" href="./foo-style.min.css">
|
||||
|
||||
<title>Document</title>
|
||||
<script src="/redirect.js"></script>
|
||||
<script src="./redirect.js"></script>
|
||||
<script src="https://kit.fontawesome.com/7a57741988.js" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
<script src="/app.js"></script>
|
||||
<script src="./app.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||
<script src="/prism.js"></script>
|
||||
<script src="./prism.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
|
||||
<script>
|
||||
var app = Elm.Main.init({ node: document.getElementById("app") });
|
||||
|
||||
+16
-75
@@ -1,11 +1,9 @@
|
||||
port module Blog exposing (..)
|
||||
|
||||
import Base exposing (urlPrefix)
|
||||
import Browser.Dom as Dom
|
||||
import Base exposing (..)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (class, href, id, style)
|
||||
import Html.Attributes exposing (class, href, id, src, style)
|
||||
import Http exposing (Error(..))
|
||||
import Task
|
||||
import Url exposing (Protocol(..))
|
||||
import Yaml.Decode as Yaml exposing (Decoder, field, list, string)
|
||||
|
||||
@@ -50,6 +48,7 @@ initialModel =
|
||||
port sendString : String -> Cmd msg
|
||||
|
||||
|
||||
|
||||
-- port isRenderComplete : (Bool -> msg) -> Sub msg
|
||||
|
||||
|
||||
@@ -59,7 +58,19 @@ view model =
|
||||
[ div [ class "foo-console foo-terminal foo-active" ]
|
||||
[ div [ class "main-wrapper" ]
|
||||
[ main_ [ class "main-content", id "content" ]
|
||||
[ viewArticle model.success ]
|
||||
[ case model.blog of
|
||||
Just blog ->
|
||||
case blog.meta.image of
|
||||
Just image ->
|
||||
img [ src image ] []
|
||||
|
||||
Nothing ->
|
||||
text ""
|
||||
|
||||
Nothing ->
|
||||
text ""
|
||||
, viewArticle model.success
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
@@ -130,17 +141,9 @@ viewMetadata show =
|
||||
]
|
||||
|
||||
|
||||
-- scrollOnFragment : String -> Cmd Msg
|
||||
-- scrollOnFragment fragment =
|
||||
-- Task.attempt ScrollAttempted
|
||||
-- (Dom.getElement fragment |> Task.andThen (\info -> Dom.setViewport 0 info.element.y))
|
||||
|
||||
|
||||
type Msg
|
||||
= GetMarkdown
|
||||
| DataReceived (Result Http.Error String)
|
||||
-- | ScrollToFragment Bool Bool
|
||||
-- | ScrollAttempted (Result Dom.Error ())
|
||||
| NoSuchPage
|
||||
|
||||
|
||||
@@ -188,24 +191,6 @@ getMarkdown url =
|
||||
}
|
||||
|
||||
|
||||
finalUrl : Maybe String -> String
|
||||
finalUrl slug =
|
||||
let
|
||||
resolvedSlug =
|
||||
Maybe.withDefault "error" slug
|
||||
in
|
||||
case resolvedSlug of
|
||||
"error" ->
|
||||
"https://raw.githubusercontent.com/avinal/avinal.space/content/posts/error.md"
|
||||
|
||||
_ ->
|
||||
"https://raw.githubusercontent.com/avinal/"
|
||||
++ urlPrefix
|
||||
++ "/main/content/posts/"
|
||||
++ resolvedSlug
|
||||
++ ".md"
|
||||
|
||||
|
||||
update : Msg -> Model -> ( Model, Cmd Msg )
|
||||
update msg model =
|
||||
case msg of
|
||||
@@ -223,15 +208,9 @@ update msg model =
|
||||
DataReceived (Err err) ->
|
||||
( { model | success = False, error = Just (errorToString err) }, Cmd.none )
|
||||
|
||||
-- ScrollToFragment _ _ ->
|
||||
-- ( model, scrollOnFragment model.fragment )
|
||||
|
||||
NoSuchPage ->
|
||||
( { model | success = False }, Cmd.none )
|
||||
|
||||
-- ScrollAttempted _ ->
|
||||
-- ( model, Cmd.none )
|
||||
|
||||
|
||||
errorToString : Http.Error -> String
|
||||
errorToString error =
|
||||
@@ -258,44 +237,6 @@ errorToString error =
|
||||
errorMessage
|
||||
|
||||
|
||||
-- subscriptions : Model -> Sub Msg
|
||||
-- subscriptions model =
|
||||
-- isRenderComplete
|
||||
-- (ScrollToFragment <|
|
||||
-- if model.fragment == "" then
|
||||
-- False
|
||||
|
||||
-- else
|
||||
-- True
|
||||
-- )
|
||||
|
||||
|
||||
|
||||
-- main : Program (String, String) Model Msg
|
||||
-- main =
|
||||
-- Browser.element
|
||||
-- { init = init
|
||||
-- , view = view
|
||||
-- , update = update
|
||||
-- , subscriptions = \_ -> Sub.none
|
||||
-- }
|
||||
-- div
|
||||
-- [ class "foo-term-story section-content" ]
|
||||
-- [ input
|
||||
-- [ placeholder "Enter URL to a markdown file"
|
||||
-- , value model.markdownUrl
|
||||
-- , onInput StoreInput
|
||||
-- ]
|
||||
-- []
|
||||
-- , button [ class "button secondary", onClick GetMarkdown ] [ text "Get Markdown" ]
|
||||
-- , if model.success then
|
||||
-- div [] []
|
||||
-- else
|
||||
-- div [ class "foo-error" ] [ text model.markDown ]
|
||||
-- ]
|
||||
-- YAML Stuff
|
||||
|
||||
|
||||
type alias YamlMeta =
|
||||
{ title : String
|
||||
, date : String
|
||||
|
||||
+40
-14
@@ -1,17 +1,16 @@
|
||||
module Splash exposing (..)
|
||||
|
||||
import Html exposing (Html, div, img, p, text)
|
||||
import Html.Attributes exposing (alt, class, height, src, width)
|
||||
import Html exposing (Html, a, div, i, img, p, span, text)
|
||||
import Html.Attributes exposing (alt, class, height, href, src, style, width)
|
||||
|
||||
|
||||
type alias Model =
|
||||
{ urls : List String
|
||||
, support_message : String
|
||||
, error_message : String
|
||||
{ support_message : Html Msg
|
||||
, error_message : Html Msg
|
||||
}
|
||||
|
||||
|
||||
view : Model -> Html msg
|
||||
view : Model -> Html Msg
|
||||
view model =
|
||||
div [ class "foo-content" ]
|
||||
[ div [ class "foo-error" ]
|
||||
@@ -23,8 +22,17 @@ view model =
|
||||
, height 130
|
||||
]
|
||||
[]
|
||||
, div [ class "foo-support__message" ] [ text model.support_message ]
|
||||
, div [ class "foo-error__message" ] [ text model.error_message ]
|
||||
, div [ class "foo-support__message" ] [ model.support_message ]
|
||||
, div [ class "foo-error__message" ] [ model.error_message ]
|
||||
, div [ class "foo-support__message" ]
|
||||
[ a [ href "https://avinal.space/pages/about-me" ] [ text "About me " ]
|
||||
, text " "
|
||||
, a [ href "https://avinal.space/posts" ] [ text "Blog" ]
|
||||
, text " "
|
||||
, a [ href "https://avinal.space/pages/projects" ] [ text "Projects" ]
|
||||
, text " "
|
||||
, a [ href "https://gsoc.avinal.space" ] [ text "GSoC" ]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
@@ -35,17 +43,35 @@ type Msg
|
||||
|
||||
notFound : String -> Model
|
||||
notFound error =
|
||||
{ urls = []
|
||||
, support_message = "We couldn't find the page you were looking for."
|
||||
, error_message = "The url " ++ error ++ " does not exist."
|
||||
{ support_message = default.support_message
|
||||
, error_message =
|
||||
span []
|
||||
[ i [ class "fa-duotone fa-triangle-exclamation foo-term-yellow" ] []
|
||||
, text " I could not find anything on this "
|
||||
, i [ class "fa-duotone fa-link" ] [ text error ]
|
||||
, text " . If you think this is a mistake, please contact me."
|
||||
, i [ class "fa-duotone fa-triangle-exclamation foo-term-yellow" ] []
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
default : Model
|
||||
default =
|
||||
{ urls = []
|
||||
, support_message = "We are looking for the SpaceTime"
|
||||
, error_message = "We are sorry, but we can't find the SpaceTime"
|
||||
{ support_message =
|
||||
span []
|
||||
[ a [ href "https://github.com/avinal" ] [ i [ class "fa-brands fa-github" ] [] ]
|
||||
, a [ href "https://www.linked.com/in/avinal" ] [ i [ class "fa-brands fa-linkedin" ] [] ]
|
||||
, a [ href "https://instagram.com/avinal.k" ] [ i [ class "fa-brands fa-instagram" ] [] ]
|
||||
, a [ href "" ] [ i [ class "fa-duotone fa-calandar-days" ] [] ]
|
||||
, a [ href "mailto:ripple+blog@avinal.space" ] [ i [ class "fa-duotone fa-envelope" ] [] ]
|
||||
, a [ href "https://avinal.space/terminal" ] [ i [ class "fa-duotone fa-terminal" ] [] ]
|
||||
]
|
||||
, error_message =
|
||||
span []
|
||||
[ text "I'm Avinal, and I work at Red Hat"
|
||||
, i [ class "fa-brands fa-redhat foo-term-red" ] []
|
||||
, text "as an Associate Software Engineer for Hybrid Cloud Engineering."
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user