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 charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="stylesheet" href="/mdn-style.min.css">
|
<link rel="stylesheet" href="./mdn-style.min.css">
|
||||||
<link rel="stylesheet" href="/foo-style.min.css">
|
<link rel="stylesheet" href="./foo-style.min.css">
|
||||||
|
|
||||||
<title>Document</title>
|
<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>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<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="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 src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var app = Elm.Main.init({ node: document.getElementById("app") });
|
var app = Elm.Main.init({ node: document.getElementById("app") });
|
||||||
|
|||||||
+16
-75
@@ -1,11 +1,9 @@
|
|||||||
port module Blog exposing (..)
|
port module Blog exposing (..)
|
||||||
|
|
||||||
import Base exposing (urlPrefix)
|
import Base exposing (..)
|
||||||
import Browser.Dom as Dom
|
|
||||||
import Html 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 Http exposing (Error(..))
|
||||||
import Task
|
|
||||||
import Url exposing (Protocol(..))
|
import Url exposing (Protocol(..))
|
||||||
import Yaml.Decode as Yaml exposing (Decoder, field, list, string)
|
import Yaml.Decode as Yaml exposing (Decoder, field, list, string)
|
||||||
|
|
||||||
@@ -50,6 +48,7 @@ initialModel =
|
|||||||
port sendString : String -> Cmd msg
|
port sendString : String -> Cmd msg
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- port isRenderComplete : (Bool -> msg) -> Sub msg
|
-- port isRenderComplete : (Bool -> msg) -> Sub msg
|
||||||
|
|
||||||
|
|
||||||
@@ -59,7 +58,19 @@ view model =
|
|||||||
[ div [ class "foo-console foo-terminal foo-active" ]
|
[ div [ class "foo-console foo-terminal foo-active" ]
|
||||||
[ div [ class "main-wrapper" ]
|
[ div [ class "main-wrapper" ]
|
||||||
[ main_ [ class "main-content", id "content" ]
|
[ 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
|
type Msg
|
||||||
= GetMarkdown
|
= GetMarkdown
|
||||||
| DataReceived (Result Http.Error String)
|
| DataReceived (Result Http.Error String)
|
||||||
-- | ScrollToFragment Bool Bool
|
|
||||||
-- | ScrollAttempted (Result Dom.Error ())
|
|
||||||
| NoSuchPage
|
| 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 -> ( Model, Cmd Msg )
|
||||||
update msg model =
|
update msg model =
|
||||||
case msg of
|
case msg of
|
||||||
@@ -223,15 +208,9 @@ update msg model =
|
|||||||
DataReceived (Err err) ->
|
DataReceived (Err err) ->
|
||||||
( { model | success = False, error = Just (errorToString err) }, Cmd.none )
|
( { model | success = False, error = Just (errorToString err) }, Cmd.none )
|
||||||
|
|
||||||
-- ScrollToFragment _ _ ->
|
|
||||||
-- ( model, scrollOnFragment model.fragment )
|
|
||||||
|
|
||||||
NoSuchPage ->
|
NoSuchPage ->
|
||||||
( { model | success = False }, Cmd.none )
|
( { model | success = False }, Cmd.none )
|
||||||
|
|
||||||
-- ScrollAttempted _ ->
|
|
||||||
-- ( model, Cmd.none )
|
|
||||||
|
|
||||||
|
|
||||||
errorToString : Http.Error -> String
|
errorToString : Http.Error -> String
|
||||||
errorToString error =
|
errorToString error =
|
||||||
@@ -258,44 +237,6 @@ errorToString error =
|
|||||||
errorMessage
|
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 =
|
type alias YamlMeta =
|
||||||
{ title : String
|
{ title : String
|
||||||
, date : String
|
, date : String
|
||||||
|
|||||||
+40
-14
@@ -1,17 +1,16 @@
|
|||||||
module Splash exposing (..)
|
module Splash exposing (..)
|
||||||
|
|
||||||
import Html exposing (Html, div, img, p, text)
|
import Html exposing (Html, a, div, i, img, p, span, text)
|
||||||
import Html.Attributes exposing (alt, class, height, src, width)
|
import Html.Attributes exposing (alt, class, height, href, src, style, width)
|
||||||
|
|
||||||
|
|
||||||
type alias Model =
|
type alias Model =
|
||||||
{ urls : List String
|
{ support_message : Html Msg
|
||||||
, support_message : String
|
, error_message : Html Msg
|
||||||
, error_message : String
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
view : Model -> Html msg
|
view : Model -> Html Msg
|
||||||
view model =
|
view model =
|
||||||
div [ class "foo-content" ]
|
div [ class "foo-content" ]
|
||||||
[ div [ class "foo-error" ]
|
[ div [ class "foo-error" ]
|
||||||
@@ -23,8 +22,17 @@ view model =
|
|||||||
, height 130
|
, height 130
|
||||||
]
|
]
|
||||||
[]
|
[]
|
||||||
, div [ class "foo-support__message" ] [ text model.support_message ]
|
, div [ class "foo-support__message" ] [ model.support_message ]
|
||||||
, div [ class "foo-error__message" ] [ text model.error_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 : String -> Model
|
||||||
notFound error =
|
notFound error =
|
||||||
{ urls = []
|
{ support_message = default.support_message
|
||||||
, support_message = "We couldn't find the page you were looking for."
|
, error_message =
|
||||||
, error_message = "The url " ++ error ++ " does not exist."
|
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 : Model
|
||||||
default =
|
default =
|
||||||
{ urls = []
|
{ support_message =
|
||||||
, support_message = "We are looking for the SpaceTime"
|
span []
|
||||||
, error_message = "We are sorry, but we can't find the SpaceTime"
|
[ 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