diff --git a/.gitignore b/.gitignore index 04a9d44..b65ee9f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ assets/images/420/ assets/images/full/ assets/other/ assets/javascripts/main.js +.vscode/ diff --git a/elm.json b/elm.json index 6c75063..ad91a79 100644 --- a/elm.json +++ b/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", diff --git a/src/Main.elm b/src/Main.elm index 948af2f..cac2334 100644 --- a/src/Main.elm +++ b/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,11 @@ main : Program Flags Model Msg main = document { init = init +<<<<<<< HEAD , view = (\model -> { title = "Werefox Software", body = view model }) +======= + , view = \model -> { title = "Your Mom", body = view model } +>>>>>>> f6d93413dd1d2522bcad922341680ebeb1a268fa , update = update , subscriptions = subscriptions } @@ -199,12 +204,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.werefox.dev/shadow8t4/angels-and-demons" @@ -255,18 +260,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.werefox.dev/shadow8t4/MochaPine64Backup" @@ -309,10 +314,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.werefox.dev/shadow8t4/Re-ProceduralCity" @@ -373,8 +378,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) + ) ) @@ -405,7 +412,7 @@ initDropdown index item = Dropdown name { config - | name = "dropdown" ++ (String.fromInt index) + | name = "dropdown" ++ String.fromInt index , message = ToggleDropdown index } items @@ -414,7 +421,7 @@ initDropdown index item = Dropdown name { defaultDropdownConfig - | name = "dropdown" ++ (String.fromInt index) + | name = "dropdown" ++ String.fromInt index , message = ToggleDropdown index } items @@ -491,6 +498,7 @@ headerBar : Model -> Html Msg headerBar model = if model.flags.mobile || model.nav.smallNav then mobileHeaderbar model + else desktopHeaderBar model @@ -511,10 +519,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 @@ -523,10 +533,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) @@ -580,22 +592,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) @@ -634,7 +647,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) @@ -645,25 +658,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 @@ -771,10 +785,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 } @@ -783,6 +800,7 @@ updateNavWidth : Int -> Navigation -> Navigation updateNavWidth width nav = if width < 700 then { nav | smallNav = True } + else { nav | smallNav = False, showNav = False }