Update gitignore, update code.
This commit is contained in:
parent
21dbefab2d
commit
f6d93413dd
3 changed files with 78 additions and 63 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@ assets/images/420/
|
|||
assets/images/full/
|
||||
assets/other/
|
||||
assets/javascripts/main.js
|
||||
.vscode/
|
||||
|
|
2
elm.json
2
elm.json
|
@ -3,7 +3,7 @@
|
|||
"source-directories": [
|
||||
"src"
|
||||
],
|
||||
"elm-version": "0.19.0",
|
||||
"elm-version": "0.19.1",
|
||||
"dependencies": {
|
||||
"direct": {
|
||||
"elm/browser": "1.0.1",
|
||||
|
|
138
src/Main.elm
138
src/Main.elm
|
@ -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.Attributes exposing (class, href, rel, src, title)
|
||||
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)
|
||||
|
||||
|
||||
|
||||
-- MAIN
|
||||
|
||||
|
||||
|
@ -29,7 +30,7 @@ main : Program Flags Model Msg
|
|||
main =
|
||||
document
|
||||
{ init = init
|
||||
, view = (\model -> { title = "Your Mom", body = view model })
|
||||
, view = \model -> { title = "Your Mom", body = view model }
|
||||
, update = update
|
||||
, subscriptions = subscriptions
|
||||
}
|
||||
|
@ -187,12 +188,12 @@ init flags =
|
|||
"A completed game board."
|
||||
"Angels and Demons"
|
||||
[ "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"
|
||||
++ " 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 "
|
||||
++ " 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"
|
||||
++ " been converted to the repository's readme."
|
||||
++ " 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"
|
||||
++ " (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"
|
||||
++ " are also no instructions aside from a rough document I made for the class, which has"
|
||||
++ " been converted to the repository's readme."
|
||||
]
|
||||
[ ( "Git Repo"
|
||||
, "https://gitea.werefoxsoftware.com/shadow8t4/angels-and-demons"
|
||||
|
@ -246,18 +247,18 @@ init flags =
|
|||
"The status screen of the game."
|
||||
"Monster Chase"
|
||||
[ "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"
|
||||
++ " 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"
|
||||
++ " 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"
|
||||
++ " 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 functional and the source code for both the app and server are available in their"
|
||||
++ "subsequent repositories."
|
||||
, "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"
|
||||
++ " were also programmed by me, or I at least had a hand in."
|
||||
++ " 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"
|
||||
++ " 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"
|
||||
++ " 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"
|
||||
++ "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"
|
||||
++ "subsequent repositories."
|
||||
, "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"
|
||||
++ " were also programmed by me, or I at least had a hand in."
|
||||
]
|
||||
[ ( "Git Repo "
|
||||
, "https://gitea.werefoxsoftware.com/shadow8t4/MochaPine64Backup"
|
||||
|
@ -306,10 +307,10 @@ init flags =
|
|||
"An image of the re-implementation's output."
|
||||
"Re:Procedural City"
|
||||
[ "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"
|
||||
++ " 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"
|
||||
++ " of the library functions is much more accessible."
|
||||
++ " 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"
|
||||
++ " ones used in the original project provided by my professor, meaning that documentation"
|
||||
++ " of the library functions is much more accessible."
|
||||
]
|
||||
[ ( "Git Repo"
|
||||
, "https://gitea.werefoxsoftware.com/shadow8t4/Re-ProceduralCity"
|
||||
|
@ -370,8 +371,10 @@ init flags =
|
|||
"/"
|
||||
]
|
||||
}
|
||||
, Task.perform WindowWidth (getViewport
|
||||
|> Task.map (\viewport -> floor viewport.scene.width))
|
||||
, Task.perform WindowWidth
|
||||
(getViewport
|
||||
|> Task.map (\viewport -> floor viewport.scene.width)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
@ -402,7 +405,7 @@ initDropdown index item =
|
|||
Dropdown
|
||||
name
|
||||
{ config
|
||||
| name = "dropdown" ++ (String.fromInt index)
|
||||
| name = "dropdown" ++ String.fromInt index
|
||||
, message = ToggleDropdown index
|
||||
}
|
||||
items
|
||||
|
@ -411,7 +414,7 @@ initDropdown index item =
|
|||
Dropdown
|
||||
name
|
||||
{ defaultDropdownConfig
|
||||
| name = "dropdown" ++ (String.fromInt index)
|
||||
| name = "dropdown" ++ String.fromInt index
|
||||
, message = ToggleDropdown index
|
||||
}
|
||||
items
|
||||
|
@ -488,6 +491,7 @@ headerBar : Model -> Html Msg
|
|||
headerBar model =
|
||||
if model.flags.mobile || model.nav.smallNav then
|
||||
mobileHeaderbar model
|
||||
|
||||
else
|
||||
desktopHeaderBar model
|
||||
|
||||
|
@ -508,10 +512,12 @@ mobileHeaderbar model =
|
|||
header [ class "mobile-header" ]
|
||||
[ div
|
||||
([ class "show-nav", onClick (ToggleNav (not model.nav.showNav)) ]
|
||||
++ if model.nav.showNav then
|
||||
[ class "active" ]
|
||||
else
|
||||
[]
|
||||
++ (if model.nav.showNav then
|
||||
[ class "active" ]
|
||||
|
||||
else
|
||||
[]
|
||||
)
|
||||
)
|
||||
[ p []
|
||||
[ text model.nav.navText
|
||||
|
@ -520,10 +526,12 @@ mobileHeaderbar model =
|
|||
]
|
||||
, nav
|
||||
([ class "mobile-nav" ]
|
||||
++ if model.nav.showNav then
|
||||
[]
|
||||
else
|
||||
[ class "hidden" ]
|
||||
++ (if model.nav.showNav then
|
||||
[]
|
||||
|
||||
else
|
||||
[ class "hidden" ]
|
||||
)
|
||||
)
|
||||
[ div [ class "mobile-nav-wrapper", class "nav-wrapper" ]
|
||||
[ ul [] (Array.map navItem model.nav.items |> Array.toList)
|
||||
|
@ -577,22 +585,23 @@ navLink name url =
|
|||
navDropdown : String -> DropdownConfig -> Array NavItem -> Html Msg
|
||||
navDropdown name config items =
|
||||
li [ class "nav-item" ]
|
||||
[ dropdown div []
|
||||
[
|
||||
(toggle div
|
||||
[ dropdown div
|
||||
[]
|
||||
[ toggle div
|
||||
([ class "button-wrapper" ]
|
||||
++ if config.state then
|
||||
[ class "dropdown-active" ]
|
||||
else
|
||||
[]
|
||||
++ (if config.state then
|
||||
[ class "dropdown-active" ]
|
||||
|
||||
else
|
||||
[]
|
||||
)
|
||||
)
|
||||
[ p []
|
||||
[ text name
|
||||
, 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
|
||||
(dropdownConfig config)
|
||||
|
@ -631,7 +640,7 @@ viewGallery gallery =
|
|||
|> List.indexedMap (\index item -> ( index, item ))
|
||||
|> List.foldl
|
||||
(\( index, item ) acc ->
|
||||
if (remainderBy gallery.columns index) < Array.length acc then
|
||||
if remainderBy gallery.columns index < Array.length acc then
|
||||
case
|
||||
acc
|
||||
|> Array.get (remainderBy gallery.columns index)
|
||||
|
@ -642,25 +651,26 @@ viewGallery gallery =
|
|||
|
||||
Nothing ->
|
||||
acc
|
||||
|
||||
else
|
||||
Array.push [ item ] acc
|
||||
)
|
||||
Array.empty
|
||||
in
|
||||
div [ class "gallery" ]
|
||||
[ section [ class "gallery-wrapper" ]
|
||||
[ article [ class "gallery-info" ]
|
||||
[ h2 [] [ text gallery.title ]
|
||||
, p [] [ text gallery.description ]
|
||||
, 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" ]
|
||||
[ section [ class "gallery-wrapper" ]
|
||||
[ article [ class "gallery-info" ]
|
||||
[ h2 [] [ text gallery.title ]
|
||||
, p [] [ text gallery.description ]
|
||||
, 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
|
||||
)
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
displayImage : GalleryItem -> Html Msg
|
||||
|
@ -765,10 +775,13 @@ updateGalleryWidth : Bool -> Int -> Gallery -> Gallery
|
|||
updateGalleryWidth mobile width gallery =
|
||||
if mobile then
|
||||
gallery
|
||||
|
||||
else if width < 632 then
|
||||
{ gallery | columns = 1 }
|
||||
|
||||
else if width < 932 then
|
||||
{ gallery | columns = 2 }
|
||||
|
||||
else
|
||||
{ gallery | columns = 3 }
|
||||
|
||||
|
@ -777,6 +790,7 @@ updateNavWidth : Int -> Navigation -> Navigation
|
|||
updateNavWidth width nav =
|
||||
if width < 700 then
|
||||
{ nav | smallNav = True }
|
||||
|
||||
else
|
||||
{ nav | smallNav = False, showNav = False }
|
||||
|
||||
|
|
Reference in a new issue