Update gitignore, update code.

This commit is contained in:
Alexander Huddleston 2020-03-08 16:46:29 -05:00
parent 21dbefab2d
commit f6d93413dd
3 changed files with 78 additions and 63 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ assets/images/420/
assets/images/full/ assets/images/full/
assets/other/ assets/other/
assets/javascripts/main.js assets/javascripts/main.js
.vscode/

View file

@ -3,7 +3,7 @@
"source-directories": [ "source-directories": [
"src" "src"
], ],
"elm-version": "0.19.0", "elm-version": "0.19.1",
"dependencies": { "dependencies": {
"direct": { "direct": {
"elm/browser": "1.0.1", "elm/browser": "1.0.1",

View file

@ -9,17 +9,18 @@ module Main exposing (main)
-} -}
import Array exposing (Array)
import Browser exposing (document)
import Browser.Dom exposing (getViewport)
import Browser.Events exposing (onResize)
import Dropdown exposing (ToggleEvent(..), drawer, dropdown, toggle)
import Html exposing (Attribute, Html, a, article, button, div, footer, h1, h2, h3, h4, header, img, li, nav, p, section, span, text, ul) import Html exposing (Attribute, Html, a, article, button, div, footer, h1, h2, h3, h4, header, img, li, nav, p, section, span, text, ul)
import Html.Attributes exposing (class, href, rel, src, title) import Html.Attributes exposing (class, href, rel, src, title)
import Html.Events exposing (onClick) import Html.Events exposing (onClick)
import Array exposing (Array)
import Dropdown exposing (ToggleEvent(..), drawer, dropdown, toggle)
import Browser.Events exposing (onResize)
import Browser.Dom exposing (getViewport)
import Browser exposing (document)
import Task exposing (perform) import Task exposing (perform)
-- MAIN -- MAIN
@ -29,7 +30,7 @@ main : Program Flags Model Msg
main = main =
document document
{ init = init { init = init
, view = (\model -> { title = "Your Mom", body = view model }) , view = \model -> { title = "Your Mom", body = view model }
, update = update , update = update
, subscriptions = subscriptions , subscriptions = subscriptions
} }
@ -187,12 +188,12 @@ init flags =
"A completed game board." "A completed game board."
"Angels and Demons" "Angels and Demons"
[ "Angels and Demons is a board game concept I created during my time in college, specifically" [ "Angels and Demons is a board game concept I created during my time in college, specifically"
++ " during my Game History class. I decided on my own time to take up converting it to a" ++ " during my Game History class. I decided on my own time to take up converting it to a"
++ " video game. Right now, it's focused for mainly Android and WebGL builds. It's currently" ++ " video game. Right now, it's focused for mainly Android and WebGL builds. It's currently"
++ " (as of June 2018) in very early development. The basic mechanics and logic work, but " ++ " (as of June 2018) in very early development. The basic mechanics and logic work, but "
++ " it can only be played locally with very little indication of turns or progress. There" ++ " it can only be played locally with very little indication of turns or progress. There"
++ " are also no instructions aside from a rough document I made for the class, which has" ++ " are also no instructions aside from a rough document I made for the class, which has"
++ " been converted to the repository's readme." ++ " been converted to the repository's readme."
] ]
[ ( "Git Repo" [ ( "Git Repo"
, "https://gitea.werefoxsoftware.com/shadow8t4/angels-and-demons" , "https://gitea.werefoxsoftware.com/shadow8t4/angels-and-demons"
@ -246,18 +247,18 @@ init flags =
"The status screen of the game." "The status screen of the game."
"Monster Chase" "Monster Chase"
[ "Monster Chase was a fitness game/app developed during my senior capstone class in college." [ "Monster Chase was a fitness game/app developed during my senior capstone class in college."
++ " The development team consisted of me and 4 other computer science majors, and the" ++ " The development team consisted of me and 4 other computer science majors, and the"
++ " objective was to create a fitness game designed to track users' steps through engaging" ++ " objective was to create a fitness game designed to track users' steps through engaging"
++ " gameplay of the user being virtually chased by a monster that they could customize and" ++ " gameplay of the user being virtually chased by a monster that they could customize and"
++ " use to challenge other players online. The game makes use of the FitBit API if a device" ++ " use to challenge other players online. The game makes use of the FitBit API if a device"
++ " and subsequent account are available to help track data and utilizes and separate server" ++ " and subsequent account are available to help track data and utilizes and separate server"
++ " to keep track of points for an online leaderboard functionality. While the finaly build" ++ " to keep track of points for an online leaderboard functionality. While the finaly build"
++ "is still in many cases a prototype compared to what we initially intended to develop, it" ++ "is still in many cases a prototype compared to what we initially intended to develop, it"
++ "is functional and the source code for both the app and server are available in their" ++ "is functional and the source code for both the app and server are available in their"
++ "subsequent repositories." ++ "subsequent repositories."
, "During the development of the game, I worked mainly on the front-end design and functionality" , "During the development of the game, I worked mainly on the front-end design and functionality"
++ " of the game through the Unity editor. Most scripted events and transitions in the front end" ++ " of the game through the Unity editor. Most scripted events and transitions in the front end"
++ " were also programmed by me, or I at least had a hand in." ++ " were also programmed by me, or I at least had a hand in."
] ]
[ ( "Git Repo " [ ( "Git Repo "
, "https://gitea.werefoxsoftware.com/shadow8t4/MochaPine64Backup" , "https://gitea.werefoxsoftware.com/shadow8t4/MochaPine64Backup"
@ -306,10 +307,10 @@ init flags =
"An image of the re-implementation's output." "An image of the re-implementation's output."
"Re:Procedural City" "Re:Procedural City"
[ "A Rust implementation of the Procedural City project. This was done to gain some insight" [ "A Rust implementation of the Procedural City project. This was done to gain some insight"
++ " into the programming language and to refamiliarize myself with the work itself. In" ++ " into the programming language and to refamiliarize myself with the work itself. In"
++ " addition, the project is done through solely open-source libraries as opposed to the" ++ " addition, the project is done through solely open-source libraries as opposed to the"
++ " ones used in the original project provided by my professor, meaning that documentation" ++ " ones used in the original project provided by my professor, meaning that documentation"
++ " of the library functions is much more accessible." ++ " of the library functions is much more accessible."
] ]
[ ( "Git Repo" [ ( "Git Repo"
, "https://gitea.werefoxsoftware.com/shadow8t4/Re-ProceduralCity" , "https://gitea.werefoxsoftware.com/shadow8t4/Re-ProceduralCity"
@ -370,8 +371,10 @@ init flags =
"/" "/"
] ]
} }
, Task.perform WindowWidth (getViewport , Task.perform WindowWidth
|> Task.map (\viewport -> floor viewport.scene.width)) (getViewport
|> Task.map (\viewport -> floor viewport.scene.width)
)
) )
@ -402,7 +405,7 @@ initDropdown index item =
Dropdown Dropdown
name name
{ config { config
| name = "dropdown" ++ (String.fromInt index) | name = "dropdown" ++ String.fromInt index
, message = ToggleDropdown index , message = ToggleDropdown index
} }
items items
@ -411,7 +414,7 @@ initDropdown index item =
Dropdown Dropdown
name name
{ defaultDropdownConfig { defaultDropdownConfig
| name = "dropdown" ++ (String.fromInt index) | name = "dropdown" ++ String.fromInt index
, message = ToggleDropdown index , message = ToggleDropdown index
} }
items items
@ -488,6 +491,7 @@ headerBar : Model -> Html Msg
headerBar model = headerBar model =
if model.flags.mobile || model.nav.smallNav then if model.flags.mobile || model.nav.smallNav then
mobileHeaderbar model mobileHeaderbar model
else else
desktopHeaderBar model desktopHeaderBar model
@ -508,10 +512,12 @@ mobileHeaderbar model =
header [ class "mobile-header" ] header [ class "mobile-header" ]
[ div [ div
([ class "show-nav", onClick (ToggleNav (not model.nav.showNav)) ] ([ class "show-nav", onClick (ToggleNav (not model.nav.showNav)) ]
++ if model.nav.showNav then ++ (if model.nav.showNav then
[ class "active" ] [ class "active" ]
else
[] else
[]
)
) )
[ p [] [ p []
[ text model.nav.navText [ text model.nav.navText
@ -520,10 +526,12 @@ mobileHeaderbar model =
] ]
, nav , nav
([ class "mobile-nav" ] ([ class "mobile-nav" ]
++ if model.nav.showNav then ++ (if model.nav.showNav then
[] []
else
[ class "hidden" ] else
[ class "hidden" ]
)
) )
[ div [ class "mobile-nav-wrapper", class "nav-wrapper" ] [ div [ class "mobile-nav-wrapper", class "nav-wrapper" ]
[ ul [] (Array.map navItem model.nav.items |> Array.toList) [ ul [] (Array.map navItem model.nav.items |> Array.toList)
@ -577,22 +585,23 @@ navLink name url =
navDropdown : String -> DropdownConfig -> Array NavItem -> Html Msg navDropdown : String -> DropdownConfig -> Array NavItem -> Html Msg
navDropdown name config items = navDropdown name config items =
li [ class "nav-item" ] li [ class "nav-item" ]
[ dropdown div [] [ dropdown div
[ []
(toggle div [ toggle div
([ class "button-wrapper" ] ([ class "button-wrapper" ]
++ if config.state then ++ (if config.state then
[ class "dropdown-active" ] [ class "dropdown-active" ]
else
[] else
[]
)
) )
[ p [] [ p []
[ text name [ text name
, span [ class "carat" ] [] , span [ class "carat" ] []
] ]
] ]
) , drawer ul [ class "dropdown" ] (Array.map subItem items |> Array.toList)
, (drawer ul [ class "dropdown" ] (Array.map subItem items |> Array.toList))
] ]
config.state config.state
(dropdownConfig config) (dropdownConfig config)
@ -631,7 +640,7 @@ viewGallery gallery =
|> List.indexedMap (\index item -> ( index, item )) |> List.indexedMap (\index item -> ( index, item ))
|> List.foldl |> List.foldl
(\( index, item ) acc -> (\( index, item ) acc ->
if (remainderBy gallery.columns index) < Array.length acc then if remainderBy gallery.columns index < Array.length acc then
case case
acc acc
|> Array.get (remainderBy gallery.columns index) |> Array.get (remainderBy gallery.columns index)
@ -642,25 +651,26 @@ viewGallery gallery =
Nothing -> Nothing ->
acc acc
else else
Array.push [ item ] acc Array.push [ item ] acc
) )
Array.empty Array.empty
in in
div [ class "gallery" ] div [ class "gallery" ]
[ section [ class "gallery-wrapper" ] [ section [ class "gallery-wrapper" ]
[ article [ class "gallery-info" ] [ article [ class "gallery-info" ]
[ h2 [] [ text gallery.title ] [ h2 [] [ text gallery.title ]
, p [] [ text gallery.description ] , p [] [ text gallery.description ]
, a [ href gallery.url ] [ text gallery.urltext ] , a [ href gallery.url ] [ text gallery.urltext ]
]
, div [ class "gallery-columns" ]
(arr
|> Array.map (div [ class "gallery-column" ] << List.map displayImage << List.reverse)
|> Array.toList
)
] ]
, div [ class "gallery-columns" ]
(arr
|> Array.map (div [ class "gallery-column" ] << List.map displayImage << List.reverse)
|> Array.toList
)
] ]
]
displayImage : GalleryItem -> Html Msg displayImage : GalleryItem -> Html Msg
@ -765,10 +775,13 @@ updateGalleryWidth : Bool -> Int -> Gallery -> Gallery
updateGalleryWidth mobile width gallery = updateGalleryWidth mobile width gallery =
if mobile then if mobile then
gallery gallery
else if width < 632 then else if width < 632 then
{ gallery | columns = 1 } { gallery | columns = 1 }
else if width < 932 then else if width < 932 then
{ gallery | columns = 2 } { gallery | columns = 2 }
else else
{ gallery | columns = 3 } { gallery | columns = 3 }
@ -777,6 +790,7 @@ updateNavWidth : Int -> Navigation -> Navigation
updateNavWidth width nav = updateNavWidth width nav =
if width < 700 then if width < 700 then
{ nav | smallNav = True } { nav | smallNav = True }
else else
{ nav | smallNav = False, showNav = False } { nav | smallNav = False, showNav = False }