├── .gitignore ├── LICENSE ├── README.md ├── elm-pkg-js-includes.js ├── elm-pkg-js ├── copy-to-clipboard.js ├── devicePixelRatio.js └── openNewTab.js ├── elm.json ├── packages └── elm-geometry │ └── 3.6.0 │ └── src │ ├── Arc2d.elm │ ├── Arc3d.elm │ ├── ArcLengthParameterization.elm │ ├── Axis2d.elm │ ├── Axis3d.elm │ ├── Block3d.elm │ ├── BoundingBox2d.elm │ ├── BoundingBox3d.elm │ ├── Circle2d.elm │ ├── Circle3d.elm │ ├── Cone3d.elm │ ├── CubicSpline2d.elm │ ├── CubicSpline3d.elm │ ├── Cylinder3d.elm │ ├── DelaunayTriangulation2d.elm │ ├── Direction2d.elm │ ├── Direction3d.elm │ ├── Ellipse2d.elm │ ├── EllipticalArc2d.elm │ ├── Frame2d.elm │ ├── Frame3d.elm │ ├── Geometry │ ├── Expect.elm │ ├── Fuzz.elm │ └── Types.elm │ ├── LineSegment2d.elm │ ├── LineSegment3d.elm │ ├── Plane3d.elm │ ├── Point2d.elm │ ├── Point3d.elm │ ├── Polygon2d.elm │ ├── Polygon2d │ ├── EdgeSet.elm │ ├── Monotone.elm │ └── Random.elm │ ├── Polyline2d.elm │ ├── Polyline3d.elm │ ├── QuadraticSpline2d.elm │ ├── QuadraticSpline3d.elm │ ├── Quantity │ └── Extra.elm │ ├── Rectangle2d.elm │ ├── Rectangle3d.elm │ ├── SketchPlane3d.elm │ ├── Sphere3d.elm │ ├── SweptAngle.elm │ ├── Triangle2d.elm │ ├── Triangle3d.elm │ ├── Unsafe │ ├── Direction2d.elm │ └── Direction3d.elm │ ├── Vector2d.elm │ ├── Vector3d.elm │ └── VoronoiDiagram2d.elm ├── public ├── ascii.ttf ├── copy.svg ├── credits.txt ├── cut.svg ├── favicon.ico ├── mug-back.jpg ├── mug-front.jpg ├── paste.svg ├── poster-color.png ├── poster-irl.jpg ├── poster.png ├── redo.svg └── undo.svg ├── src ├── Ascii.elm ├── Backend.elm ├── BackendLogic.elm ├── Bounds.elm ├── Change.elm ├── Cluster.elm ├── ColorHelper.elm ├── Cursor.elm ├── Env.elm ├── Evergreen │ ├── Migrate │ │ ├── V10.elm │ │ ├── V12.elm │ │ ├── V13.elm │ │ ├── V14.elm │ │ ├── V17.elm │ │ ├── V24.elm │ │ ├── V28.elm │ │ ├── V3.elm │ │ ├── V38.elm │ │ ├── V39.elm │ │ ├── V4.elm │ │ ├── V43.elm │ │ ├── V45.elm │ │ ├── V47.elm │ │ ├── V48.elm │ │ ├── V50.elm │ │ ├── V53.elm │ │ ├── V68.elm │ │ ├── V73.elm │ │ ├── V77.elm │ │ ├── V78.elm │ │ ├── V79.elm │ │ └── V8.elm │ ├── V1 │ │ ├── Ascii.elm │ │ ├── ColorIndex.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V10 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── ColorIndex.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V12 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── ColorIndex.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V13 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── ColorIndex.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V14 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── ColorIndex.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V17 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V24 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V28 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V3 │ │ ├── Ascii.elm │ │ ├── ColorIndex.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V38 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V39 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V4 │ │ ├── Ascii.elm │ │ ├── Change.elm │ │ ├── ColorIndex.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V43 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V45 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm │ ├── V47 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── NotifyMe.elm │ │ ├── Point2d.elm │ │ ├── RecentChanges.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ ├── UrlHelper.elm │ │ └── User.elm │ ├── V48 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── NotifyMe.elm │ │ ├── Point2d.elm │ │ ├── RecentChanges.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ ├── UrlHelper.elm │ │ └── User.elm │ ├── V50 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── NotifyMe.elm │ │ ├── Point2d.elm │ │ ├── RecentChanges.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ ├── UrlHelper.elm │ │ └── User.elm │ ├── V53 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Email.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── NotifyMe.elm │ │ ├── Point2d.elm │ │ ├── RecentChanges.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ ├── UrlHelper.elm │ │ └── User.elm │ ├── V68 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── NotifyMe.elm │ │ ├── Point2d.elm │ │ ├── RecentChanges.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ ├── UrlHelper.elm │ │ └── User.elm │ ├── V73 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── NotifyMe.elm │ │ ├── Point2d.elm │ │ ├── RecentChanges.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ ├── UrlHelper.elm │ │ └── User.elm │ ├── V77 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── NotifyMe.elm │ │ ├── Point2d.elm │ │ ├── RecentChanges.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ ├── UrlHelper.elm │ │ └── User.elm │ ├── V78 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── NotifyMe.elm │ │ ├── Point2d.elm │ │ ├── RecentChanges.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ ├── UrlHelper.elm │ │ └── User.elm │ ├── V79 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── NotifyMe.elm │ │ ├── Point2d.elm │ │ ├── RecentChanges.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ ├── UrlHelper.elm │ │ └── User.elm │ └── V8 │ │ ├── Ascii.elm │ │ ├── Bounds.elm │ │ ├── Change.elm │ │ ├── ColorIndex.elm │ │ ├── Cursor.elm │ │ ├── Geometry │ │ └── Types.elm │ │ ├── Grid.elm │ │ ├── GridCell.elm │ │ ├── Helper.elm │ │ ├── LocalGrid.elm │ │ ├── LocalModel.elm │ │ ├── Point2d.elm │ │ ├── Types.elm │ │ ├── Units.elm │ │ └── User.elm ├── Frontend.elm ├── Grid.elm ├── GridCell.elm ├── Helper.elm ├── Hyperlink.elm ├── Icons.elm ├── LocalGrid.elm ├── LocalModel.elm ├── NonemptyExtra.elm ├── NotifyMe.elm ├── RecentChanges.elm ├── Shaders.elm ├── Types.elm ├── UiColors.elm ├── Undo.elm ├── Units.elm ├── UrlHelper.elm ├── User.elm └── View.elm └── tools ├── AsciiItensity.elm ├── ColorGenerator.elm ├── Main.elm ├── Tests.elm └── YwotParser.elm /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | elm-stuff 3 | .idea -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © 2021 Martin Stewart 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ascii-collab 2 | 3 | A website for drawing ascii art with other people! 4 | 5 | https://ascii-collab.app/ 6 | 7 | Here are some posts about it: 8 | 9 | https://discourse.elm-lang.org/t/ascii-collab-draw-ascii-art-together-on-an-infinite-canvas/6273 10 | https://discourse.elm-lang.org/t/ascii-collab-progress-update/7019 11 | -------------------------------------------------------------------------------- /elm-pkg-js-includes.js: -------------------------------------------------------------------------------- 1 | // @NOTE this file will hopefully be auto-generated by elm-pkg-js in future! 2 | // For now, its presense will mean Lamdera detects the extra JS and packages 3 | // In future this will be more structured + restricted once the design is done 4 | 5 | const devicePixelRatio = require('./elm-pkg-js/devicePixelRatio.js'); 6 | const copyToClipboard = require('./elm-pkg-js/copy-to-clipboard.js'); 7 | const openNewTab = require('./elm-pkg-js/openNewTab.js'); 8 | 9 | exports.init = async function init(app) { 10 | // @WARNING: this only runs for Lamdera production deploys! 11 | // This file will not run in Local development, an equivalent to this is 12 | // automatically generated in Local Development for every file in elm-pkg-js/ 13 | devicePixelRatio.init(app); 14 | copyToClipboard.init(app); 15 | openNewTab.init(app); 16 | } -------------------------------------------------------------------------------- /elm-pkg-js/devicePixelRatio.js: -------------------------------------------------------------------------------- 1 | exports.init = async function init(app) 2 | { 3 | app.ports.martinsstewart_elm_device_pixel_ratio_to_js.subscribe(a => app.ports.martinsstewart_elm_device_pixel_ratio_from_js.send(window.devicePixelRatio)); 4 | } -------------------------------------------------------------------------------- /elm-pkg-js/openNewTab.js: -------------------------------------------------------------------------------- 1 | exports.init = async function init(app) 2 | { 3 | app.ports.martinsstewart_elm_open_new_tab_to_js.subscribe(a => window.open(a, "_blank")); 4 | } -------------------------------------------------------------------------------- /packages/elm-geometry/3.6.0/src/Quantity/Extra.elm: -------------------------------------------------------------------------------- 1 | module Quantity.Extra exposing 2 | ( aXbY 3 | , lOverTheta 4 | , rCosTheta 5 | , rSinTheta 6 | , rTheta 7 | , scaleAbout 8 | ) 9 | 10 | import Angle exposing (Angle) 11 | import Float.Extra as Float 12 | import Quantity exposing (Quantity(..)) 13 | 14 | 15 | aXbY : Float -> Quantity Float units -> Float -> Quantity Float units -> Quantity Float units 16 | aXbY a (Quantity x) b (Quantity y) = 17 | Quantity (a * x + b * y) 18 | 19 | 20 | scaleAbout : Quantity number units -> number -> Quantity number units -> Quantity number units 21 | scaleAbout (Quantity x0) scale (Quantity x) = 22 | Quantity (x0 + scale * (x - x0)) 23 | 24 | 25 | rTheta : Quantity Float units -> Angle -> Quantity Float units 26 | rTheta (Quantity r) (Quantity theta) = 27 | Quantity (r * theta) 28 | 29 | 30 | lOverTheta : Quantity Float units -> Angle -> Quantity Float units 31 | lOverTheta (Quantity l) (Quantity theta) = 32 | Quantity (l / theta) 33 | 34 | 35 | rCosTheta : Quantity Float units -> Angle -> Quantity Float units 36 | rCosTheta r theta = 37 | r |> Quantity.multiplyBy (Angle.cos theta) 38 | 39 | 40 | rSinTheta : Quantity Float units -> Angle -> Quantity Float units 41 | rSinTheta r theta = 42 | r |> Quantity.multiplyBy (Angle.sin theta) 43 | -------------------------------------------------------------------------------- /packages/elm-geometry/3.6.0/src/Unsafe/Direction2d.elm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | -------------------------------------------------------------------------------- 3 | -- This Source Code Form is subject to the terms of the Mozilla Public -- 4 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, -- 5 | -- you can obtain one at http://mozilla.org/MPL/2.0/. -- 6 | -------------------------------------------------------------------------------- 7 | -------------------------------------------------------------------------------- 8 | 9 | 10 | module Unsafe.Direction2d exposing (unsafeXyIn) 11 | 12 | import Geometry.Types exposing (..) 13 | 14 | 15 | unsafeXyIn : Frame2d units globalCoordinates { defines : localCoordinates } -> Float -> Float -> Direction2d globalCoordinates 16 | unsafeXyIn (Frame2d frame) x y = 17 | let 18 | (Direction2d i) = 19 | frame.xDirection 20 | 21 | (Direction2d j) = 22 | frame.yDirection 23 | in 24 | Direction2d 25 | { x = x * i.x + y * j.x 26 | , y = x * i.y + y * j.y 27 | } 28 | -------------------------------------------------------------------------------- /packages/elm-geometry/3.6.0/src/Unsafe/Direction3d.elm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | -------------------------------------------------------------------------------- 3 | -- This Source Code Form is subject to the terms of the Mozilla Public -- 4 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, -- 5 | -- you can obtain one at http://mozilla.org/MPL/2.0/. -- 6 | -------------------------------------------------------------------------------- 7 | -------------------------------------------------------------------------------- 8 | 9 | 10 | module Unsafe.Direction3d exposing (unsafeCrossProduct) 11 | 12 | import Geometry.Types exposing (..) 13 | 14 | 15 | unsafeCrossProduct : Direction3d coordinates -> Direction3d coordinates -> Direction3d coordinates 16 | unsafeCrossProduct (Direction3d d1) (Direction3d d2) = 17 | Direction3d 18 | { x = d1.y * d2.z - d1.z * d2.y 19 | , y = d1.z * d2.x - d1.x * d2.z 20 | , z = d1.x * d2.y - d1.y * d2.x 21 | } 22 | -------------------------------------------------------------------------------- /public/ascii.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinSStewart/ascii-collab/076e355aa8670b3110420e7ea68dc0ae6d72d9af/public/ascii.ttf -------------------------------------------------------------------------------- /public/copy.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/credits.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinSStewart/ascii-collab/076e355aa8670b3110420e7ea68dc0ae6d72d9af/public/credits.txt -------------------------------------------------------------------------------- /public/cut.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinSStewart/ascii-collab/076e355aa8670b3110420e7ea68dc0ae6d72d9af/public/favicon.ico -------------------------------------------------------------------------------- /public/mug-back.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinSStewart/ascii-collab/076e355aa8670b3110420e7ea68dc0ae6d72d9af/public/mug-back.jpg -------------------------------------------------------------------------------- /public/mug-front.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinSStewart/ascii-collab/076e355aa8670b3110420e7ea68dc0ae6d72d9af/public/mug-front.jpg -------------------------------------------------------------------------------- /public/paste.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/poster-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinSStewart/ascii-collab/076e355aa8670b3110420e7ea68dc0ae6d72d9af/public/poster-color.png -------------------------------------------------------------------------------- /public/poster-irl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinSStewart/ascii-collab/076e355aa8670b3110420e7ea68dc0ae6d72d9af/public/poster-irl.jpg -------------------------------------------------------------------------------- /public/poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinSStewart/ascii-collab/076e355aa8670b3110420e7ea68dc0ae6d72d9af/public/poster.png -------------------------------------------------------------------------------- /public/redo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/undo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Change.elm: -------------------------------------------------------------------------------- 1 | module Change exposing (Change(..), ClientChange(..), LocalChange(..), ServerChange(..)) 2 | 3 | import Bounds exposing (Bounds) 4 | import Dict exposing (Dict) 5 | import Grid 6 | import GridCell 7 | import Helper exposing (Coord, RawCellCoord) 8 | import NotifyMe 9 | import Units exposing (AsciiUnit, CellUnit) 10 | import User exposing (UserId) 11 | 12 | 13 | type Change 14 | = LocalChange LocalChange 15 | | ServerChange ServerChange 16 | | ClientChange ClientChange 17 | 18 | 19 | type LocalChange 20 | = LocalGridChange Grid.LocalGridChange 21 | | LocalUndo 22 | | LocalRedo 23 | | LocalAddUndo 24 | | LocalHideUser UserId (Coord AsciiUnit) 25 | | LocalUnhideUser UserId 26 | | LocalToggleUserVisibilityForAll UserId 27 | 28 | 29 | type ClientChange 30 | = ViewBoundsChange (Bounds CellUnit) (List ( Coord CellUnit, GridCell.Cell )) 31 | 32 | 33 | type ServerChange 34 | = ServerGridChange Grid.GridChange 35 | | ServerUndoPoint { userId : UserId, undoPoints : Dict RawCellCoord Int } 36 | | ServerToggleUserVisibilityForAll UserId 37 | -------------------------------------------------------------------------------- /src/Evergreen/Migrate/V24.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.Migrate.V24 exposing (..) 2 | 3 | import Evergreen.V17.Types as Old 4 | import Evergreen.V24.Types as New 5 | import Lamdera.Migrations exposing (..) 6 | 7 | 8 | frontendModel : Old.FrontendModel -> ModelMigration New.FrontendModel New.FrontendMsg 9 | frontendModel old = 10 | ModelUnchanged 11 | 12 | 13 | backendModel : Old.BackendModel -> ModelMigration New.BackendModel New.BackendMsg 14 | backendModel old = 15 | ModelUnchanged 16 | 17 | 18 | frontendMsg : Old.FrontendMsg -> MsgMigration New.FrontendMsg New.FrontendMsg 19 | frontendMsg old = 20 | MsgUnchanged 21 | 22 | 23 | toBackend : Old.ToBackend -> MsgMigration New.ToBackend New.BackendMsg 24 | toBackend old = 25 | MsgUnchanged 26 | 27 | 28 | backendMsg : Old.BackendMsg -> MsgMigration New.BackendMsg New.BackendMsg 29 | backendMsg old = 30 | MsgUnchanged 31 | 32 | 33 | toFrontend : Old.ToFrontend -> MsgMigration New.ToFrontend New.FrontendMsg 34 | toFrontend old = 35 | MsgUnchanged 36 | -------------------------------------------------------------------------------- /src/Evergreen/Migrate/V28.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.Migrate.V28 exposing (..) 2 | 3 | import Evergreen.V24.Types as Old 4 | import Evergreen.V28.Types as New 5 | import Lamdera.Migrations exposing (..) 6 | 7 | 8 | frontendModel : Old.FrontendModel -> ModelMigration New.FrontendModel New.FrontendMsg 9 | frontendModel old = 10 | ModelUnchanged 11 | 12 | 13 | backendModel : Old.BackendModel -> ModelMigration New.BackendModel New.BackendMsg 14 | backendModel old = 15 | ModelUnchanged 16 | 17 | 18 | frontendMsg : Old.FrontendMsg -> MsgMigration New.FrontendMsg New.FrontendMsg 19 | frontendMsg old = 20 | MsgUnchanged 21 | 22 | 23 | toBackend : Old.ToBackend -> MsgMigration New.ToBackend New.BackendMsg 24 | toBackend old = 25 | MsgUnchanged 26 | 27 | 28 | backendMsg : Old.BackendMsg -> MsgMigration New.BackendMsg New.BackendMsg 29 | backendMsg old = 30 | MsgUnchanged 31 | 32 | 33 | toFrontend : Old.ToFrontend -> MsgMigration New.ToFrontend New.FrontendMsg 34 | toFrontend old = 35 | MsgUnchanged 36 | -------------------------------------------------------------------------------- /src/Evergreen/Migrate/V3.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.Migrate.V3 exposing (..) 2 | 3 | import Evergreen.V1.Types as Old 4 | import Evergreen.V3.Types as New 5 | import Lamdera.Migrations exposing (..) 6 | 7 | 8 | frontendModel : Old.FrontendModel -> ModelMigration New.FrontendModel New.FrontendMsg 9 | frontendModel old = 10 | ModelUnchanged 11 | 12 | 13 | backendModel : Old.BackendModel -> ModelMigration New.BackendModel New.BackendMsg 14 | backendModel old = 15 | ModelUnchanged 16 | 17 | 18 | frontendMsg : Old.FrontendMsg -> MsgMigration New.FrontendMsg New.FrontendMsg 19 | frontendMsg old = 20 | MsgUnchanged 21 | 22 | 23 | toBackend : Old.ToBackend -> MsgMigration New.ToBackend New.BackendMsg 24 | toBackend old = 25 | MsgUnchanged 26 | 27 | 28 | backendMsg : Old.BackendMsg -> MsgMigration New.BackendMsg New.BackendMsg 29 | backendMsg old = 30 | MsgUnchanged 31 | 32 | 33 | toFrontend : Old.ToFrontend -> MsgMigration New.ToFrontend New.FrontendMsg 34 | toFrontend old = 35 | MsgUnchanged 36 | -------------------------------------------------------------------------------- /src/Evergreen/Migrate/V38.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.Migrate.V38 exposing (backendModel, backendMsg, frontendModel, frontendMsg, toBackend, toFrontend) 2 | 3 | import Evergreen.V28.Types as Old 4 | import Evergreen.V38.Types as New 5 | import Lamdera.Migrations exposing (..) 6 | 7 | 8 | frontendModel : Old.FrontendModel -> ModelMigration New.FrontendModel New.FrontendMsg 9 | frontendModel old = 10 | ModelUnchanged 11 | 12 | 13 | backendModel : Old.BackendModel -> ModelMigration New.BackendModel New.BackendMsg 14 | backendModel old = 15 | ModelUnchanged 16 | 17 | 18 | frontendMsg : Old.FrontendMsg -> MsgMigration New.FrontendMsg New.FrontendMsg 19 | frontendMsg old = 20 | MsgUnchanged 21 | 22 | 23 | toBackend : Old.ToBackend -> MsgMigration New.ToBackend New.BackendMsg 24 | toBackend old = 25 | MsgUnchanged 26 | 27 | 28 | backendMsg : Old.BackendMsg -> MsgMigration New.BackendMsg New.BackendMsg 29 | backendMsg old = 30 | MsgUnchanged 31 | 32 | 33 | toFrontend : Old.ToFrontend -> MsgMigration New.ToFrontend New.FrontendMsg 34 | toFrontend old = 35 | MsgUnchanged 36 | -------------------------------------------------------------------------------- /src/Evergreen/Migrate/V39.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.Migrate.V39 exposing (backendModel, backendMsg, frontendModel, frontendMsg, toBackend, toFrontend) 2 | 3 | import Evergreen.V38.Types as Old 4 | import Evergreen.V39.Types as New 5 | import Lamdera.Migrations exposing (..) 6 | 7 | 8 | frontendModel : Old.FrontendModel -> ModelMigration New.FrontendModel New.FrontendMsg 9 | frontendModel old = 10 | ModelUnchanged 11 | 12 | 13 | backendModel : Old.BackendModel -> ModelMigration New.BackendModel New.BackendMsg 14 | backendModel old = 15 | ModelUnchanged 16 | 17 | 18 | frontendMsg : Old.FrontendMsg -> MsgMigration New.FrontendMsg New.FrontendMsg 19 | frontendMsg old = 20 | MsgUnchanged 21 | 22 | 23 | toBackend : Old.ToBackend -> MsgMigration New.ToBackend New.BackendMsg 24 | toBackend old = 25 | MsgUnchanged 26 | 27 | 28 | backendMsg : Old.BackendMsg -> MsgMigration New.BackendMsg New.BackendMsg 29 | backendMsg old = 30 | MsgUnchanged 31 | 32 | 33 | toFrontend : Old.ToFrontend -> MsgMigration New.ToFrontend New.FrontendMsg 34 | toFrontend old = 35 | MsgUnchanged 36 | -------------------------------------------------------------------------------- /src/Evergreen/Migrate/V43.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.Migrate.V43 exposing (backendModel, backendMsg, frontendModel, frontendMsg, toBackend, toFrontend) 2 | 3 | import Evergreen.V39.Types as Old 4 | import Evergreen.V43.Types as New 5 | import Lamdera.Migrations exposing (..) 6 | 7 | 8 | frontendModel : Old.FrontendModel -> ModelMigration New.FrontendModel New.FrontendMsg 9 | frontendModel old = 10 | ModelUnchanged 11 | 12 | 13 | backendModel : Old.BackendModel -> ModelMigration New.BackendModel New.BackendMsg 14 | backendModel old = 15 | ModelUnchanged 16 | 17 | 18 | frontendMsg : Old.FrontendMsg -> MsgMigration New.FrontendMsg New.FrontendMsg 19 | frontendMsg old = 20 | MsgUnchanged 21 | 22 | 23 | toBackend : Old.ToBackend -> MsgMigration New.ToBackend New.BackendMsg 24 | toBackend old = 25 | MsgUnchanged 26 | 27 | 28 | backendMsg : Old.BackendMsg -> MsgMigration New.BackendMsg New.BackendMsg 29 | backendMsg old = 30 | MsgUnchanged 31 | 32 | 33 | toFrontend : Old.ToFrontend -> MsgMigration New.ToFrontend New.FrontendMsg 34 | toFrontend old = 35 | MsgUnchanged 36 | -------------------------------------------------------------------------------- /src/Evergreen/Migrate/V45.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.Migrate.V45 exposing (..) 2 | 3 | import Evergreen.V43.Types as Old 4 | import Evergreen.V45.Types as New 5 | import Lamdera.Migrations exposing (..) 6 | 7 | 8 | frontendModel : Old.FrontendModel -> ModelMigration New.FrontendModel New.FrontendMsg 9 | frontendModel old = 10 | ModelUnchanged 11 | 12 | 13 | backendModel : Old.BackendModel -> ModelMigration New.BackendModel New.BackendMsg 14 | backendModel old = 15 | ModelUnchanged 16 | 17 | 18 | frontendMsg : Old.FrontendMsg -> MsgMigration New.FrontendMsg New.FrontendMsg 19 | frontendMsg old = 20 | MsgUnchanged 21 | 22 | 23 | toBackend : Old.ToBackend -> MsgMigration New.ToBackend New.BackendMsg 24 | toBackend old = 25 | MsgUnchanged 26 | 27 | 28 | backendMsg : Old.BackendMsg -> MsgMigration New.BackendMsg New.BackendMsg 29 | backendMsg old = 30 | MsgUnchanged 31 | 32 | 33 | toFrontend : Old.ToFrontend -> MsgMigration New.ToFrontend New.FrontendMsg 34 | toFrontend old = 35 | MsgUnchanged 36 | -------------------------------------------------------------------------------- /src/Evergreen/Migrate/V48.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.Migrate.V48 exposing (backendModel, backendMsg, frontendModel, frontendMsg, toBackend, toFrontend) 2 | 3 | import Evergreen.V47.Types as Old 4 | import Evergreen.V48.Types as New 5 | import Lamdera.Migrations exposing (..) 6 | 7 | 8 | frontendModel : Old.FrontendModel -> ModelMigration New.FrontendModel New.FrontendMsg 9 | frontendModel old = 10 | ModelUnchanged 11 | 12 | 13 | backendModel : Old.BackendModel -> ModelMigration New.BackendModel New.BackendMsg 14 | backendModel old = 15 | ModelUnchanged 16 | 17 | 18 | frontendMsg : Old.FrontendMsg -> MsgMigration New.FrontendMsg New.FrontendMsg 19 | frontendMsg old = 20 | MsgUnchanged 21 | 22 | 23 | toBackend : Old.ToBackend -> MsgMigration New.ToBackend New.BackendMsg 24 | toBackend old = 25 | MsgUnchanged 26 | 27 | 28 | backendMsg : Old.BackendMsg -> MsgMigration New.BackendMsg New.BackendMsg 29 | backendMsg old = 30 | MsgUnchanged 31 | 32 | 33 | toFrontend : Old.ToFrontend -> MsgMigration New.ToFrontend New.FrontendMsg 34 | toFrontend old = 35 | MsgUnchanged 36 | -------------------------------------------------------------------------------- /src/Evergreen/Migrate/V50.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.Migrate.V50 exposing (backendModel, backendMsg, frontendModel, frontendMsg, toBackend, toFrontend) 2 | 3 | import Evergreen.V48.Types as Old 4 | import Evergreen.V50.Types as New 5 | import Lamdera.Migrations exposing (..) 6 | 7 | 8 | frontendModel : Old.FrontendModel -> ModelMigration New.FrontendModel New.FrontendMsg 9 | frontendModel old = 10 | ModelUnchanged 11 | 12 | 13 | backendModel : Old.BackendModel -> ModelMigration New.BackendModel New.BackendMsg 14 | backendModel old = 15 | ModelUnchanged 16 | 17 | 18 | frontendMsg : Old.FrontendMsg -> MsgMigration New.FrontendMsg New.FrontendMsg 19 | frontendMsg old = 20 | MsgUnchanged 21 | 22 | 23 | toBackend : Old.ToBackend -> MsgMigration New.ToBackend New.BackendMsg 24 | toBackend old = 25 | MsgUnchanged 26 | 27 | 28 | backendMsg : Old.BackendMsg -> MsgMigration New.BackendMsg New.BackendMsg 29 | backendMsg old = 30 | MsgUnchanged 31 | 32 | 33 | toFrontend : Old.ToFrontend -> MsgMigration New.ToFrontend New.FrontendMsg 34 | toFrontend old = 35 | MsgUnchanged 36 | -------------------------------------------------------------------------------- /src/Evergreen/Migrate/V53.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.Migrate.V53 exposing (backendModel, backendMsg, frontendModel, frontendMsg, toBackend, toFrontend) 2 | 3 | import Evergreen.V50.Types as Old 4 | import Evergreen.V53.Types as New 5 | import Lamdera.Migrations exposing (..) 6 | 7 | 8 | frontendModel : Old.FrontendModel -> ModelMigration New.FrontendModel New.FrontendMsg 9 | frontendModel old = 10 | ModelUnchanged 11 | 12 | 13 | backendModel : Old.BackendModel -> ModelMigration New.BackendModel New.BackendMsg 14 | backendModel old = 15 | ModelUnchanged 16 | 17 | 18 | frontendMsg : Old.FrontendMsg -> MsgMigration New.FrontendMsg New.FrontendMsg 19 | frontendMsg old = 20 | MsgUnchanged 21 | 22 | 23 | toBackend : Old.ToBackend -> MsgMigration New.ToBackend New.BackendMsg 24 | toBackend old = 25 | MsgUnchanged 26 | 27 | 28 | backendMsg : Old.BackendMsg -> MsgMigration New.BackendMsg New.BackendMsg 29 | backendMsg old = 30 | MsgUnchanged 31 | 32 | 33 | toFrontend : Old.ToFrontend -> MsgMigration New.ToFrontend New.FrontendMsg 34 | toFrontend old = 35 | MsgUnchanged 36 | -------------------------------------------------------------------------------- /src/Evergreen/Migrate/V73.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.Migrate.V73 exposing (..) 2 | 3 | import Evergreen.V68.Types as Old 4 | import Evergreen.V73.Types as New 5 | import Lamdera.Migrations exposing (..) 6 | 7 | 8 | frontendModel : Old.FrontendModel -> ModelMigration New.FrontendModel New.FrontendMsg 9 | frontendModel old = 10 | ModelUnchanged 11 | 12 | 13 | backendModel : Old.BackendModel -> ModelMigration New.BackendModel New.BackendMsg 14 | backendModel old = 15 | ModelUnchanged 16 | 17 | 18 | frontendMsg : Old.FrontendMsg -> MsgMigration New.FrontendMsg New.FrontendMsg 19 | frontendMsg old = 20 | MsgUnchanged 21 | 22 | 23 | toBackend : Old.ToBackend -> MsgMigration New.ToBackend New.BackendMsg 24 | toBackend old = 25 | MsgUnchanged 26 | 27 | 28 | backendMsg : Old.BackendMsg -> MsgMigration New.BackendMsg New.BackendMsg 29 | backendMsg old = 30 | MsgUnchanged 31 | 32 | 33 | toFrontend : Old.ToFrontend -> MsgMigration New.ToFrontend New.FrontendMsg 34 | toFrontend old = 35 | MsgUnchanged 36 | -------------------------------------------------------------------------------- /src/Evergreen/V1/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V1.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V1/ColorIndex.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V1.ColorIndex exposing (..) 2 | 3 | type ColorIndex 4 | = Green 5 | | Teal 6 | | Blue 7 | | Purple 8 | | Magenta 9 | | Salmon 10 | | Orange 11 | | Yellow 12 | | Gray -------------------------------------------------------------------------------- /src/Evergreen/V1/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V1.Cursor exposing (..) 2 | 3 | import Evergreen.V1.Helper 4 | import Quantity 5 | import Evergreen.V1.Units 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V1.Helper.Coord Evergreen.V1.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V1.Units.AsciiUnit) 12 | , size : (Evergreen.V1.Helper.Coord Evergreen.V1.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V1/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V1.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V1/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V1.Grid exposing (..) 2 | 3 | import Evergreen.V1.Ascii 4 | import Dict 5 | import Evergreen.V1.GridCell 6 | import Evergreen.V1.Helper 7 | import List.Nonempty 8 | import Evergreen.V1.Units 9 | import Evergreen.V1.User 10 | 11 | 12 | type alias LocalChange = 13 | { cellPosition : (Evergreen.V1.Helper.Coord Evergreen.V1.Units.CellUnit) 14 | , localPosition : Int 15 | , change : (List.Nonempty.Nonempty Evergreen.V1.Ascii.Ascii) 16 | } 17 | 18 | 19 | type alias Change = 20 | { cellPosition : (Evergreen.V1.Helper.Coord Evergreen.V1.Units.CellUnit) 21 | , localPosition : Int 22 | , change : (List.Nonempty.Nonempty Evergreen.V1.Ascii.Ascii) 23 | , userId : Evergreen.V1.User.UserId 24 | } 25 | 26 | 27 | type Grid 28 | = Grid (Dict.Dict (Int, Int) Evergreen.V1.GridCell.Cell) -------------------------------------------------------------------------------- /src/Evergreen/V1/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V1.GridCell exposing (..) 2 | 3 | import Evergreen.V1.Ascii 4 | import Dict 5 | import List.Nonempty 6 | import Evergreen.V1.User 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V1.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V1.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V1.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V1/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V1.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) -------------------------------------------------------------------------------- /src/Evergreen/V1/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V1.LocalModel exposing (..) 2 | 3 | type LocalModel msg model 4 | = LocalModel 5 | { localMsgs : (List msg) 6 | , localModel : model 7 | , model : model 8 | } -------------------------------------------------------------------------------- /src/Evergreen/V1/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V1.Point2d exposing (..) 2 | 3 | import Evergreen.V1.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V1.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V1/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V1.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type CellUnit 8 | = CellUnit Never 9 | 10 | 11 | type WorldCoordinate 12 | = WorldCoordinate Never 13 | 14 | 15 | type AsciiUnit 16 | = AsciiUnit Never 17 | 18 | 19 | type ScreenCoordinate 20 | = ScreenCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V1/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V1.User exposing (..) 2 | 3 | import Evergreen.V1.ColorIndex 4 | 5 | 6 | type UserId 7 | = UserId Int 8 | 9 | 10 | type alias RawUserId = Int 11 | 12 | 13 | type User 14 | = User 15 | { name : String 16 | , id : UserId 17 | , color : Evergreen.V1.ColorIndex.ColorIndex 18 | } -------------------------------------------------------------------------------- /src/Evergreen/V10/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V10/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.Bounds exposing (..) 2 | 3 | import Evergreen.V10.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V10.Helper.Coord unit) 9 | , max : (Evergreen.V10.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V10/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.Change exposing (..) 2 | 3 | import Evergreen.V10.Bounds 4 | import Dict 5 | import Evergreen.V10.Grid 6 | import Evergreen.V10.GridCell 7 | import Evergreen.V10.Helper 8 | import Evergreen.V10.Units 9 | import Evergreen.V10.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V10.Grid.LocalChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalToggleUserVisibility Evergreen.V10.User.UserId 18 | | LocalToggleUserVisibilityForAll Evergreen.V10.User.UserId 19 | 20 | 21 | type ServerChange 22 | = ServerGridChange Evergreen.V10.Grid.Change 23 | | ServerUndoPoint 24 | { userId : Evergreen.V10.User.UserId 25 | , undoPoints : (Dict.Dict Evergreen.V10.Helper.RawCellCoord Int) 26 | } 27 | | ServerUserNew (Evergreen.V10.User.UserId, Evergreen.V10.User.UserData) 28 | | ServerToggleUserVisibilityForAll Evergreen.V10.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V10.Bounds.Bounds Evergreen.V10.Units.CellUnit) (List ((Evergreen.V10.Helper.Coord Evergreen.V10.Units.CellUnit), Evergreen.V10.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V10/ColorIndex.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.ColorIndex exposing (..) 2 | 3 | type ColorIndex 4 | = Green 5 | | Teal 6 | | Blue 7 | | Purple 8 | | Magenta 9 | | Salmon 10 | | Orange 11 | | Yellow 12 | | Gray -------------------------------------------------------------------------------- /src/Evergreen/V10/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.Cursor exposing (..) 2 | 3 | import Evergreen.V10.Helper 4 | import Quantity 5 | import Evergreen.V10.Units 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V10.Helper.Coord Evergreen.V10.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V10.Units.AsciiUnit) 12 | , size : (Evergreen.V10.Helper.Coord Evergreen.V10.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V10/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V10/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.Grid exposing (..) 2 | 3 | import Evergreen.V10.Ascii 4 | import Dict 5 | import Evergreen.V10.GridCell 6 | import Evergreen.V10.Helper 7 | import List.Nonempty 8 | import Math.Vector2 9 | import Evergreen.V10.Units 10 | import Evergreen.V10.User 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V10.Helper.Coord Evergreen.V10.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V10.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V10.Helper.Coord Evergreen.V10.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V10.Ascii.Ascii) 24 | , userId : Evergreen.V10.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V10.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , userId : Float 36 | } -------------------------------------------------------------------------------- /src/Evergreen/V10/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.GridCell exposing (..) 2 | 3 | import Evergreen.V10.Ascii 4 | import Dict 5 | import List.Nonempty 6 | import Evergreen.V10.User 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V10.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V10.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V10.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V10/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V10/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.LocalGrid exposing (..) 2 | 3 | import Evergreen.V10.Bounds 4 | import Dict 5 | import EverySet 6 | import Evergreen.V10.Grid 7 | import Evergreen.V10.Helper 8 | import Evergreen.V10.Units 9 | import Evergreen.V10.User 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V10.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V10.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V10.Helper.RawCellCoord Int)) 16 | , user : (Evergreen.V10.User.UserId, Evergreen.V10.User.UserData) 17 | , otherUsers : (List (Evergreen.V10.User.UserId, Evergreen.V10.User.UserData)) 18 | , hiddenUsers : (EverySet.EverySet Evergreen.V10.User.UserId) 19 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V10.User.UserId) 20 | , viewBounds : (Evergreen.V10.Bounds.Bounds Evergreen.V10.Units.CellUnit) 21 | , undoCurrent : (Dict.Dict Evergreen.V10.Helper.RawCellCoord Int) 22 | } 23 | 24 | 25 | type LocalGrid 26 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V10/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V10/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.Point2d exposing (..) 2 | 3 | import Evergreen.V10.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V10.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V10/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type CellUnit 12 | = CellUnit Never 13 | 14 | 15 | type WorldCoordinate 16 | = WorldCoordinate Never 17 | 18 | 19 | type ScreenCoordinate 20 | = ScreenCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V10/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V10.User exposing (..) 2 | 3 | import Evergreen.V10.ColorIndex 4 | 5 | 6 | type UserId 7 | = UserId Int 8 | 9 | 10 | type UserData 11 | = User 12 | { color : Evergreen.V10.ColorIndex.ColorIndex 13 | } 14 | 15 | 16 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V12/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V12/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.Bounds exposing (..) 2 | 3 | import Evergreen.V12.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V12.Helper.Coord unit) 9 | , max : (Evergreen.V12.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V12/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.Change exposing (..) 2 | 3 | import Evergreen.V12.Bounds 4 | import Dict 5 | import Evergreen.V12.Grid 6 | import Evergreen.V12.GridCell 7 | import Evergreen.V12.Helper 8 | import Evergreen.V12.Units 9 | import Evergreen.V12.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V12.Grid.LocalChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalToggleUserVisibility Evergreen.V12.User.UserId 18 | | LocalToggleUserVisibilityForAll Evergreen.V12.User.UserId 19 | 20 | 21 | type ServerChange 22 | = ServerGridChange Evergreen.V12.Grid.Change 23 | | ServerUndoPoint 24 | { userId : Evergreen.V12.User.UserId 25 | , undoPoints : (Dict.Dict Evergreen.V12.Helper.RawCellCoord Int) 26 | } 27 | | ServerUserNew (Evergreen.V12.User.UserId, Evergreen.V12.User.UserData) 28 | | ServerToggleUserVisibilityForAll Evergreen.V12.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V12.Bounds.Bounds Evergreen.V12.Units.CellUnit) (List ((Evergreen.V12.Helper.Coord Evergreen.V12.Units.CellUnit), Evergreen.V12.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V12/ColorIndex.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.ColorIndex exposing (..) 2 | 3 | type ColorIndex 4 | = Green 5 | | DarkGreen 6 | | Teal 7 | | DarkTeal 8 | | Blue 9 | | DarkBlue 10 | | Purple 11 | | DarkPurple 12 | | Magenta 13 | | DarkMagenta 14 | | Salmon 15 | | DarkSalmon 16 | | Orange 17 | | DarkOrange 18 | | Yellow 19 | | DarkYellow 20 | | Gray 21 | | DarkGray -------------------------------------------------------------------------------- /src/Evergreen/V12/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.Cursor exposing (..) 2 | 3 | import Evergreen.V12.Helper 4 | import Quantity 5 | import Evergreen.V12.Units 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V12.Helper.Coord Evergreen.V12.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V12.Units.AsciiUnit) 12 | , size : (Evergreen.V12.Helper.Coord Evergreen.V12.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V12/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V12/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.Grid exposing (..) 2 | 3 | import Evergreen.V12.Ascii 4 | import Dict 5 | import Evergreen.V12.GridCell 6 | import Evergreen.V12.Helper 7 | import List.Nonempty 8 | import Math.Vector2 9 | import Evergreen.V12.Units 10 | import Evergreen.V12.User 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V12.Helper.Coord Evergreen.V12.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V12.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V12.Helper.Coord Evergreen.V12.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V12.Ascii.Ascii) 24 | , userId : Evergreen.V12.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V12.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , userId : Float 36 | } -------------------------------------------------------------------------------- /src/Evergreen/V12/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.GridCell exposing (..) 2 | 3 | import Evergreen.V12.Ascii 4 | import Dict 5 | import List.Nonempty 6 | import Evergreen.V12.User 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V12.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V12.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V12.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V12/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V12/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.LocalGrid exposing (..) 2 | 3 | import Evergreen.V12.Bounds 4 | import Dict 5 | import EverySet 6 | import Evergreen.V12.Grid 7 | import Evergreen.V12.Helper 8 | import Evergreen.V12.Units 9 | import Evergreen.V12.User 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V12.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V12.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V12.Helper.RawCellCoord Int)) 16 | , user : (Evergreen.V12.User.UserId, Evergreen.V12.User.UserData) 17 | , otherUsers : (List (Evergreen.V12.User.UserId, Evergreen.V12.User.UserData)) 18 | , hiddenUsers : (EverySet.EverySet Evergreen.V12.User.UserId) 19 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V12.User.UserId) 20 | , viewBounds : (Evergreen.V12.Bounds.Bounds Evergreen.V12.Units.CellUnit) 21 | , undoCurrent : (Dict.Dict Evergreen.V12.Helper.RawCellCoord Int) 22 | } 23 | 24 | 25 | type LocalGrid 26 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V12/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V12/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.Point2d exposing (..) 2 | 3 | import Evergreen.V12.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V12.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V12/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type CellUnit 12 | = CellUnit Never 13 | 14 | 15 | type WorldCoordinate 16 | = WorldCoordinate Never 17 | 18 | 19 | type ScreenCoordinate 20 | = ScreenCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V12/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V12.User exposing (..) 2 | 3 | import Evergreen.V12.ColorIndex 4 | 5 | 6 | type UserId 7 | = UserId Int 8 | 9 | 10 | type UserData 11 | = User 12 | { color : Evergreen.V12.ColorIndex.ColorIndex 13 | } 14 | 15 | 16 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V13/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V13/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.Bounds exposing (..) 2 | 3 | import Evergreen.V13.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V13.Helper.Coord unit) 9 | , max : (Evergreen.V13.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V13/ColorIndex.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.ColorIndex exposing (..) 2 | 3 | type ColorIndex 4 | = Green 5 | | DarkGreen 6 | | Teal 7 | | DarkTeal 8 | | Blue 9 | | DarkBlue 10 | | Purple 11 | | DarkPurple 12 | | Magenta 13 | | DarkMagenta 14 | | Salmon 15 | | DarkSalmon 16 | | Orange 17 | | DarkOrange 18 | | Yellow 19 | | DarkYellow 20 | | Gray 21 | | DarkGray -------------------------------------------------------------------------------- /src/Evergreen/V13/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.Cursor exposing (..) 2 | 3 | import Evergreen.V13.Helper 4 | import Quantity 5 | import Evergreen.V13.Units 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V13.Helper.Coord Evergreen.V13.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V13.Units.AsciiUnit) 12 | , size : (Evergreen.V13.Helper.Coord Evergreen.V13.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V13/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V13/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.Grid exposing (..) 2 | 3 | import Evergreen.V13.Ascii 4 | import Dict 5 | import Evergreen.V13.GridCell 6 | import Evergreen.V13.Helper 7 | import List.Nonempty 8 | import Math.Vector2 9 | import Evergreen.V13.Units 10 | import Evergreen.V13.User 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V13.Helper.Coord Evergreen.V13.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V13.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V13.Helper.Coord Evergreen.V13.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V13.Ascii.Ascii) 24 | , userId : Evergreen.V13.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V13.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , userId : Float 36 | } -------------------------------------------------------------------------------- /src/Evergreen/V13/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.GridCell exposing (..) 2 | 3 | import Evergreen.V13.Ascii 4 | import Dict 5 | import List.Nonempty 6 | import Evergreen.V13.User 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V13.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V13.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V13.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V13/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V13/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.LocalGrid exposing (..) 2 | 3 | import Evergreen.V13.Bounds 4 | import Dict 5 | import EverySet 6 | import Evergreen.V13.Grid 7 | import Evergreen.V13.Helper 8 | import Evergreen.V13.Units 9 | import Evergreen.V13.User 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V13.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V13.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V13.Helper.RawCellCoord Int)) 16 | , user : (Evergreen.V13.User.UserId, Evergreen.V13.User.UserData) 17 | , otherUsers : (List (Evergreen.V13.User.UserId, Evergreen.V13.User.UserData)) 18 | , hiddenUsers : (EverySet.EverySet Evergreen.V13.User.UserId) 19 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V13.User.UserId) 20 | , viewBounds : (Evergreen.V13.Bounds.Bounds Evergreen.V13.Units.CellUnit) 21 | , undoCurrent : (Dict.Dict Evergreen.V13.Helper.RawCellCoord Int) 22 | } 23 | 24 | 25 | type LocalGrid 26 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V13/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V13/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.Point2d exposing (..) 2 | 3 | import Evergreen.V13.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V13.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V13/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type CellUnit 12 | = CellUnit Never 13 | 14 | 15 | type WorldCoordinate 16 | = WorldCoordinate Never 17 | 18 | 19 | type ScreenCoordinate 20 | = ScreenCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V13/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V13.User exposing (..) 2 | 3 | import Evergreen.V13.ColorIndex 4 | 5 | 6 | type UserId 7 | = UserId Int 8 | 9 | 10 | type UserData 11 | = User 12 | { color : Evergreen.V13.ColorIndex.ColorIndex 13 | } 14 | 15 | 16 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V14/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V14/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.Bounds exposing (..) 2 | 3 | import Evergreen.V14.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V14.Helper.Coord unit) 9 | , max : (Evergreen.V14.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V14/ColorIndex.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.ColorIndex exposing (..) 2 | 3 | type ColorIndex 4 | = Green 5 | | DarkGreen 6 | | Teal 7 | | DarkTeal 8 | | Blue 9 | | DarkBlue 10 | | Purple 11 | | DarkPurple 12 | | Magenta 13 | | DarkMagenta 14 | | Salmon 15 | | DarkSalmon 16 | | Orange 17 | | DarkOrange 18 | | Yellow 19 | | DarkYellow 20 | | Gray 21 | | DarkGray -------------------------------------------------------------------------------- /src/Evergreen/V14/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.Cursor exposing (..) 2 | 3 | import Evergreen.V14.Helper 4 | import Quantity 5 | import Evergreen.V14.Units 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V14.Helper.Coord Evergreen.V14.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V14.Units.AsciiUnit) 12 | , size : (Evergreen.V14.Helper.Coord Evergreen.V14.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V14/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V14/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.Grid exposing (..) 2 | 3 | import Evergreen.V14.Ascii 4 | import Dict 5 | import Evergreen.V14.GridCell 6 | import Evergreen.V14.Helper 7 | import List.Nonempty 8 | import Math.Vector2 9 | import Evergreen.V14.Units 10 | import Evergreen.V14.User 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V14.Helper.Coord Evergreen.V14.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V14.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V14.Helper.Coord Evergreen.V14.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V14.Ascii.Ascii) 24 | , userId : Evergreen.V14.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V14.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , userId : Float 36 | } -------------------------------------------------------------------------------- /src/Evergreen/V14/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.GridCell exposing (..) 2 | 3 | import Evergreen.V14.Ascii 4 | import Dict 5 | import List.Nonempty 6 | import Evergreen.V14.User 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V14.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V14.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V14.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V14/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V14/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.LocalGrid exposing (..) 2 | 3 | import Evergreen.V14.Bounds 4 | import Dict 5 | import EverySet 6 | import Evergreen.V14.Grid 7 | import Evergreen.V14.Helper 8 | import Evergreen.V14.Units 9 | import Evergreen.V14.User 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V14.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V14.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V14.Helper.RawCellCoord Int)) 16 | , user : (Evergreen.V14.User.UserId, Evergreen.V14.User.UserData) 17 | , otherUsers : (List (Evergreen.V14.User.UserId, Evergreen.V14.User.UserData)) 18 | , hiddenUsers : (EverySet.EverySet Evergreen.V14.User.UserId) 19 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V14.User.UserId) 20 | , viewBounds : (Evergreen.V14.Bounds.Bounds Evergreen.V14.Units.CellUnit) 21 | , undoCurrent : (Dict.Dict Evergreen.V14.Helper.RawCellCoord Int) 22 | } 23 | 24 | 25 | type LocalGrid 26 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V14/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V14/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.Point2d exposing (..) 2 | 3 | import Evergreen.V14.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V14.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V14/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type CellUnit 12 | = CellUnit Never 13 | 14 | 15 | type WorldCoordinate 16 | = WorldCoordinate Never 17 | 18 | 19 | type ScreenCoordinate 20 | = ScreenCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V14/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V14.User exposing (..) 2 | 3 | import Evergreen.V14.ColorIndex 4 | 5 | 6 | type UserId 7 | = UserId Int 8 | 9 | 10 | type UserData 11 | = User 12 | { color : Evergreen.V14.ColorIndex.ColorIndex 13 | } 14 | 15 | 16 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V17/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V17/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.Bounds exposing (..) 2 | 3 | import Evergreen.V17.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V17.Helper.Coord unit) 9 | , max : (Evergreen.V17.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V17/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.Change exposing (..) 2 | 3 | import Evergreen.V17.Bounds 4 | import Dict 5 | import Evergreen.V17.Grid 6 | import Evergreen.V17.GridCell 7 | import Evergreen.V17.Helper 8 | import Evergreen.V17.Units 9 | import Evergreen.V17.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V17.Grid.LocalChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalHideUser Evergreen.V17.User.UserId (Evergreen.V17.Helper.Coord Evergreen.V17.Units.AsciiUnit) 18 | | LocalUnhideUser Evergreen.V17.User.UserId 19 | | LocalToggleUserVisibilityForAll Evergreen.V17.User.UserId 20 | 21 | 22 | type ServerChange 23 | = ServerGridChange Evergreen.V17.Grid.Change 24 | | ServerUndoPoint 25 | { userId : Evergreen.V17.User.UserId 26 | , undoPoints : (Dict.Dict Evergreen.V17.Helper.RawCellCoord Int) 27 | } 28 | | ServerToggleUserVisibilityForAll Evergreen.V17.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V17.Bounds.Bounds Evergreen.V17.Units.CellUnit) (List ((Evergreen.V17.Helper.Coord Evergreen.V17.Units.CellUnit), Evergreen.V17.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V17/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.Cursor exposing (..) 2 | 3 | import Evergreen.V17.Helper 4 | import Quantity 5 | import Evergreen.V17.Units 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V17.Helper.Coord Evergreen.V17.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V17.Units.AsciiUnit) 12 | , size : (Evergreen.V17.Helper.Coord Evergreen.V17.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V17/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V17/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.Grid exposing (..) 2 | 3 | import Evergreen.V17.Ascii 4 | import Dict 5 | import Evergreen.V17.GridCell 6 | import Evergreen.V17.Helper 7 | import List.Nonempty 8 | import Math.Vector2 9 | import Evergreen.V17.Units 10 | import Evergreen.V17.User 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V17.Helper.Coord Evergreen.V17.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V17.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V17.Helper.Coord Evergreen.V17.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V17.Ascii.Ascii) 24 | , userId : Evergreen.V17.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V17.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , userId : Float 36 | } -------------------------------------------------------------------------------- /src/Evergreen/V17/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.GridCell exposing (..) 2 | 3 | import Evergreen.V17.Ascii 4 | import Dict 5 | import List.Nonempty 6 | import Evergreen.V17.User 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V17.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V17.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V17.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V17/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V17/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.LocalGrid exposing (..) 2 | 3 | import Evergreen.V17.Bounds 4 | import Dict 5 | import EverySet 6 | import Evergreen.V17.Grid 7 | import Evergreen.V17.Helper 8 | import Evergreen.V17.Units 9 | import Evergreen.V17.User 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V17.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V17.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V17.Helper.RawCellCoord Int)) 16 | , user : Evergreen.V17.User.UserId 17 | , hiddenUsers : (EverySet.EverySet Evergreen.V17.User.UserId) 18 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V17.User.UserId) 19 | , viewBounds : (Evergreen.V17.Bounds.Bounds Evergreen.V17.Units.CellUnit) 20 | , undoCurrent : (Dict.Dict Evergreen.V17.Helper.RawCellCoord Int) 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V17/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V17/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.Point2d exposing (..) 2 | 3 | import Evergreen.V17.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V17.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V17/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type CellUnit 12 | = CellUnit Never 13 | 14 | 15 | type WorldCoordinate 16 | = WorldCoordinate Never 17 | 18 | 19 | type ScreenCoordinate 20 | = ScreenCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V17/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V17.User exposing (..) 2 | 3 | type UserId 4 | = UserId Int 5 | 6 | 7 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V24/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V24/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.Bounds exposing (..) 2 | 3 | import Evergreen.V24.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V24.Helper.Coord unit) 9 | , max : (Evergreen.V24.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V24/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.Change exposing (..) 2 | 3 | import Evergreen.V24.Bounds 4 | import Dict 5 | import Evergreen.V24.Grid 6 | import Evergreen.V24.GridCell 7 | import Evergreen.V24.Helper 8 | import Evergreen.V24.Units 9 | import Evergreen.V24.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V24.Grid.LocalChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalHideUser Evergreen.V24.User.UserId (Evergreen.V24.Helper.Coord Evergreen.V24.Units.AsciiUnit) 18 | | LocalUnhideUser Evergreen.V24.User.UserId 19 | | LocalToggleUserVisibilityForAll Evergreen.V24.User.UserId 20 | 21 | 22 | type ServerChange 23 | = ServerGridChange Evergreen.V24.Grid.Change 24 | | ServerUndoPoint 25 | { userId : Evergreen.V24.User.UserId 26 | , undoPoints : (Dict.Dict Evergreen.V24.Helper.RawCellCoord Int) 27 | } 28 | | ServerToggleUserVisibilityForAll Evergreen.V24.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V24.Bounds.Bounds Evergreen.V24.Units.CellUnit) (List ((Evergreen.V24.Helper.Coord Evergreen.V24.Units.CellUnit), Evergreen.V24.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V24/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.Cursor exposing (..) 2 | 3 | import Evergreen.V24.Helper 4 | import Quantity 5 | import Evergreen.V24.Units 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V24.Helper.Coord Evergreen.V24.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V24.Units.AsciiUnit) 12 | , size : (Evergreen.V24.Helper.Coord Evergreen.V24.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V24/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V24/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.Grid exposing (..) 2 | 3 | import Evergreen.V24.Ascii 4 | import Dict 5 | import Evergreen.V24.GridCell 6 | import Evergreen.V24.Helper 7 | import List.Nonempty 8 | import Math.Vector2 9 | import Evergreen.V24.Units 10 | import Evergreen.V24.User 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V24.Helper.Coord Evergreen.V24.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V24.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V24.Helper.Coord Evergreen.V24.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V24.Ascii.Ascii) 24 | , userId : Evergreen.V24.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V24.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , userId : Float 36 | } -------------------------------------------------------------------------------- /src/Evergreen/V24/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.GridCell exposing (..) 2 | 3 | import Evergreen.V24.Ascii 4 | import Dict 5 | import List.Nonempty 6 | import Evergreen.V24.User 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V24.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V24.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V24.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V24/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V24/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.LocalGrid exposing (..) 2 | 3 | import Evergreen.V24.Bounds 4 | import Dict 5 | import EverySet 6 | import Evergreen.V24.Grid 7 | import Evergreen.V24.Helper 8 | import Evergreen.V24.Units 9 | import Evergreen.V24.User 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V24.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V24.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V24.Helper.RawCellCoord Int)) 16 | , user : Evergreen.V24.User.UserId 17 | , hiddenUsers : (EverySet.EverySet Evergreen.V24.User.UserId) 18 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V24.User.UserId) 19 | , viewBounds : (Evergreen.V24.Bounds.Bounds Evergreen.V24.Units.CellUnit) 20 | , undoCurrent : (Dict.Dict Evergreen.V24.Helper.RawCellCoord Int) 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V24/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V24/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.Point2d exposing (..) 2 | 3 | import Evergreen.V24.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V24.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V24/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type CellUnit 12 | = CellUnit Never 13 | 14 | 15 | type WorldCoordinate 16 | = WorldCoordinate Never 17 | 18 | 19 | type ScreenCoordinate 20 | = ScreenCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V24/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V24.User exposing (..) 2 | 3 | type UserId 4 | = UserId Int 5 | 6 | 7 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V28/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V28/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.Bounds exposing (..) 2 | 3 | import Evergreen.V28.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V28.Helper.Coord unit) 9 | , max : (Evergreen.V28.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V28/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.Change exposing (..) 2 | 3 | import Evergreen.V28.Bounds 4 | import Dict 5 | import Evergreen.V28.Grid 6 | import Evergreen.V28.GridCell 7 | import Evergreen.V28.Helper 8 | import Evergreen.V28.Units 9 | import Evergreen.V28.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V28.Grid.LocalChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalHideUser Evergreen.V28.User.UserId (Evergreen.V28.Helper.Coord Evergreen.V28.Units.AsciiUnit) 18 | | LocalUnhideUser Evergreen.V28.User.UserId 19 | | LocalToggleUserVisibilityForAll Evergreen.V28.User.UserId 20 | 21 | 22 | type ServerChange 23 | = ServerGridChange Evergreen.V28.Grid.Change 24 | | ServerUndoPoint 25 | { userId : Evergreen.V28.User.UserId 26 | , undoPoints : (Dict.Dict Evergreen.V28.Helper.RawCellCoord Int) 27 | } 28 | | ServerToggleUserVisibilityForAll Evergreen.V28.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V28.Bounds.Bounds Evergreen.V28.Units.CellUnit) (List ((Evergreen.V28.Helper.Coord Evergreen.V28.Units.CellUnit), Evergreen.V28.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V28/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.Cursor exposing (..) 2 | 3 | import Evergreen.V28.Helper 4 | import Quantity 5 | import Evergreen.V28.Units 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V28.Helper.Coord Evergreen.V28.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V28.Units.AsciiUnit) 12 | , size : (Evergreen.V28.Helper.Coord Evergreen.V28.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V28/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V28/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.Grid exposing (..) 2 | 3 | import Evergreen.V28.Ascii 4 | import Dict 5 | import Evergreen.V28.GridCell 6 | import Evergreen.V28.Helper 7 | import List.Nonempty 8 | import Math.Vector2 9 | import Evergreen.V28.Units 10 | import Evergreen.V28.User 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V28.Helper.Coord Evergreen.V28.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V28.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V28.Helper.Coord Evergreen.V28.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V28.Ascii.Ascii) 24 | , userId : Evergreen.V28.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V28.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , userId : Float 36 | } -------------------------------------------------------------------------------- /src/Evergreen/V28/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.GridCell exposing (..) 2 | 3 | import Evergreen.V28.Ascii 4 | import Dict 5 | import List.Nonempty 6 | import Evergreen.V28.User 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V28.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V28.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V28.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V28/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V28/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.LocalGrid exposing (..) 2 | 3 | import Evergreen.V28.Bounds 4 | import Dict 5 | import EverySet 6 | import Evergreen.V28.Grid 7 | import Evergreen.V28.Helper 8 | import Evergreen.V28.Units 9 | import Evergreen.V28.User 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V28.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V28.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V28.Helper.RawCellCoord Int)) 16 | , user : Evergreen.V28.User.UserId 17 | , hiddenUsers : (EverySet.EverySet Evergreen.V28.User.UserId) 18 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V28.User.UserId) 19 | , viewBounds : (Evergreen.V28.Bounds.Bounds Evergreen.V28.Units.CellUnit) 20 | , undoCurrent : (Dict.Dict Evergreen.V28.Helper.RawCellCoord Int) 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V28/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V28/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.Point2d exposing (..) 2 | 3 | import Evergreen.V28.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V28.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V28/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type CellUnit 12 | = CellUnit Never 13 | 14 | 15 | type WorldCoordinate 16 | = WorldCoordinate Never 17 | 18 | 19 | type ScreenCoordinate 20 | = ScreenCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V28/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V28.User exposing (..) 2 | 3 | type UserId 4 | = UserId Int 5 | 6 | 7 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V3/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V3.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V3/ColorIndex.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V3.ColorIndex exposing (..) 2 | 3 | type ColorIndex 4 | = Green 5 | | Teal 6 | | Blue 7 | | Purple 8 | | Magenta 9 | | Salmon 10 | | Orange 11 | | Yellow 12 | | Gray -------------------------------------------------------------------------------- /src/Evergreen/V3/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V3.Cursor exposing (..) 2 | 3 | import Evergreen.V3.Helper 4 | import Quantity 5 | import Evergreen.V3.Units 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V3.Helper.Coord Evergreen.V3.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V3.Units.AsciiUnit) 12 | , size : (Evergreen.V3.Helper.Coord Evergreen.V3.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V3/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V3.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V3/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V3.Grid exposing (..) 2 | 3 | import Evergreen.V3.Ascii 4 | import Dict 5 | import Evergreen.V3.GridCell 6 | import Evergreen.V3.Helper 7 | import List.Nonempty 8 | import Evergreen.V3.Units 9 | import Evergreen.V3.User 10 | 11 | 12 | type alias LocalChange = 13 | { cellPosition : (Evergreen.V3.Helper.Coord Evergreen.V3.Units.CellUnit) 14 | , localPosition : Int 15 | , change : (List.Nonempty.Nonempty Evergreen.V3.Ascii.Ascii) 16 | } 17 | 18 | 19 | type alias Change = 20 | { cellPosition : (Evergreen.V3.Helper.Coord Evergreen.V3.Units.CellUnit) 21 | , localPosition : Int 22 | , change : (List.Nonempty.Nonempty Evergreen.V3.Ascii.Ascii) 23 | , userId : Evergreen.V3.User.UserId 24 | } 25 | 26 | 27 | type Grid 28 | = Grid (Dict.Dict (Int, Int) Evergreen.V3.GridCell.Cell) -------------------------------------------------------------------------------- /src/Evergreen/V3/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V3.GridCell exposing (..) 2 | 3 | import Evergreen.V3.Ascii 4 | import Dict 5 | import List.Nonempty 6 | import Evergreen.V3.User 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V3.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V3.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V3.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V3/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V3.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) -------------------------------------------------------------------------------- /src/Evergreen/V3/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V3.LocalModel exposing (..) 2 | 3 | type LocalModel msg model 4 | = LocalModel 5 | { localMsgs : (List msg) 6 | , localModel : model 7 | , model : model 8 | } -------------------------------------------------------------------------------- /src/Evergreen/V3/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V3.Point2d exposing (..) 2 | 3 | import Evergreen.V3.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V3.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V3/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V3.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type CellUnit 8 | = CellUnit Never 9 | 10 | 11 | type WorldCoordinate 12 | = WorldCoordinate Never 13 | 14 | 15 | type AsciiUnit 16 | = AsciiUnit Never 17 | 18 | 19 | type ScreenCoordinate 20 | = ScreenCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V3/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V3.User exposing (..) 2 | 3 | import Evergreen.V3.ColorIndex 4 | 5 | 6 | type UserId 7 | = UserId Int 8 | 9 | 10 | type alias RawUserId = Int 11 | 12 | 13 | type User 14 | = User 15 | { name : String 16 | , id : UserId 17 | , color : Evergreen.V3.ColorIndex.ColorIndex 18 | } -------------------------------------------------------------------------------- /src/Evergreen/V38/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V38/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.Bounds exposing (..) 2 | 3 | import Evergreen.V38.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V38.Helper.Coord unit) 9 | , max : (Evergreen.V38.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V38/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.Change exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V38.Bounds 5 | import Evergreen.V38.Grid 6 | import Evergreen.V38.GridCell 7 | import Evergreen.V38.Helper 8 | import Evergreen.V38.Units 9 | import Evergreen.V38.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V38.Grid.LocalChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalHideUser Evergreen.V38.User.UserId (Evergreen.V38.Helper.Coord Evergreen.V38.Units.AsciiUnit) 18 | | LocalUnhideUser Evergreen.V38.User.UserId 19 | | LocalToggleUserVisibilityForAll Evergreen.V38.User.UserId 20 | 21 | 22 | type ServerChange 23 | = ServerGridChange Evergreen.V38.Grid.Change 24 | | ServerUndoPoint 25 | { userId : Evergreen.V38.User.UserId 26 | , undoPoints : (Dict.Dict Evergreen.V38.Helper.RawCellCoord Int) 27 | } 28 | | ServerToggleUserVisibilityForAll Evergreen.V38.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V38.Bounds.Bounds Evergreen.V38.Units.CellUnit) (List ((Evergreen.V38.Helper.Coord Evergreen.V38.Units.CellUnit), Evergreen.V38.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V38/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.Cursor exposing (..) 2 | 3 | import Evergreen.V38.Helper 4 | import Evergreen.V38.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V38.Helper.Coord Evergreen.V38.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V38.Units.AsciiUnit) 12 | , size : (Evergreen.V38.Helper.Coord Evergreen.V38.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V38/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V38/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V38.Ascii 5 | import Evergreen.V38.GridCell 6 | import Evergreen.V38.Helper 7 | import Evergreen.V38.Units 8 | import Evergreen.V38.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V38.Helper.Coord Evergreen.V38.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V38.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V38.Helper.Coord Evergreen.V38.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V38.Ascii.Ascii) 24 | , userId : Evergreen.V38.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V38.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } -------------------------------------------------------------------------------- /src/Evergreen/V38/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V38.Ascii 5 | import Evergreen.V38.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V38.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V38.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V38.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V38/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V38/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V38.Bounds 5 | import Evergreen.V38.Grid 6 | import Evergreen.V38.Helper 7 | import Evergreen.V38.Units 8 | import Evergreen.V38.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V38.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V38.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V38.Helper.RawCellCoord Int)) 16 | , user : Evergreen.V38.User.UserId 17 | , hiddenUsers : (EverySet.EverySet Evergreen.V38.User.UserId) 18 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V38.User.UserId) 19 | , viewBounds : (Evergreen.V38.Bounds.Bounds Evergreen.V38.Units.CellUnit) 20 | , undoCurrent : (Dict.Dict Evergreen.V38.Helper.RawCellCoord Int) 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V38/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V38/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.Point2d exposing (..) 2 | 3 | import Evergreen.V38.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V38.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V38/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type ScreenCoordinate 12 | = ScreenCoordinate Never 13 | 14 | 15 | type CellUnit 16 | = CellUnit Never 17 | 18 | 19 | type WorldCoordinate 20 | = WorldCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V38/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V38.User exposing (..) 2 | 3 | type UserId 4 | = UserId Int 5 | 6 | 7 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V39/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V39/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.Bounds exposing (..) 2 | 3 | import Evergreen.V39.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V39.Helper.Coord unit) 9 | , max : (Evergreen.V39.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V39/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.Change exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V39.Bounds 5 | import Evergreen.V39.Grid 6 | import Evergreen.V39.GridCell 7 | import Evergreen.V39.Helper 8 | import Evergreen.V39.Units 9 | import Evergreen.V39.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V39.Grid.LocalChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalHideUser Evergreen.V39.User.UserId (Evergreen.V39.Helper.Coord Evergreen.V39.Units.AsciiUnit) 18 | | LocalUnhideUser Evergreen.V39.User.UserId 19 | | LocalToggleUserVisibilityForAll Evergreen.V39.User.UserId 20 | 21 | 22 | type ServerChange 23 | = ServerGridChange Evergreen.V39.Grid.Change 24 | | ServerUndoPoint 25 | { userId : Evergreen.V39.User.UserId 26 | , undoPoints : (Dict.Dict Evergreen.V39.Helper.RawCellCoord Int) 27 | } 28 | | ServerToggleUserVisibilityForAll Evergreen.V39.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V39.Bounds.Bounds Evergreen.V39.Units.CellUnit) (List ((Evergreen.V39.Helper.Coord Evergreen.V39.Units.CellUnit), Evergreen.V39.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V39/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.Cursor exposing (..) 2 | 3 | import Evergreen.V39.Helper 4 | import Evergreen.V39.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V39.Helper.Coord Evergreen.V39.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V39.Units.AsciiUnit) 12 | , size : (Evergreen.V39.Helper.Coord Evergreen.V39.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V39/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V39/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V39.Ascii 5 | import Evergreen.V39.GridCell 6 | import Evergreen.V39.Helper 7 | import Evergreen.V39.Units 8 | import Evergreen.V39.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V39.Helper.Coord Evergreen.V39.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V39.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V39.Helper.Coord Evergreen.V39.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V39.Ascii.Ascii) 24 | , userId : Evergreen.V39.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V39.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } -------------------------------------------------------------------------------- /src/Evergreen/V39/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V39.Ascii 5 | import Evergreen.V39.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V39.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V39.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V39.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V39/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V39/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V39.Bounds 5 | import Evergreen.V39.Grid 6 | import Evergreen.V39.Helper 7 | import Evergreen.V39.Units 8 | import Evergreen.V39.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V39.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V39.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V39.Helper.RawCellCoord Int)) 16 | , user : Evergreen.V39.User.UserId 17 | , hiddenUsers : (EverySet.EverySet Evergreen.V39.User.UserId) 18 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V39.User.UserId) 19 | , viewBounds : (Evergreen.V39.Bounds.Bounds Evergreen.V39.Units.CellUnit) 20 | , undoCurrent : (Dict.Dict Evergreen.V39.Helper.RawCellCoord Int) 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V39/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V39/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.Point2d exposing (..) 2 | 3 | import Evergreen.V39.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V39.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V39/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type ScreenCoordinate 12 | = ScreenCoordinate Never 13 | 14 | 15 | type CellUnit 16 | = CellUnit Never 17 | 18 | 19 | type WorldCoordinate 20 | = WorldCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V39/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V39.User exposing (..) 2 | 3 | type UserId 4 | = UserId Int 5 | 6 | 7 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V4/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V4/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.Change exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V4.Grid 5 | import Evergreen.V4.User 6 | 7 | 8 | type LocalChange 9 | = LocalGridChange Evergreen.V4.Grid.LocalChange 10 | | LocalUndo 11 | | LocalRedo 12 | | LocalAddUndo 13 | | LocalToggleUserVisibility Evergreen.V4.User.UserId 14 | 15 | 16 | type ServerChange 17 | = ServerGridChange Evergreen.V4.Grid.Change 18 | | ServerUndoPoint 19 | { userId : Evergreen.V4.User.UserId 20 | , undoPoints : (Dict.Dict (Int, Int) Int) 21 | } 22 | | ServerUserNew (Evergreen.V4.User.UserId, Evergreen.V4.User.UserData) 23 | 24 | 25 | type Change 26 | = LocalChange LocalChange 27 | | ServerChange ServerChange -------------------------------------------------------------------------------- /src/Evergreen/V4/ColorIndex.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.ColorIndex exposing (..) 2 | 3 | type ColorIndex 4 | = Green 5 | | Teal 6 | | Blue 7 | | Purple 8 | | Magenta 9 | | Salmon 10 | | Orange 11 | | Yellow 12 | | Gray -------------------------------------------------------------------------------- /src/Evergreen/V4/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.Cursor exposing (..) 2 | 3 | import Evergreen.V4.Helper 4 | import Quantity 5 | import Evergreen.V4.Units 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V4.Helper.Coord Evergreen.V4.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V4.Units.AsciiUnit) 12 | , size : (Evergreen.V4.Helper.Coord Evergreen.V4.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V4/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V4/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.Grid exposing (..) 2 | 3 | import Evergreen.V4.Ascii 4 | import Dict 5 | import Evergreen.V4.GridCell 6 | import Evergreen.V4.Helper 7 | import List.Nonempty 8 | import Math.Vector2 9 | import Evergreen.V4.Units 10 | import Evergreen.V4.User 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V4.Helper.Coord Evergreen.V4.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V4.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V4.Helper.Coord Evergreen.V4.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V4.Ascii.Ascii) 24 | , userId : Evergreen.V4.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V4.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , userId : Float 36 | } -------------------------------------------------------------------------------- /src/Evergreen/V4/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.GridCell exposing (..) 2 | 3 | import Evergreen.V4.Ascii 4 | import Dict 5 | import List.Nonempty 6 | import Evergreen.V4.User 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V4.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V4.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V4.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V4/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) -------------------------------------------------------------------------------- /src/Evergreen/V4/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import EverySet 5 | import Evergreen.V4.Grid 6 | import Evergreen.V4.User 7 | 8 | 9 | type alias LocalGrid_ = 10 | { grid : Evergreen.V4.Grid.Grid 11 | , undoHistory : (List (Dict.Dict (Int, Int) Int)) 12 | , redoHistory : (List (Dict.Dict (Int, Int) Int)) 13 | , user : (Evergreen.V4.User.UserId, Evergreen.V4.User.UserData) 14 | , otherUsers : (List (Evergreen.V4.User.UserId, Evergreen.V4.User.UserData)) 15 | , hiddenUsers : (EverySet.EverySet Evergreen.V4.User.UserId) 16 | } 17 | 18 | 19 | type LocalGrid 20 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V4/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.LocalModel exposing (..) 2 | 3 | type LocalModel msg model 4 | = LocalModel 5 | { localMsgs : (List msg) 6 | , localModel : model 7 | , model : model 8 | } -------------------------------------------------------------------------------- /src/Evergreen/V4/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.Point2d exposing (..) 2 | 3 | import Evergreen.V4.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V4.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V4/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type CellUnit 8 | = CellUnit Never 9 | 10 | 11 | type WorldCoordinate 12 | = WorldCoordinate Never 13 | 14 | 15 | type AsciiUnit 16 | = AsciiUnit Never 17 | 18 | 19 | type ScreenCoordinate 20 | = ScreenCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V4/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V4.User exposing (..) 2 | 3 | import Evergreen.V4.ColorIndex 4 | 5 | 6 | type UserId 7 | = UserId Int 8 | 9 | 10 | type UserData 11 | = User 12 | { color : Evergreen.V4.ColorIndex.ColorIndex 13 | } 14 | 15 | 16 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V43/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V43/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.Bounds exposing (..) 2 | 3 | import Evergreen.V43.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V43.Helper.Coord unit) 9 | , max : (Evergreen.V43.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V43/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.Change exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V43.Bounds 5 | import Evergreen.V43.Grid 6 | import Evergreen.V43.GridCell 7 | import Evergreen.V43.Helper 8 | import Evergreen.V43.Units 9 | import Evergreen.V43.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V43.Grid.LocalChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalHideUser Evergreen.V43.User.UserId (Evergreen.V43.Helper.Coord Evergreen.V43.Units.AsciiUnit) 18 | | LocalUnhideUser Evergreen.V43.User.UserId 19 | | LocalToggleUserVisibilityForAll Evergreen.V43.User.UserId 20 | 21 | 22 | type ServerChange 23 | = ServerGridChange Evergreen.V43.Grid.Change 24 | | ServerUndoPoint 25 | { userId : Evergreen.V43.User.UserId 26 | , undoPoints : (Dict.Dict Evergreen.V43.Helper.RawCellCoord Int) 27 | } 28 | | ServerToggleUserVisibilityForAll Evergreen.V43.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V43.Bounds.Bounds Evergreen.V43.Units.CellUnit) (List ((Evergreen.V43.Helper.Coord Evergreen.V43.Units.CellUnit), Evergreen.V43.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V43/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.Cursor exposing (..) 2 | 3 | import Evergreen.V43.Helper 4 | import Evergreen.V43.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V43.Helper.Coord Evergreen.V43.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V43.Units.AsciiUnit) 12 | , size : (Evergreen.V43.Helper.Coord Evergreen.V43.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V43/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V43/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V43.Ascii 5 | import Evergreen.V43.GridCell 6 | import Evergreen.V43.Helper 7 | import Evergreen.V43.Units 8 | import Evergreen.V43.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V43.Helper.Coord Evergreen.V43.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V43.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V43.Helper.Coord Evergreen.V43.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V43.Ascii.Ascii) 24 | , userId : Evergreen.V43.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V43.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } -------------------------------------------------------------------------------- /src/Evergreen/V43/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V43.Ascii 5 | import Evergreen.V43.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V43.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V43.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V43.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V43/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V43/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V43.Bounds 5 | import Evergreen.V43.Grid 6 | import Evergreen.V43.Helper 7 | import Evergreen.V43.Units 8 | import Evergreen.V43.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V43.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V43.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V43.Helper.RawCellCoord Int)) 16 | , user : Evergreen.V43.User.UserId 17 | , hiddenUsers : (EverySet.EverySet Evergreen.V43.User.UserId) 18 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V43.User.UserId) 19 | , viewBounds : (Evergreen.V43.Bounds.Bounds Evergreen.V43.Units.CellUnit) 20 | , undoCurrent : (Dict.Dict Evergreen.V43.Helper.RawCellCoord Int) 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V43/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V43/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.Point2d exposing (..) 2 | 3 | import Evergreen.V43.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V43.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V43/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type ScreenCoordinate 12 | = ScreenCoordinate Never 13 | 14 | 15 | type CellUnit 16 | = CellUnit Never 17 | 18 | 19 | type WorldCoordinate 20 | = WorldCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V43/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V43.User exposing (..) 2 | 3 | type UserId 4 | = UserId Int 5 | 6 | 7 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V45/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V45/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.Bounds exposing (..) 2 | 3 | import Evergreen.V45.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V45.Helper.Coord unit) 9 | , max : (Evergreen.V45.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V45/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.Change exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V45.Bounds 5 | import Evergreen.V45.Grid 6 | import Evergreen.V45.GridCell 7 | import Evergreen.V45.Helper 8 | import Evergreen.V45.Units 9 | import Evergreen.V45.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V45.Grid.LocalChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalHideUser Evergreen.V45.User.UserId (Evergreen.V45.Helper.Coord Evergreen.V45.Units.AsciiUnit) 18 | | LocalUnhideUser Evergreen.V45.User.UserId 19 | | LocalToggleUserVisibilityForAll Evergreen.V45.User.UserId 20 | 21 | 22 | type ServerChange 23 | = ServerGridChange Evergreen.V45.Grid.Change 24 | | ServerUndoPoint 25 | { userId : Evergreen.V45.User.UserId 26 | , undoPoints : (Dict.Dict Evergreen.V45.Helper.RawCellCoord Int) 27 | } 28 | | ServerToggleUserVisibilityForAll Evergreen.V45.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V45.Bounds.Bounds Evergreen.V45.Units.CellUnit) (List ((Evergreen.V45.Helper.Coord Evergreen.V45.Units.CellUnit), Evergreen.V45.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V45/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.Cursor exposing (..) 2 | 3 | import Evergreen.V45.Helper 4 | import Evergreen.V45.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V45.Helper.Coord Evergreen.V45.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V45.Units.AsciiUnit) 12 | , size : (Evergreen.V45.Helper.Coord Evergreen.V45.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V45/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V45/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V45.Ascii 5 | import Evergreen.V45.GridCell 6 | import Evergreen.V45.Helper 7 | import Evergreen.V45.Units 8 | import Evergreen.V45.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V45.Helper.Coord Evergreen.V45.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V45.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V45.Helper.Coord Evergreen.V45.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V45.Ascii.Ascii) 24 | , userId : Evergreen.V45.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V45.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } -------------------------------------------------------------------------------- /src/Evergreen/V45/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V45.Ascii 5 | import Evergreen.V45.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V45.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V45.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V45.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V45/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V45/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V45.Bounds 5 | import Evergreen.V45.Grid 6 | import Evergreen.V45.Helper 7 | import Evergreen.V45.Units 8 | import Evergreen.V45.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V45.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V45.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V45.Helper.RawCellCoord Int)) 16 | , user : Evergreen.V45.User.UserId 17 | , hiddenUsers : (EverySet.EverySet Evergreen.V45.User.UserId) 18 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V45.User.UserId) 19 | , viewBounds : (Evergreen.V45.Bounds.Bounds Evergreen.V45.Units.CellUnit) 20 | , undoCurrent : (Dict.Dict Evergreen.V45.Helper.RawCellCoord Int) 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V45/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V45/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.Point2d exposing (..) 2 | 3 | import Evergreen.V45.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V45.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V45/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type ScreenCoordinate 12 | = ScreenCoordinate Never 13 | 14 | 15 | type CellUnit 16 | = CellUnit Never 17 | 18 | 19 | type WorldCoordinate 20 | = WorldCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V45/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V45.User exposing (..) 2 | 3 | type UserId 4 | = UserId Int 5 | 6 | 7 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V47/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V47/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.Bounds exposing (..) 2 | 3 | import Evergreen.V47.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V47.Helper.Coord unit) 9 | , max : (Evergreen.V47.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V47/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.Change exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V47.Bounds 5 | import Evergreen.V47.Grid 6 | import Evergreen.V47.GridCell 7 | import Evergreen.V47.Helper 8 | import Evergreen.V47.Units 9 | import Evergreen.V47.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V47.Grid.LocalGridChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalHideUser Evergreen.V47.User.UserId (Evergreen.V47.Helper.Coord Evergreen.V47.Units.AsciiUnit) 18 | | LocalUnhideUser Evergreen.V47.User.UserId 19 | | LocalToggleUserVisibilityForAll Evergreen.V47.User.UserId 20 | 21 | 22 | type ServerChange 23 | = ServerGridChange Evergreen.V47.Grid.GridChange 24 | | ServerUndoPoint 25 | { userId : Evergreen.V47.User.UserId 26 | , undoPoints : (Dict.Dict Evergreen.V47.Helper.RawCellCoord Int) 27 | } 28 | | ServerToggleUserVisibilityForAll Evergreen.V47.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V47.Bounds.Bounds Evergreen.V47.Units.CellUnit) (List ((Evergreen.V47.Helper.Coord Evergreen.V47.Units.CellUnit), Evergreen.V47.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V47/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.Cursor exposing (..) 2 | 3 | import Evergreen.V47.Helper 4 | import Evergreen.V47.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V47.Helper.Coord Evergreen.V47.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V47.Units.AsciiUnit) 12 | , size : (Evergreen.V47.Helper.Coord Evergreen.V47.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V47/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V47/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V47.Ascii 5 | import Evergreen.V47.GridCell 6 | import Evergreen.V47.Helper 7 | import Evergreen.V47.Units 8 | import Evergreen.V47.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalGridChange = 14 | { cellPosition : (Evergreen.V47.Helper.Coord Evergreen.V47.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V47.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias GridChange = 21 | { cellPosition : (Evergreen.V47.Helper.Coord Evergreen.V47.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V47.Ascii.Ascii) 24 | , userId : Evergreen.V47.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V47.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } -------------------------------------------------------------------------------- /src/Evergreen/V47/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V47.Ascii 5 | import Evergreen.V47.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V47.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V47.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V47.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V47/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V47/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V47.Bounds 5 | import Evergreen.V47.Grid 6 | import Evergreen.V47.Helper 7 | import Evergreen.V47.Units 8 | import Evergreen.V47.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V47.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V47.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V47.Helper.RawCellCoord Int)) 16 | , user : Evergreen.V47.User.UserId 17 | , hiddenUsers : (EverySet.EverySet Evergreen.V47.User.UserId) 18 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V47.User.UserId) 19 | , viewBounds : (Evergreen.V47.Bounds.Bounds Evergreen.V47.Units.CellUnit) 20 | , undoCurrent : (Dict.Dict Evergreen.V47.Helper.RawCellCoord Int) 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V47/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V47/NotifyMe.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.NotifyMe exposing (..) 2 | 3 | import Email 4 | 5 | 6 | type Status 7 | = Form 8 | | FormWithError 9 | | WaitingOnConfirmation 10 | 11 | 12 | type Frequency 13 | = Every3Hours 14 | | Every12Hours 15 | | Daily 16 | | Weekly 17 | | Monthly 18 | 19 | 20 | type alias InProgressModel = 21 | { status : Status 22 | , email : String 23 | , frequency : (Maybe Frequency) 24 | } 25 | 26 | 27 | type Model 28 | = InProgress InProgressModel 29 | | Completed 30 | | BackendError 31 | | Unsubscribed 32 | 33 | 34 | type ThreeHours 35 | = ThreeHours Never 36 | 37 | 38 | type alias Validated = 39 | { email : Email.Email 40 | , frequency : Frequency 41 | } -------------------------------------------------------------------------------- /src/Evergreen/V47/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.Point2d exposing (..) 2 | 3 | import Evergreen.V47.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V47.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V47/RecentChanges.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.RecentChanges exposing (..) 2 | 3 | import AssocList 4 | import Dict 5 | import Evergreen.V47.GridCell 6 | import Evergreen.V47.Helper 7 | import Evergreen.V47.NotifyMe 8 | import Quantity 9 | 10 | 11 | type RecentChanges 12 | = RecentChanges 13 | { frequencies : (AssocList.Dict Evergreen.V47.NotifyMe.Frequency (Dict.Dict Evergreen.V47.Helper.RawCellCoord Evergreen.V47.GridCell.Cell)) 14 | , threeHoursElapsed : (Quantity.Quantity Int Evergreen.V47.NotifyMe.ThreeHours) 15 | } -------------------------------------------------------------------------------- /src/Evergreen/V47/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type ScreenCoordinate 12 | = ScreenCoordinate Never 13 | 14 | 15 | type CellUnit 16 | = CellUnit Never 17 | 18 | 19 | type WorldCoordinate 20 | = WorldCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V47/UrlHelper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.UrlHelper exposing (..) 2 | 3 | type UnsubscribeEmailKey 4 | = UnsubscribeEmailKey String 5 | 6 | 7 | type ConfirmEmailKey 8 | = ConfirmEmailKey String -------------------------------------------------------------------------------- /src/Evergreen/V47/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V47.User exposing (..) 2 | 3 | type UserId 4 | = UserId Int 5 | 6 | 7 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V48/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V48/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.Bounds exposing (..) 2 | 3 | import Evergreen.V48.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V48.Helper.Coord unit) 9 | , max : (Evergreen.V48.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V48/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.Change exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V48.Bounds 5 | import Evergreen.V48.Grid 6 | import Evergreen.V48.GridCell 7 | import Evergreen.V48.Helper 8 | import Evergreen.V48.Units 9 | import Evergreen.V48.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V48.Grid.LocalGridChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalHideUser Evergreen.V48.User.UserId (Evergreen.V48.Helper.Coord Evergreen.V48.Units.AsciiUnit) 18 | | LocalUnhideUser Evergreen.V48.User.UserId 19 | | LocalToggleUserVisibilityForAll Evergreen.V48.User.UserId 20 | 21 | 22 | type ServerChange 23 | = ServerGridChange Evergreen.V48.Grid.GridChange 24 | | ServerUndoPoint 25 | { userId : Evergreen.V48.User.UserId 26 | , undoPoints : (Dict.Dict Evergreen.V48.Helper.RawCellCoord Int) 27 | } 28 | | ServerToggleUserVisibilityForAll Evergreen.V48.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V48.Bounds.Bounds Evergreen.V48.Units.CellUnit) (List ((Evergreen.V48.Helper.Coord Evergreen.V48.Units.CellUnit), Evergreen.V48.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V48/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.Cursor exposing (..) 2 | 3 | import Evergreen.V48.Helper 4 | import Evergreen.V48.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V48.Helper.Coord Evergreen.V48.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V48.Units.AsciiUnit) 12 | , size : (Evergreen.V48.Helper.Coord Evergreen.V48.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V48/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V48/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V48.Ascii 5 | import Evergreen.V48.GridCell 6 | import Evergreen.V48.Helper 7 | import Evergreen.V48.Units 8 | import Evergreen.V48.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalGridChange = 14 | { cellPosition : (Evergreen.V48.Helper.Coord Evergreen.V48.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V48.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias GridChange = 21 | { cellPosition : (Evergreen.V48.Helper.Coord Evergreen.V48.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V48.Ascii.Ascii) 24 | , userId : Evergreen.V48.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V48.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } -------------------------------------------------------------------------------- /src/Evergreen/V48/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V48.Ascii 5 | import Evergreen.V48.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V48.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V48.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V48.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V48/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V48/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V48.Bounds 5 | import Evergreen.V48.Grid 6 | import Evergreen.V48.Helper 7 | import Evergreen.V48.Units 8 | import Evergreen.V48.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V48.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V48.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V48.Helper.RawCellCoord Int)) 16 | , user : Evergreen.V48.User.UserId 17 | , hiddenUsers : (EverySet.EverySet Evergreen.V48.User.UserId) 18 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V48.User.UserId) 19 | , viewBounds : (Evergreen.V48.Bounds.Bounds Evergreen.V48.Units.CellUnit) 20 | , undoCurrent : (Dict.Dict Evergreen.V48.Helper.RawCellCoord Int) 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V48/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V48/NotifyMe.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.NotifyMe exposing (..) 2 | 3 | import Email 4 | 5 | 6 | type Status 7 | = Form 8 | | FormWithError 9 | | SendingToBackend 10 | | WaitingOnConfirmation 11 | 12 | 13 | type Frequency 14 | = Every3Hours 15 | | Every12Hours 16 | | Daily 17 | | Weekly 18 | | Monthly 19 | 20 | 21 | type alias InProgressModel = 22 | { status : Status 23 | , email : String 24 | , frequency : (Maybe Frequency) 25 | } 26 | 27 | 28 | type Model 29 | = InProgress InProgressModel 30 | | Completed 31 | | BackendError 32 | | Unsubscribed 33 | 34 | 35 | type ThreeHours 36 | = ThreeHours Never 37 | 38 | 39 | type alias Validated = 40 | { email : Email.Email 41 | , frequency : Frequency 42 | } -------------------------------------------------------------------------------- /src/Evergreen/V48/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.Point2d exposing (..) 2 | 3 | import Evergreen.V48.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V48.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V48/RecentChanges.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.RecentChanges exposing (..) 2 | 3 | import AssocList 4 | import Dict 5 | import Evergreen.V48.GridCell 6 | import Evergreen.V48.Helper 7 | import Evergreen.V48.NotifyMe 8 | import Quantity 9 | 10 | 11 | type RecentChanges 12 | = RecentChanges 13 | { frequencies : (AssocList.Dict Evergreen.V48.NotifyMe.Frequency (Dict.Dict Evergreen.V48.Helper.RawCellCoord Evergreen.V48.GridCell.Cell)) 14 | , threeHoursElapsed : (Quantity.Quantity Int Evergreen.V48.NotifyMe.ThreeHours) 15 | } -------------------------------------------------------------------------------- /src/Evergreen/V48/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type ScreenCoordinate 12 | = ScreenCoordinate Never 13 | 14 | 15 | type CellUnit 16 | = CellUnit Never 17 | 18 | 19 | type WorldCoordinate 20 | = WorldCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V48/UrlHelper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.UrlHelper exposing (..) 2 | 3 | type UnsubscribeEmailKey 4 | = UnsubscribeEmailKey String 5 | 6 | 7 | type ConfirmEmailKey 8 | = ConfirmEmailKey String -------------------------------------------------------------------------------- /src/Evergreen/V48/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V48.User exposing (..) 2 | 3 | type UserId 4 | = UserId Int 5 | 6 | 7 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V50/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V50/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.Bounds exposing (..) 2 | 3 | import Evergreen.V50.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V50.Helper.Coord unit) 9 | , max : (Evergreen.V50.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V50/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.Change exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V50.Bounds 5 | import Evergreen.V50.Grid 6 | import Evergreen.V50.GridCell 7 | import Evergreen.V50.Helper 8 | import Evergreen.V50.Units 9 | import Evergreen.V50.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V50.Grid.LocalGridChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalHideUser Evergreen.V50.User.UserId (Evergreen.V50.Helper.Coord Evergreen.V50.Units.AsciiUnit) 18 | | LocalUnhideUser Evergreen.V50.User.UserId 19 | | LocalToggleUserVisibilityForAll Evergreen.V50.User.UserId 20 | 21 | 22 | type ServerChange 23 | = ServerGridChange Evergreen.V50.Grid.GridChange 24 | | ServerUndoPoint 25 | { userId : Evergreen.V50.User.UserId 26 | , undoPoints : (Dict.Dict Evergreen.V50.Helper.RawCellCoord Int) 27 | } 28 | | ServerToggleUserVisibilityForAll Evergreen.V50.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V50.Bounds.Bounds Evergreen.V50.Units.CellUnit) (List ((Evergreen.V50.Helper.Coord Evergreen.V50.Units.CellUnit), Evergreen.V50.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V50/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.Cursor exposing (..) 2 | 3 | import Evergreen.V50.Helper 4 | import Evergreen.V50.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V50.Helper.Coord Evergreen.V50.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V50.Units.AsciiUnit) 12 | , size : (Evergreen.V50.Helper.Coord Evergreen.V50.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V50/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V50/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V50.Ascii 5 | import Evergreen.V50.GridCell 6 | import Evergreen.V50.Helper 7 | import Evergreen.V50.Units 8 | import Evergreen.V50.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalGridChange = 14 | { cellPosition : (Evergreen.V50.Helper.Coord Evergreen.V50.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V50.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias GridChange = 21 | { cellPosition : (Evergreen.V50.Helper.Coord Evergreen.V50.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V50.Ascii.Ascii) 24 | , userId : Evergreen.V50.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V50.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } -------------------------------------------------------------------------------- /src/Evergreen/V50/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V50.Ascii 5 | import Evergreen.V50.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V50.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V50.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V50.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V50/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V50/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V50.Bounds 5 | import Evergreen.V50.Grid 6 | import Evergreen.V50.Helper 7 | import Evergreen.V50.Units 8 | import Evergreen.V50.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V50.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V50.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V50.Helper.RawCellCoord Int)) 16 | , user : Evergreen.V50.User.UserId 17 | , hiddenUsers : (EverySet.EverySet Evergreen.V50.User.UserId) 18 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V50.User.UserId) 19 | , viewBounds : (Evergreen.V50.Bounds.Bounds Evergreen.V50.Units.CellUnit) 20 | , undoCurrent : (Dict.Dict Evergreen.V50.Helper.RawCellCoord Int) 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V50/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V50/NotifyMe.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.NotifyMe exposing (..) 2 | 3 | import Email 4 | 5 | 6 | type Status 7 | = Form 8 | | FormWithError 9 | | SendingToBackend 10 | | WaitingOnConfirmation 11 | 12 | 13 | type Frequency 14 | = Every3Hours 15 | | Every12Hours 16 | | Daily 17 | | Weekly 18 | | Monthly 19 | 20 | 21 | type alias InProgressModel = 22 | { status : Status 23 | , email : String 24 | , frequency : (Maybe Frequency) 25 | } 26 | 27 | 28 | type Model 29 | = InProgress InProgressModel 30 | | Completed 31 | | BackendError 32 | | Unsubscribed 33 | 34 | 35 | type ThreeHours 36 | = ThreeHours Never 37 | 38 | 39 | type alias Validated = 40 | { email : Email.Email 41 | , frequency : Frequency 42 | } -------------------------------------------------------------------------------- /src/Evergreen/V50/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.Point2d exposing (..) 2 | 3 | import Evergreen.V50.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V50.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V50/RecentChanges.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.RecentChanges exposing (..) 2 | 3 | import AssocList 4 | import Dict 5 | import Evergreen.V50.GridCell 6 | import Evergreen.V50.Helper 7 | import Evergreen.V50.NotifyMe 8 | import Quantity 9 | 10 | 11 | type RecentChanges 12 | = RecentChanges 13 | { frequencies : (AssocList.Dict Evergreen.V50.NotifyMe.Frequency (Dict.Dict Evergreen.V50.Helper.RawCellCoord Evergreen.V50.GridCell.Cell)) 14 | , threeHoursElapsed : (Quantity.Quantity Int Evergreen.V50.NotifyMe.ThreeHours) 15 | } -------------------------------------------------------------------------------- /src/Evergreen/V50/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type ScreenCoordinate 12 | = ScreenCoordinate Never 13 | 14 | 15 | type CellUnit 16 | = CellUnit Never 17 | 18 | 19 | type WorldCoordinate 20 | = WorldCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V50/UrlHelper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.UrlHelper exposing (..) 2 | 3 | type UnsubscribeEmailKey 4 | = UnsubscribeEmailKey String 5 | 6 | 7 | type ConfirmEmailKey 8 | = ConfirmEmailKey String -------------------------------------------------------------------------------- /src/Evergreen/V50/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V50.User exposing (..) 2 | 3 | type UserId 4 | = UserId Int 5 | 6 | 7 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V53/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V53/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.Bounds exposing (..) 2 | 3 | import Evergreen.V53.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V53.Helper.Coord unit) 9 | , max : (Evergreen.V53.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V53/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.Change exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V53.Bounds 5 | import Evergreen.V53.Grid 6 | import Evergreen.V53.GridCell 7 | import Evergreen.V53.Helper 8 | import Evergreen.V53.Units 9 | import Evergreen.V53.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V53.Grid.LocalGridChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalHideUser Evergreen.V53.User.UserId (Evergreen.V53.Helper.Coord Evergreen.V53.Units.AsciiUnit) 18 | | LocalUnhideUser Evergreen.V53.User.UserId 19 | | LocalToggleUserVisibilityForAll Evergreen.V53.User.UserId 20 | 21 | 22 | type ServerChange 23 | = ServerGridChange Evergreen.V53.Grid.GridChange 24 | | ServerUndoPoint 25 | { userId : Evergreen.V53.User.UserId 26 | , undoPoints : (Dict.Dict Evergreen.V53.Helper.RawCellCoord Int) 27 | } 28 | | ServerToggleUserVisibilityForAll Evergreen.V53.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V53.Bounds.Bounds Evergreen.V53.Units.CellUnit) (List ((Evergreen.V53.Helper.Coord Evergreen.V53.Units.CellUnit), Evergreen.V53.GridCell.Cell)) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V53/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.Cursor exposing (..) 2 | 3 | import Evergreen.V53.Helper 4 | import Evergreen.V53.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V53.Helper.Coord Evergreen.V53.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V53.Units.AsciiUnit) 12 | , size : (Evergreen.V53.Helper.Coord Evergreen.V53.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V53/Email.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.Email exposing (..) 2 | 3 | 4 | type alias Email = 5 | { localPart : String 6 | , tags : List String 7 | , domain : String 8 | , tld : List String 9 | } 10 | -------------------------------------------------------------------------------- /src/Evergreen/V53/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V53/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V53.Ascii 5 | import Evergreen.V53.GridCell 6 | import Evergreen.V53.Helper 7 | import Evergreen.V53.Units 8 | import Evergreen.V53.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalGridChange = 14 | { cellPosition : (Evergreen.V53.Helper.Coord Evergreen.V53.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V53.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias GridChange = 21 | { cellPosition : (Evergreen.V53.Helper.Coord Evergreen.V53.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V53.Ascii.Ascii) 24 | , userId : Evergreen.V53.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V53.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } -------------------------------------------------------------------------------- /src/Evergreen/V53/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V53.Ascii 5 | import Evergreen.V53.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V53.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V53.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V53.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V53/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V53/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V53.Bounds 5 | import Evergreen.V53.Grid 6 | import Evergreen.V53.Helper 7 | import Evergreen.V53.Units 8 | import Evergreen.V53.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V53.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V53.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V53.Helper.RawCellCoord Int)) 16 | , user : Evergreen.V53.User.UserId 17 | , hiddenUsers : (EverySet.EverySet Evergreen.V53.User.UserId) 18 | , adminHiddenUsers : (EverySet.EverySet Evergreen.V53.User.UserId) 19 | , viewBounds : (Evergreen.V53.Bounds.Bounds Evergreen.V53.Units.CellUnit) 20 | , undoCurrent : (Dict.Dict Evergreen.V53.Helper.RawCellCoord Int) 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V53/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V53/NotifyMe.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.NotifyMe exposing (..) 2 | 3 | import Evergreen.V53.Email exposing (Email) 4 | 5 | 6 | type Status 7 | = Form 8 | | FormWithError 9 | | SendingToBackend 10 | | WaitingOnConfirmation 11 | 12 | 13 | type Frequency 14 | = Every3Hours 15 | | Every12Hours 16 | | Daily 17 | | Weekly 18 | | Monthly 19 | 20 | 21 | type alias InProgressModel = 22 | { status : Status 23 | , email : String 24 | , frequency : Maybe Frequency 25 | } 26 | 27 | 28 | type Model 29 | = InProgress InProgressModel 30 | | Completed 31 | | BackendError 32 | | Unsubscribing 33 | | Unsubscribed 34 | 35 | 36 | type ThreeHours 37 | = ThreeHours Never 38 | 39 | 40 | type alias Validated = 41 | { email : Email 42 | , frequency : Frequency 43 | } 44 | -------------------------------------------------------------------------------- /src/Evergreen/V53/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.Point2d exposing (..) 2 | 3 | import Evergreen.V53.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V53.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V53/RecentChanges.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.RecentChanges exposing (..) 2 | 3 | import AssocList 4 | import Dict 5 | import Evergreen.V53.GridCell 6 | import Evergreen.V53.Helper 7 | import Evergreen.V53.NotifyMe 8 | import Quantity 9 | 10 | 11 | type RecentChanges 12 | = RecentChanges 13 | { frequencies : (AssocList.Dict Evergreen.V53.NotifyMe.Frequency (Dict.Dict Evergreen.V53.Helper.RawCellCoord Evergreen.V53.GridCell.Cell)) 14 | , threeHoursElapsed : (Quantity.Quantity Int Evergreen.V53.NotifyMe.ThreeHours) 15 | } -------------------------------------------------------------------------------- /src/Evergreen/V53/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type AsciiUnit 8 | = AsciiUnit Never 9 | 10 | 11 | type ScreenCoordinate 12 | = ScreenCoordinate Never 13 | 14 | 15 | type CellUnit 16 | = CellUnit Never 17 | 18 | 19 | type WorldCoordinate 20 | = WorldCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V53/UrlHelper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.UrlHelper exposing (..) 2 | 3 | type UnsubscribeEmailKey 4 | = UnsubscribeEmailKey String 5 | 6 | 7 | type ConfirmEmailKey 8 | = ConfirmEmailKey String -------------------------------------------------------------------------------- /src/Evergreen/V53/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V53.User exposing (..) 2 | 3 | type UserId 4 | = UserId Int 5 | 6 | 7 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Evergreen/V68/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.Ascii exposing (..) 2 | 3 | 4 | type Ascii 5 | = Ascii Int 6 | -------------------------------------------------------------------------------- /src/Evergreen/V68/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.Bounds exposing (..) 2 | 3 | import Evergreen.V68.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : Evergreen.V68.Helper.Coord unit 9 | , max : Evergreen.V68.Helper.Coord unit 10 | } 11 | -------------------------------------------------------------------------------- /src/Evergreen/V68/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.Change exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V68.Bounds 5 | import Evergreen.V68.Grid 6 | import Evergreen.V68.GridCell 7 | import Evergreen.V68.Helper 8 | import Evergreen.V68.Units 9 | import Evergreen.V68.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V68.Grid.LocalGridChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalHideUser Evergreen.V68.User.UserId (Evergreen.V68.Helper.Coord Evergreen.V68.Units.AsciiUnit) 18 | | LocalUnhideUser Evergreen.V68.User.UserId 19 | | LocalToggleUserVisibilityForAll Evergreen.V68.User.UserId 20 | 21 | 22 | type ServerChange 23 | = ServerGridChange Evergreen.V68.Grid.GridChange 24 | | ServerUndoPoint 25 | { userId : Evergreen.V68.User.UserId 26 | , undoPoints : Dict.Dict Evergreen.V68.Helper.RawCellCoord Int 27 | } 28 | | ServerToggleUserVisibilityForAll Evergreen.V68.User.UserId 29 | 30 | 31 | type ClientChange 32 | = ViewBoundsChange (Evergreen.V68.Bounds.Bounds Evergreen.V68.Units.CellUnit) (List ( Evergreen.V68.Helper.Coord Evergreen.V68.Units.CellUnit, Evergreen.V68.GridCell.Cell )) 33 | 34 | 35 | type Change 36 | = LocalChange LocalChange 37 | | ServerChange ServerChange 38 | | ClientChange ClientChange 39 | -------------------------------------------------------------------------------- /src/Evergreen/V68/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.Cursor exposing (..) 2 | 3 | import Evergreen.V68.Helper 4 | import Evergreen.V68.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : Evergreen.V68.Helper.Coord Evergreen.V68.Units.AsciiUnit 11 | , startingColumn : Quantity.Quantity Int Evergreen.V68.Units.AsciiUnit 12 | , size : Evergreen.V68.Helper.Coord Evergreen.V68.Units.AsciiUnit 13 | } 14 | -------------------------------------------------------------------------------- /src/Evergreen/V68/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.Geometry.Types exposing (..) 2 | 3 | 4 | type Point2d units coordinates 5 | = Point2d 6 | { x : Float 7 | , y : Float 8 | } 9 | -------------------------------------------------------------------------------- /src/Evergreen/V68/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V68.Ascii 5 | import Evergreen.V68.GridCell 6 | import Evergreen.V68.Helper 7 | import Evergreen.V68.Units 8 | import Evergreen.V68.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalGridChange = 14 | { cellPosition : Evergreen.V68.Helper.Coord Evergreen.V68.Units.CellUnit 15 | , localPosition : Int 16 | , change : List.Nonempty.Nonempty Evergreen.V68.Ascii.Ascii 17 | } 18 | 19 | 20 | type alias GridChange = 21 | { cellPosition : Evergreen.V68.Helper.Coord Evergreen.V68.Units.CellUnit 22 | , localPosition : Int 23 | , change : List.Nonempty.Nonempty Evergreen.V68.Ascii.Ascii 24 | , userId : Evergreen.V68.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict ( Int, Int ) Evergreen.V68.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } 38 | -------------------------------------------------------------------------------- /src/Evergreen/V68/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V68.Ascii 5 | import Evergreen.V68.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : 12 | List 13 | { userId : Evergreen.V68.User.UserId 14 | , position : Int 15 | , line : List.Nonempty.Nonempty Evergreen.V68.Ascii.Ascii 16 | } 17 | , undoPoint : Dict.Dict Evergreen.V68.User.RawUserId Int 18 | } 19 | -------------------------------------------------------------------------------- /src/Evergreen/V68/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = 7 | ( Quantity.Quantity Int units, Quantity.Quantity Int units ) 8 | 9 | 10 | type alias RawCellCoord = 11 | ( Int, Int ) 12 | -------------------------------------------------------------------------------- /src/Evergreen/V68/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V68.Bounds 5 | import Evergreen.V68.Grid 6 | import Evergreen.V68.Helper 7 | import Evergreen.V68.Units 8 | import Evergreen.V68.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V68.Grid.Grid 14 | , undoHistory : List (Dict.Dict Evergreen.V68.Helper.RawCellCoord Int) 15 | , redoHistory : List (Dict.Dict Evergreen.V68.Helper.RawCellCoord Int) 16 | , user : Evergreen.V68.User.UserId 17 | , hiddenUsers : EverySet.EverySet Evergreen.V68.User.UserId 18 | , adminHiddenUsers : EverySet.EverySet Evergreen.V68.User.UserId 19 | , viewBounds : Evergreen.V68.Bounds.Bounds Evergreen.V68.Units.CellUnit 20 | , undoCurrent : Dict.Dict Evergreen.V68.Helper.RawCellCoord Int 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ 26 | -------------------------------------------------------------------------------- /src/Evergreen/V68/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : List ( Time.Posix, msg ) 9 | , localModel : model 10 | , model : model 11 | } 12 | -------------------------------------------------------------------------------- /src/Evergreen/V68/NotifyMe.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.NotifyMe exposing (..) 2 | 3 | import EmailAddress 4 | 5 | 6 | type Status 7 | = Form 8 | | FormWithError 9 | | SendingToBackend 10 | | WaitingOnConfirmation 11 | 12 | 13 | type Frequency 14 | = Every3Hours 15 | | Every12Hours 16 | | Daily 17 | | Weekly 18 | | Monthly 19 | 20 | 21 | type alias InProgressModel = 22 | { status : Status 23 | , email : String 24 | , frequency : Maybe Frequency 25 | } 26 | 27 | 28 | type Model 29 | = InProgress InProgressModel 30 | | Completed 31 | | BackendError 32 | | Unsubscribing 33 | | Unsubscribed 34 | 35 | 36 | type ThreeHours 37 | = ThreeHours Never 38 | 39 | 40 | type alias Validated = 41 | { email : EmailAddress.EmailAddress 42 | , frequency : Frequency 43 | } 44 | -------------------------------------------------------------------------------- /src/Evergreen/V68/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.Point2d exposing (..) 2 | 3 | import Evergreen.V68.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = 7 | Evergreen.V68.Geometry.Types.Point2d units coordinates 8 | -------------------------------------------------------------------------------- /src/Evergreen/V68/RecentChanges.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.RecentChanges exposing (..) 2 | 3 | import AssocList 4 | import Dict 5 | import Evergreen.V68.GridCell 6 | import Evergreen.V68.Helper 7 | import Evergreen.V68.NotifyMe 8 | import Quantity 9 | 10 | 11 | type RecentChanges 12 | = RecentChanges 13 | { frequencies : AssocList.Dict Evergreen.V68.NotifyMe.Frequency (Dict.Dict Evergreen.V68.Helper.RawCellCoord Evergreen.V68.GridCell.Cell) 14 | , threeHoursElapsed : Quantity.Quantity Int Evergreen.V68.NotifyMe.ThreeHours 15 | } 16 | -------------------------------------------------------------------------------- /src/Evergreen/V68/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.Units exposing (..) 2 | 3 | 4 | type WorldPixel 5 | = WorldPixel Never 6 | 7 | 8 | type AsciiUnit 9 | = AsciiUnit Never 10 | 11 | 12 | type ScreenCoordinate 13 | = ScreenCoordinate Never 14 | 15 | 16 | type CellUnit 17 | = CellUnit Never 18 | 19 | 20 | type WorldCoordinate 21 | = WorldCoordinate Never 22 | -------------------------------------------------------------------------------- /src/Evergreen/V68/UrlHelper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.UrlHelper exposing (..) 2 | 3 | 4 | type UnsubscribeEmailKey 5 | = UnsubscribeEmailKey String 6 | 7 | 8 | type ConfirmEmailKey 9 | = ConfirmEmailKey String 10 | -------------------------------------------------------------------------------- /src/Evergreen/V68/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V68.User exposing (..) 2 | 3 | 4 | type UserId 5 | = UserId Int 6 | 7 | 8 | type alias RawUserId = 9 | Int 10 | -------------------------------------------------------------------------------- /src/Evergreen/V73/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.Ascii exposing (..) 2 | 3 | 4 | type Ascii 5 | = Ascii Int 6 | -------------------------------------------------------------------------------- /src/Evergreen/V73/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.Bounds exposing (..) 2 | 3 | import Evergreen.V73.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : Evergreen.V73.Helper.Coord unit 9 | , max : Evergreen.V73.Helper.Coord unit 10 | } 11 | -------------------------------------------------------------------------------- /src/Evergreen/V73/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.Cursor exposing (..) 2 | 3 | import Evergreen.V73.Helper 4 | import Evergreen.V73.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : Evergreen.V73.Helper.Coord Evergreen.V73.Units.AsciiUnit 11 | , startingColumn : Quantity.Quantity Int Evergreen.V73.Units.AsciiUnit 12 | , size : Evergreen.V73.Helper.Coord Evergreen.V73.Units.AsciiUnit 13 | } 14 | -------------------------------------------------------------------------------- /src/Evergreen/V73/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.Geometry.Types exposing (..) 2 | 3 | 4 | type Point2d units coordinates 5 | = Point2d 6 | { x : Float 7 | , y : Float 8 | } 9 | -------------------------------------------------------------------------------- /src/Evergreen/V73/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V73.Ascii 5 | import Evergreen.V73.GridCell 6 | import Evergreen.V73.Helper 7 | import Evergreen.V73.Units 8 | import Evergreen.V73.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalGridChange = 14 | { cellPosition : Evergreen.V73.Helper.Coord Evergreen.V73.Units.CellUnit 15 | , localPosition : Int 16 | , change : List.Nonempty.Nonempty Evergreen.V73.Ascii.Ascii 17 | } 18 | 19 | 20 | type alias GridChange = 21 | { cellPosition : Evergreen.V73.Helper.Coord Evergreen.V73.Units.CellUnit 22 | , localPosition : Int 23 | , change : List.Nonempty.Nonempty Evergreen.V73.Ascii.Ascii 24 | , userId : Evergreen.V73.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict ( Int, Int ) Evergreen.V73.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } 38 | -------------------------------------------------------------------------------- /src/Evergreen/V73/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V73.Ascii 5 | import Evergreen.V73.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : 12 | List 13 | { userId : Evergreen.V73.User.UserId 14 | , position : Int 15 | , line : List.Nonempty.Nonempty Evergreen.V73.Ascii.Ascii 16 | } 17 | , undoPoint : Dict.Dict Evergreen.V73.User.RawUserId Int 18 | } 19 | -------------------------------------------------------------------------------- /src/Evergreen/V73/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = 7 | ( Quantity.Quantity Int units, Quantity.Quantity Int units ) 8 | 9 | 10 | type alias RawCellCoord = 11 | ( Int, Int ) 12 | -------------------------------------------------------------------------------- /src/Evergreen/V73/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V73.Bounds 5 | import Evergreen.V73.Grid 6 | import Evergreen.V73.Helper 7 | import Evergreen.V73.Units 8 | import Evergreen.V73.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V73.Grid.Grid 14 | , undoHistory : List (Dict.Dict Evergreen.V73.Helper.RawCellCoord Int) 15 | , redoHistory : List (Dict.Dict Evergreen.V73.Helper.RawCellCoord Int) 16 | , user : Evergreen.V73.User.UserId 17 | , hiddenUsers : EverySet.EverySet Evergreen.V73.User.UserId 18 | , adminHiddenUsers : EverySet.EverySet Evergreen.V73.User.UserId 19 | , viewBounds : Evergreen.V73.Bounds.Bounds Evergreen.V73.Units.CellUnit 20 | , undoCurrent : Dict.Dict Evergreen.V73.Helper.RawCellCoord Int 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ 26 | -------------------------------------------------------------------------------- /src/Evergreen/V73/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : List ( Time.Posix, msg ) 9 | , localModel : model 10 | , model : model 11 | } 12 | -------------------------------------------------------------------------------- /src/Evergreen/V73/NotifyMe.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.NotifyMe exposing (..) 2 | 3 | import EmailAddress 4 | 5 | 6 | type Status 7 | = Form 8 | | FormWithError 9 | | SendingToBackend 10 | | WaitingOnConfirmation 11 | 12 | 13 | type Frequency 14 | = Every3Hours 15 | | Every12Hours 16 | | Daily 17 | | Weekly 18 | | Monthly 19 | 20 | 21 | type alias InProgressModel = 22 | { status : Status 23 | , email : String 24 | , frequency : Maybe Frequency 25 | } 26 | 27 | 28 | type Model 29 | = InProgress InProgressModel 30 | | Completed 31 | | BackendError 32 | | Unsubscribing 33 | | Unsubscribed 34 | 35 | 36 | type ThreeHours 37 | = ThreeHours Never 38 | 39 | 40 | type alias Validated = 41 | { email : EmailAddress.EmailAddress 42 | , frequency : Frequency 43 | } 44 | -------------------------------------------------------------------------------- /src/Evergreen/V73/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.Point2d exposing (..) 2 | 3 | import Evergreen.V73.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = 7 | Evergreen.V73.Geometry.Types.Point2d units coordinates 8 | -------------------------------------------------------------------------------- /src/Evergreen/V73/RecentChanges.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.RecentChanges exposing (..) 2 | 3 | import AssocList 4 | import Dict 5 | import Evergreen.V73.GridCell 6 | import Evergreen.V73.Helper 7 | import Evergreen.V73.NotifyMe 8 | import Quantity 9 | 10 | 11 | type RecentChanges 12 | = RecentChanges 13 | { frequencies : AssocList.Dict Evergreen.V73.NotifyMe.Frequency (Dict.Dict Evergreen.V73.Helper.RawCellCoord Evergreen.V73.GridCell.Cell) 14 | , threeHoursElapsed : Quantity.Quantity Int Evergreen.V73.NotifyMe.ThreeHours 15 | } 16 | -------------------------------------------------------------------------------- /src/Evergreen/V73/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.Units exposing (..) 2 | 3 | 4 | type WorldPixel 5 | = WorldPixel Never 6 | 7 | 8 | type AsciiUnit 9 | = AsciiUnit Never 10 | 11 | 12 | type ScreenCoordinate 13 | = ScreenCoordinate Never 14 | 15 | 16 | type CellUnit 17 | = CellUnit Never 18 | 19 | 20 | type WorldCoordinate 21 | = WorldCoordinate Never 22 | -------------------------------------------------------------------------------- /src/Evergreen/V73/UrlHelper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.UrlHelper exposing (..) 2 | 3 | 4 | type UnsubscribeEmailKey 5 | = UnsubscribeEmailKey String 6 | 7 | 8 | type ConfirmEmailKey 9 | = ConfirmEmailKey String 10 | -------------------------------------------------------------------------------- /src/Evergreen/V73/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V73.User exposing (..) 2 | 3 | 4 | type UserId 5 | = UserId Int 6 | 7 | 8 | type alias RawUserId = 9 | Int 10 | -------------------------------------------------------------------------------- /src/Evergreen/V77/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.Ascii exposing (..) 2 | 3 | 4 | type Ascii 5 | = Ascii Int 6 | -------------------------------------------------------------------------------- /src/Evergreen/V77/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.Bounds exposing (..) 2 | 3 | import Evergreen.V77.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : Evergreen.V77.Helper.Coord unit 9 | , max : Evergreen.V77.Helper.Coord unit 10 | } 11 | -------------------------------------------------------------------------------- /src/Evergreen/V77/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.Cursor exposing (..) 2 | 3 | import Evergreen.V77.Helper 4 | import Evergreen.V77.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : Evergreen.V77.Helper.Coord Evergreen.V77.Units.AsciiUnit 11 | , startingColumn : Quantity.Quantity Int Evergreen.V77.Units.AsciiUnit 12 | , size : Evergreen.V77.Helper.Coord Evergreen.V77.Units.AsciiUnit 13 | } 14 | -------------------------------------------------------------------------------- /src/Evergreen/V77/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.Geometry.Types exposing (..) 2 | 3 | 4 | type Point2d units coordinates 5 | = Point2d 6 | { x : Float 7 | , y : Float 8 | } 9 | -------------------------------------------------------------------------------- /src/Evergreen/V77/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V77.Ascii 5 | import Evergreen.V77.GridCell 6 | import Evergreen.V77.Helper 7 | import Evergreen.V77.Units 8 | import Evergreen.V77.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalGridChange = 14 | { cellPosition : Evergreen.V77.Helper.Coord Evergreen.V77.Units.CellUnit 15 | , localPosition : Int 16 | , change : List.Nonempty.Nonempty Evergreen.V77.Ascii.Ascii 17 | } 18 | 19 | 20 | type alias GridChange = 21 | { cellPosition : Evergreen.V77.Helper.Coord Evergreen.V77.Units.CellUnit 22 | , localPosition : Int 23 | , change : List.Nonempty.Nonempty Evergreen.V77.Ascii.Ascii 24 | , userId : Evergreen.V77.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict ( Int, Int ) Evergreen.V77.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } 38 | -------------------------------------------------------------------------------- /src/Evergreen/V77/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V77.Ascii 5 | import Evergreen.V77.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : 12 | List 13 | { userId : Evergreen.V77.User.UserId 14 | , position : Int 15 | , line : List.Nonempty.Nonempty Evergreen.V77.Ascii.Ascii 16 | } 17 | , undoPoint : Dict.Dict Evergreen.V77.User.RawUserId Int 18 | } 19 | -------------------------------------------------------------------------------- /src/Evergreen/V77/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = 7 | ( Quantity.Quantity Int units, Quantity.Quantity Int units ) 8 | 9 | 10 | type alias RawCellCoord = 11 | ( Int, Int ) 12 | -------------------------------------------------------------------------------- /src/Evergreen/V77/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V77.Bounds 5 | import Evergreen.V77.Grid 6 | import Evergreen.V77.Helper 7 | import Evergreen.V77.Units 8 | import Evergreen.V77.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V77.Grid.Grid 14 | , undoHistory : List (Dict.Dict Evergreen.V77.Helper.RawCellCoord Int) 15 | , redoHistory : List (Dict.Dict Evergreen.V77.Helper.RawCellCoord Int) 16 | , user : Evergreen.V77.User.UserId 17 | , hiddenUsers : EverySet.EverySet Evergreen.V77.User.UserId 18 | , adminHiddenUsers : EverySet.EverySet Evergreen.V77.User.UserId 19 | , viewBounds : Evergreen.V77.Bounds.Bounds Evergreen.V77.Units.CellUnit 20 | , undoCurrent : Dict.Dict Evergreen.V77.Helper.RawCellCoord Int 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ 26 | -------------------------------------------------------------------------------- /src/Evergreen/V77/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : List ( Time.Posix, msg ) 9 | , localModel : model 10 | , model : model 11 | } 12 | -------------------------------------------------------------------------------- /src/Evergreen/V77/NotifyMe.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.NotifyMe exposing (..) 2 | 3 | import EmailAddress 4 | 5 | 6 | type Status 7 | = Form 8 | | FormWithError 9 | | SendingToBackend 10 | | WaitingOnConfirmation 11 | 12 | 13 | type Frequency 14 | = Every3Hours 15 | | Every12Hours 16 | | Daily 17 | | Weekly 18 | | Monthly 19 | 20 | 21 | type alias InProgressModel = 22 | { status : Status 23 | , email : String 24 | , frequency : Maybe Frequency 25 | } 26 | 27 | 28 | type Model 29 | = InProgress InProgressModel 30 | | Completed 31 | | BackendError 32 | | Unsubscribing 33 | | Unsubscribed 34 | 35 | 36 | type ThreeHours 37 | = ThreeHours Never 38 | 39 | 40 | type alias Validated = 41 | { email : EmailAddress.EmailAddress 42 | , frequency : Frequency 43 | } 44 | -------------------------------------------------------------------------------- /src/Evergreen/V77/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.Point2d exposing (..) 2 | 3 | import Evergreen.V77.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = 7 | Evergreen.V77.Geometry.Types.Point2d units coordinates 8 | -------------------------------------------------------------------------------- /src/Evergreen/V77/RecentChanges.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.RecentChanges exposing (..) 2 | 3 | import AssocList 4 | import Dict 5 | import Evergreen.V77.GridCell 6 | import Evergreen.V77.Helper 7 | import Evergreen.V77.NotifyMe 8 | import Quantity 9 | 10 | 11 | type RecentChanges 12 | = RecentChanges 13 | { frequencies : AssocList.Dict Evergreen.V77.NotifyMe.Frequency (Dict.Dict Evergreen.V77.Helper.RawCellCoord Evergreen.V77.GridCell.Cell) 14 | , threeHoursElapsed : Quantity.Quantity Int Evergreen.V77.NotifyMe.ThreeHours 15 | } 16 | -------------------------------------------------------------------------------- /src/Evergreen/V77/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.Units exposing (..) 2 | 3 | 4 | type WorldPixel 5 | = WorldPixel Never 6 | 7 | 8 | type AsciiUnit 9 | = AsciiUnit Never 10 | 11 | 12 | type ScreenCoordinate 13 | = ScreenCoordinate Never 14 | 15 | 16 | type CellUnit 17 | = CellUnit Never 18 | 19 | 20 | type WorldCoordinate 21 | = WorldCoordinate Never 22 | -------------------------------------------------------------------------------- /src/Evergreen/V77/UrlHelper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.UrlHelper exposing (..) 2 | 3 | 4 | type UnsubscribeEmailKey 5 | = UnsubscribeEmailKey String 6 | 7 | 8 | type ConfirmEmailKey 9 | = ConfirmEmailKey String 10 | -------------------------------------------------------------------------------- /src/Evergreen/V77/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V77.User exposing (..) 2 | 3 | 4 | type UserId 5 | = UserId Int 6 | 7 | 8 | type alias RawUserId = 9 | Int 10 | -------------------------------------------------------------------------------- /src/Evergreen/V78/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.Ascii exposing (..) 2 | 3 | 4 | type Ascii 5 | = Ascii Int 6 | -------------------------------------------------------------------------------- /src/Evergreen/V78/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.Bounds exposing (..) 2 | 3 | import Evergreen.V78.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : Evergreen.V78.Helper.Coord unit 9 | , max : Evergreen.V78.Helper.Coord unit 10 | } 11 | -------------------------------------------------------------------------------- /src/Evergreen/V78/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.Cursor exposing (..) 2 | 3 | import Evergreen.V78.Helper 4 | import Evergreen.V78.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : Evergreen.V78.Helper.Coord Evergreen.V78.Units.AsciiUnit 11 | , startingColumn : Quantity.Quantity Int Evergreen.V78.Units.AsciiUnit 12 | , size : Evergreen.V78.Helper.Coord Evergreen.V78.Units.AsciiUnit 13 | } 14 | -------------------------------------------------------------------------------- /src/Evergreen/V78/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.Geometry.Types exposing (..) 2 | 3 | 4 | type Point2d units coordinates 5 | = Point2d 6 | { x : Float 7 | , y : Float 8 | } 9 | -------------------------------------------------------------------------------- /src/Evergreen/V78/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V78.Ascii 5 | import Evergreen.V78.GridCell 6 | import Evergreen.V78.Helper 7 | import Evergreen.V78.Units 8 | import Evergreen.V78.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalGridChange = 14 | { cellPosition : Evergreen.V78.Helper.Coord Evergreen.V78.Units.CellUnit 15 | , localPosition : Int 16 | , change : List.Nonempty.Nonempty Evergreen.V78.Ascii.Ascii 17 | } 18 | 19 | 20 | type alias GridChange = 21 | { cellPosition : Evergreen.V78.Helper.Coord Evergreen.V78.Units.CellUnit 22 | , localPosition : Int 23 | , change : List.Nonempty.Nonempty Evergreen.V78.Ascii.Ascii 24 | , userId : Evergreen.V78.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict ( Int, Int ) Evergreen.V78.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } 38 | -------------------------------------------------------------------------------- /src/Evergreen/V78/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V78.Ascii 5 | import Evergreen.V78.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : 12 | List 13 | { userId : Evergreen.V78.User.UserId 14 | , position : Int 15 | , line : List.Nonempty.Nonempty Evergreen.V78.Ascii.Ascii 16 | } 17 | , undoPoint : Dict.Dict Evergreen.V78.User.RawUserId Int 18 | } 19 | -------------------------------------------------------------------------------- /src/Evergreen/V78/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = 7 | ( Quantity.Quantity Int units, Quantity.Quantity Int units ) 8 | 9 | 10 | type alias RawCellCoord = 11 | ( Int, Int ) 12 | -------------------------------------------------------------------------------- /src/Evergreen/V78/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V78.Bounds 5 | import Evergreen.V78.Grid 6 | import Evergreen.V78.Helper 7 | import Evergreen.V78.Units 8 | import Evergreen.V78.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V78.Grid.Grid 14 | , undoHistory : List (Dict.Dict Evergreen.V78.Helper.RawCellCoord Int) 15 | , redoHistory : List (Dict.Dict Evergreen.V78.Helper.RawCellCoord Int) 16 | , user : Evergreen.V78.User.UserId 17 | , hiddenUsers : EverySet.EverySet Evergreen.V78.User.UserId 18 | , adminHiddenUsers : EverySet.EverySet Evergreen.V78.User.UserId 19 | , viewBounds : Evergreen.V78.Bounds.Bounds Evergreen.V78.Units.CellUnit 20 | , undoCurrent : Dict.Dict Evergreen.V78.Helper.RawCellCoord Int 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ 26 | -------------------------------------------------------------------------------- /src/Evergreen/V78/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : List ( Time.Posix, msg ) 9 | , localModel : model 10 | , model : model 11 | } 12 | -------------------------------------------------------------------------------- /src/Evergreen/V78/NotifyMe.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.NotifyMe exposing (..) 2 | 3 | import EmailAddress 4 | 5 | 6 | type Status 7 | = Form 8 | | FormWithError 9 | | SendingToBackend 10 | | WaitingOnConfirmation 11 | 12 | 13 | type Frequency 14 | = Every3Hours 15 | | Every12Hours 16 | | Daily 17 | | Weekly 18 | | Monthly 19 | 20 | 21 | type alias InProgressModel = 22 | { status : Status 23 | , email : String 24 | , frequency : Maybe Frequency 25 | } 26 | 27 | 28 | type Model 29 | = InProgress InProgressModel 30 | | Completed 31 | | BackendError 32 | | Unsubscribing 33 | | Unsubscribed 34 | 35 | 36 | type ThreeHours 37 | = ThreeHours Never 38 | 39 | 40 | type alias Validated = 41 | { email : EmailAddress.EmailAddress 42 | , frequency : Frequency 43 | } 44 | -------------------------------------------------------------------------------- /src/Evergreen/V78/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.Point2d exposing (..) 2 | 3 | import Evergreen.V78.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = 7 | Evergreen.V78.Geometry.Types.Point2d units coordinates 8 | -------------------------------------------------------------------------------- /src/Evergreen/V78/RecentChanges.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.RecentChanges exposing (..) 2 | 3 | import AssocList 4 | import Dict 5 | import Evergreen.V78.GridCell 6 | import Evergreen.V78.Helper 7 | import Evergreen.V78.NotifyMe 8 | import Quantity 9 | 10 | 11 | type RecentChanges 12 | = RecentChanges 13 | { frequencies : AssocList.Dict Evergreen.V78.NotifyMe.Frequency (Dict.Dict Evergreen.V78.Helper.RawCellCoord Evergreen.V78.GridCell.Cell) 14 | , threeHoursElapsed : Quantity.Quantity Int Evergreen.V78.NotifyMe.ThreeHours 15 | } 16 | -------------------------------------------------------------------------------- /src/Evergreen/V78/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.Units exposing (..) 2 | 3 | 4 | type WorldPixel 5 | = WorldPixel Never 6 | 7 | 8 | type AsciiUnit 9 | = AsciiUnit Never 10 | 11 | 12 | type ScreenCoordinate 13 | = ScreenCoordinate Never 14 | 15 | 16 | type CellUnit 17 | = CellUnit Never 18 | 19 | 20 | type WorldCoordinate 21 | = WorldCoordinate Never 22 | -------------------------------------------------------------------------------- /src/Evergreen/V78/UrlHelper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.UrlHelper exposing (..) 2 | 3 | 4 | type UnsubscribeEmailKey 5 | = UnsubscribeEmailKey String 6 | 7 | 8 | type ConfirmEmailKey 9 | = ConfirmEmailKey String 10 | -------------------------------------------------------------------------------- /src/Evergreen/V78/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V78.User exposing (..) 2 | 3 | 4 | type UserId 5 | = UserId Int 6 | 7 | 8 | type alias RawUserId = 9 | Int 10 | -------------------------------------------------------------------------------- /src/Evergreen/V79/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.Ascii exposing (..) 2 | 3 | 4 | type Ascii 5 | = Ascii Int 6 | -------------------------------------------------------------------------------- /src/Evergreen/V79/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.Bounds exposing (..) 2 | 3 | import Evergreen.V79.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : Evergreen.V79.Helper.Coord unit 9 | , max : Evergreen.V79.Helper.Coord unit 10 | } 11 | -------------------------------------------------------------------------------- /src/Evergreen/V79/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.Cursor exposing (..) 2 | 3 | import Evergreen.V79.Helper 4 | import Evergreen.V79.Units 5 | import Quantity 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : Evergreen.V79.Helper.Coord Evergreen.V79.Units.AsciiUnit 11 | , startingColumn : Quantity.Quantity Int Evergreen.V79.Units.AsciiUnit 12 | , size : Evergreen.V79.Helper.Coord Evergreen.V79.Units.AsciiUnit 13 | } 14 | -------------------------------------------------------------------------------- /src/Evergreen/V79/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.Geometry.Types exposing (..) 2 | 3 | 4 | type Point2d units coordinates 5 | = Point2d 6 | { x : Float 7 | , y : Float 8 | } 9 | -------------------------------------------------------------------------------- /src/Evergreen/V79/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.Grid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V79.Ascii 5 | import Evergreen.V79.GridCell 6 | import Evergreen.V79.Helper 7 | import Evergreen.V79.Units 8 | import Evergreen.V79.User 9 | import List.Nonempty 10 | import Math.Vector2 11 | 12 | 13 | type alias LocalGridChange = 14 | { cellPosition : Evergreen.V79.Helper.Coord Evergreen.V79.Units.CellUnit 15 | , localPosition : Int 16 | , change : List.Nonempty.Nonempty Evergreen.V79.Ascii.Ascii 17 | } 18 | 19 | 20 | type alias GridChange = 21 | { cellPosition : Evergreen.V79.Helper.Coord Evergreen.V79.Units.CellUnit 22 | , localPosition : Int 23 | , change : List.Nonempty.Nonempty Evergreen.V79.Ascii.Ascii 24 | , userId : Evergreen.V79.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict ( Int, Int ) Evergreen.V79.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , quadPosition : Math.Vector2.Vec2 36 | , userId : Float 37 | } 38 | -------------------------------------------------------------------------------- /src/Evergreen/V79/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.GridCell exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V79.Ascii 5 | import Evergreen.V79.User 6 | import List.Nonempty 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : 12 | List 13 | { userId : Evergreen.V79.User.UserId 14 | , position : Int 15 | , line : List.Nonempty.Nonempty Evergreen.V79.Ascii.Ascii 16 | } 17 | , undoPoint : Dict.Dict Evergreen.V79.User.RawUserId Int 18 | } 19 | -------------------------------------------------------------------------------- /src/Evergreen/V79/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = 7 | ( Quantity.Quantity Int units, Quantity.Quantity Int units ) 8 | 9 | 10 | type alias RawCellCoord = 11 | ( Int, Int ) 12 | -------------------------------------------------------------------------------- /src/Evergreen/V79/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.LocalGrid exposing (..) 2 | 3 | import Dict 4 | import Evergreen.V79.Bounds 5 | import Evergreen.V79.Grid 6 | import Evergreen.V79.Helper 7 | import Evergreen.V79.Units 8 | import Evergreen.V79.User 9 | import EverySet 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V79.Grid.Grid 14 | , undoHistory : List (Dict.Dict Evergreen.V79.Helper.RawCellCoord Int) 15 | , redoHistory : List (Dict.Dict Evergreen.V79.Helper.RawCellCoord Int) 16 | , user : Evergreen.V79.User.UserId 17 | , hiddenUsers : EverySet.EverySet Evergreen.V79.User.UserId 18 | , adminHiddenUsers : EverySet.EverySet Evergreen.V79.User.UserId 19 | , viewBounds : Evergreen.V79.Bounds.Bounds Evergreen.V79.Units.CellUnit 20 | , undoCurrent : Dict.Dict Evergreen.V79.Helper.RawCellCoord Int 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ 26 | -------------------------------------------------------------------------------- /src/Evergreen/V79/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : List ( Time.Posix, msg ) 9 | , localModel : model 10 | , model : model 11 | } 12 | -------------------------------------------------------------------------------- /src/Evergreen/V79/NotifyMe.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.NotifyMe exposing (..) 2 | 3 | import EmailAddress 4 | 5 | 6 | type Status 7 | = Form 8 | | FormWithError 9 | | SendingToBackend 10 | | WaitingOnConfirmation 11 | 12 | 13 | type Frequency 14 | = Every3Hours 15 | | Every12Hours 16 | | Daily 17 | | Weekly 18 | | Monthly 19 | 20 | 21 | type alias InProgressModel = 22 | { status : Status 23 | , email : String 24 | , frequency : Maybe Frequency 25 | } 26 | 27 | 28 | type Model 29 | = InProgress InProgressModel 30 | | Completed 31 | | BackendError 32 | | Unsubscribing 33 | | Unsubscribed 34 | 35 | 36 | type ThreeHours 37 | = ThreeHours Never 38 | 39 | 40 | type alias Validated = 41 | { email : EmailAddress.EmailAddress 42 | , frequency : Frequency 43 | } 44 | -------------------------------------------------------------------------------- /src/Evergreen/V79/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.Point2d exposing (..) 2 | 3 | import Evergreen.V79.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = 7 | Evergreen.V79.Geometry.Types.Point2d units coordinates 8 | -------------------------------------------------------------------------------- /src/Evergreen/V79/RecentChanges.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.RecentChanges exposing (..) 2 | 3 | import AssocList 4 | import Dict 5 | import Evergreen.V79.GridCell 6 | import Evergreen.V79.Helper 7 | import Evergreen.V79.NotifyMe 8 | import Quantity 9 | 10 | 11 | type RecentChanges 12 | = RecentChanges 13 | { frequencies : AssocList.Dict Evergreen.V79.NotifyMe.Frequency (Dict.Dict Evergreen.V79.Helper.RawCellCoord Evergreen.V79.GridCell.Cell) 14 | , threeHoursElapsed : Quantity.Quantity Int Evergreen.V79.NotifyMe.ThreeHours 15 | } 16 | -------------------------------------------------------------------------------- /src/Evergreen/V79/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.Units exposing (..) 2 | 3 | 4 | type WorldPixel 5 | = WorldPixel Never 6 | 7 | 8 | type AsciiUnit 9 | = AsciiUnit Never 10 | 11 | 12 | type ScreenCoordinate 13 | = ScreenCoordinate Never 14 | 15 | 16 | type CellUnit 17 | = CellUnit Never 18 | 19 | 20 | type WorldCoordinate 21 | = WorldCoordinate Never 22 | -------------------------------------------------------------------------------- /src/Evergreen/V79/UrlHelper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.UrlHelper exposing (..) 2 | 3 | 4 | type UnsubscribeEmailKey 5 | = UnsubscribeEmailKey String 6 | 7 | 8 | type ConfirmEmailKey 9 | = ConfirmEmailKey String 10 | -------------------------------------------------------------------------------- /src/Evergreen/V79/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V79.User exposing (..) 2 | 3 | 4 | type UserId 5 | = UserId Int 6 | 7 | 8 | type alias RawUserId = 9 | Int 10 | -------------------------------------------------------------------------------- /src/Evergreen/V8/Ascii.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.Ascii exposing (..) 2 | 3 | type Ascii 4 | = Ascii Int -------------------------------------------------------------------------------- /src/Evergreen/V8/Bounds.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.Bounds exposing (..) 2 | 3 | import Evergreen.V8.Helper 4 | 5 | 6 | type Bounds unit 7 | = Bounds 8 | { min : (Evergreen.V8.Helper.Coord unit) 9 | , max : (Evergreen.V8.Helper.Coord unit) 10 | } -------------------------------------------------------------------------------- /src/Evergreen/V8/Change.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.Change exposing (..) 2 | 3 | import Evergreen.V8.Bounds 4 | import Dict 5 | import Evergreen.V8.Grid 6 | import Evergreen.V8.GridCell 7 | import Evergreen.V8.Helper 8 | import Evergreen.V8.Units 9 | import Evergreen.V8.User 10 | 11 | 12 | type LocalChange 13 | = LocalGridChange Evergreen.V8.Grid.LocalChange 14 | | LocalUndo 15 | | LocalRedo 16 | | LocalAddUndo 17 | | LocalToggleUserVisibility Evergreen.V8.User.UserId 18 | 19 | 20 | type ServerChange 21 | = ServerGridChange Evergreen.V8.Grid.Change 22 | | ServerUndoPoint 23 | { userId : Evergreen.V8.User.UserId 24 | , undoPoints : (Dict.Dict Evergreen.V8.Helper.RawCellCoord Int) 25 | } 26 | | ServerUserNew (Evergreen.V8.User.UserId, Evergreen.V8.User.UserData) 27 | 28 | 29 | type ClientChange 30 | = ViewBoundsChange (Evergreen.V8.Bounds.Bounds Evergreen.V8.Units.CellUnit) (List ((Evergreen.V8.Helper.Coord Evergreen.V8.Units.CellUnit), Evergreen.V8.GridCell.Cell)) 31 | 32 | 33 | type Change 34 | = LocalChange LocalChange 35 | | ServerChange ServerChange 36 | | ClientChange ClientChange -------------------------------------------------------------------------------- /src/Evergreen/V8/ColorIndex.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.ColorIndex exposing (..) 2 | 3 | type ColorIndex 4 | = Green 5 | | Teal 6 | | Blue 7 | | Purple 8 | | Magenta 9 | | Salmon 10 | | Orange 11 | | Yellow 12 | | Gray -------------------------------------------------------------------------------- /src/Evergreen/V8/Cursor.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.Cursor exposing (..) 2 | 3 | import Evergreen.V8.Helper 4 | import Quantity 5 | import Evergreen.V8.Units 6 | 7 | 8 | type Cursor 9 | = Cursor 10 | { position : (Evergreen.V8.Helper.Coord Evergreen.V8.Units.AsciiUnit) 11 | , startingColumn : (Quantity.Quantity Int Evergreen.V8.Units.AsciiUnit) 12 | , size : (Evergreen.V8.Helper.Coord Evergreen.V8.Units.AsciiUnit) 13 | } -------------------------------------------------------------------------------- /src/Evergreen/V8/Geometry/Types.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.Geometry.Types exposing (..) 2 | 3 | type Point2d units coordinates 4 | = Point2d 5 | { x : Float 6 | , y : Float 7 | } -------------------------------------------------------------------------------- /src/Evergreen/V8/Grid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.Grid exposing (..) 2 | 3 | import Evergreen.V8.Ascii 4 | import Dict 5 | import Evergreen.V8.GridCell 6 | import Evergreen.V8.Helper 7 | import List.Nonempty 8 | import Math.Vector2 9 | import Evergreen.V8.Units 10 | import Evergreen.V8.User 11 | 12 | 13 | type alias LocalChange = 14 | { cellPosition : (Evergreen.V8.Helper.Coord Evergreen.V8.Units.CellUnit) 15 | , localPosition : Int 16 | , change : (List.Nonempty.Nonempty Evergreen.V8.Ascii.Ascii) 17 | } 18 | 19 | 20 | type alias Change = 21 | { cellPosition : (Evergreen.V8.Helper.Coord Evergreen.V8.Units.CellUnit) 22 | , localPosition : Int 23 | , change : (List.Nonempty.Nonempty Evergreen.V8.Ascii.Ascii) 24 | , userId : Evergreen.V8.User.UserId 25 | } 26 | 27 | 28 | type Grid 29 | = Grid (Dict.Dict (Int, Int) Evergreen.V8.GridCell.Cell) 30 | 31 | 32 | type alias Vertex = 33 | { position : Math.Vector2.Vec2 34 | , texturePosition : Math.Vector2.Vec2 35 | , userId : Float 36 | } -------------------------------------------------------------------------------- /src/Evergreen/V8/GridCell.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.GridCell exposing (..) 2 | 3 | import Evergreen.V8.Ascii 4 | import Dict 5 | import List.Nonempty 6 | import Evergreen.V8.User 7 | 8 | 9 | type Cell 10 | = Cell 11 | { history : (List 12 | { userId : Evergreen.V8.User.UserId 13 | , position : Int 14 | , line : (List.Nonempty.Nonempty Evergreen.V8.Ascii.Ascii) 15 | }) 16 | , undoPoint : (Dict.Dict Evergreen.V8.User.RawUserId Int) 17 | } -------------------------------------------------------------------------------- /src/Evergreen/V8/Helper.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.Helper exposing (..) 2 | 3 | import Quantity 4 | 5 | 6 | type alias Coord units = ((Quantity.Quantity Int units), (Quantity.Quantity Int units)) 7 | 8 | 9 | type alias RawCellCoord = (Int, Int) -------------------------------------------------------------------------------- /src/Evergreen/V8/LocalGrid.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.LocalGrid exposing (..) 2 | 3 | import Evergreen.V8.Bounds 4 | import Dict 5 | import EverySet 6 | import Evergreen.V8.Grid 7 | import Evergreen.V8.Helper 8 | import Evergreen.V8.Units 9 | import Evergreen.V8.User 10 | 11 | 12 | type alias LocalGrid_ = 13 | { grid : Evergreen.V8.Grid.Grid 14 | , undoHistory : (List (Dict.Dict Evergreen.V8.Helper.RawCellCoord Int)) 15 | , redoHistory : (List (Dict.Dict Evergreen.V8.Helper.RawCellCoord Int)) 16 | , user : (Evergreen.V8.User.UserId, Evergreen.V8.User.UserData) 17 | , otherUsers : (List (Evergreen.V8.User.UserId, Evergreen.V8.User.UserData)) 18 | , hiddenUsers : (EverySet.EverySet Evergreen.V8.User.UserId) 19 | , viewBounds : (Evergreen.V8.Bounds.Bounds Evergreen.V8.Units.CellUnit) 20 | , undoCurrent : (Dict.Dict Evergreen.V8.Helper.RawCellCoord Int) 21 | } 22 | 23 | 24 | type LocalGrid 25 | = LocalGrid LocalGrid_ -------------------------------------------------------------------------------- /src/Evergreen/V8/LocalModel.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.LocalModel exposing (..) 2 | 3 | import Time 4 | 5 | 6 | type LocalModel msg model 7 | = LocalModel 8 | { localMsgs : (List (Time.Posix, msg)) 9 | , localModel : model 10 | , model : model 11 | } -------------------------------------------------------------------------------- /src/Evergreen/V8/Point2d.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.Point2d exposing (..) 2 | 3 | import Evergreen.V8.Geometry.Types 4 | 5 | 6 | type alias Point2d units coordinates = (Evergreen.V8.Geometry.Types.Point2d units coordinates) -------------------------------------------------------------------------------- /src/Evergreen/V8/Units.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.Units exposing (..) 2 | 3 | type WorldPixel 4 | = WorldPixel Never 5 | 6 | 7 | type CellUnit 8 | = CellUnit Never 9 | 10 | 11 | type WorldCoordinate 12 | = WorldCoordinate Never 13 | 14 | 15 | type AsciiUnit 16 | = AsciiUnit Never 17 | 18 | 19 | type ScreenCoordinate 20 | = ScreenCoordinate Never -------------------------------------------------------------------------------- /src/Evergreen/V8/User.elm: -------------------------------------------------------------------------------- 1 | module Evergreen.V8.User exposing (..) 2 | 3 | import Evergreen.V8.ColorIndex 4 | 5 | 6 | type UserId 7 | = UserId Int 8 | 9 | 10 | type UserData 11 | = User 12 | { color : Evergreen.V8.ColorIndex.ColorIndex 13 | } 14 | 15 | 16 | type alias RawUserId = Int -------------------------------------------------------------------------------- /src/Icons.elm: -------------------------------------------------------------------------------- 1 | module Icons exposing (dragTool, highlightTool) 2 | 3 | import Element exposing (Element) 4 | import Svg 5 | import Svg.Attributes exposing (..) 6 | 7 | 8 | dragTool : Element msg 9 | dragTool = 10 | Svg.svg 11 | [ viewBox "0 0 200 200", height "22" ] 12 | [ Svg.path 13 | [ d 14 | "m100 1.2c3.08 0 34.09 41.2 38 48.8h-25v37h37v-25s48.8 34.64 48.8 37.95c0 3.07-48.8 38.05-48.8 38.05v-25h-37v37h25s-34.77 48.8-37.95 48.8c-3.14 0-38.05-48.8-38.05-48.8h25v-37h-36v27c-5.61-2.18-49.8-34.94-49.8-38s44.19-35.82 49.8-38v23h36v-37h-25s34.94-48.8 38-48.8z" 15 | ] 16 | [] 17 | ] 18 | |> Element.html 19 | 20 | 21 | highlightTool : Element msg 22 | highlightTool = 23 | Svg.svg [ viewBox "100 100 450 450", width "24" ] 24 | [ Svg.path [ d "M75.8 115.55h290.95V252H75.8V115.55z", fill "#fe5555" ] [] 25 | , Svg.path [ d "M174.53 252h290.94v136.45H174.53V252z", fill "#73449e" ] [] 26 | , Svg.path [ d "M75.8 388.45H564.2v136H75.8v-136z", fill "#09dc95" ] [] 27 | ] 28 | |> Element.html 29 | -------------------------------------------------------------------------------- /src/UiColors.elm: -------------------------------------------------------------------------------- 1 | module UiColors exposing (adminText, background, border, button, buttonActive, colorSquareBorder, error, text, warning) 2 | 3 | import Element 4 | 5 | 6 | background : Element.Color 7 | background = 8 | Element.rgb255 235 230 230 9 | 10 | 11 | border : Element.Color 12 | border = 13 | Element.rgb255 50 50 55 14 | 15 | 16 | colorSquareBorder : Element.Color 17 | colorSquareBorder = 18 | Element.rgba 0 0 0 0.2 19 | 20 | 21 | buttonActive : Element.Color 22 | buttonActive = 23 | Element.rgb255 240 240 240 24 | 25 | 26 | button : Element.Color 27 | button = 28 | Element.rgb255 190 180 170 29 | 30 | 31 | text : Element.Color 32 | text = 33 | Element.rgb255 0 0 0 34 | 35 | 36 | adminText : Element.Color 37 | adminText = 38 | Element.rgb255 255 0 0 39 | 40 | 41 | warning : Element.Color 42 | warning = 43 | Element.rgb255 255 210 212 44 | 45 | 46 | error : Element.Color 47 | error = 48 | Element.rgb255 200 0 0 49 | -------------------------------------------------------------------------------- /src/User.elm: -------------------------------------------------------------------------------- 1 | module User exposing (RawUserId, UserId(..), rawId, userId) 2 | 3 | 4 | type UserId 5 | = UserId Int 6 | 7 | 8 | type alias RawUserId = 9 | Int 10 | 11 | 12 | userId : Int -> UserId 13 | userId index = 14 | UserId index 15 | 16 | 17 | rawId : UserId -> Int 18 | rawId (UserId userId_) = 19 | userId_ 20 | -------------------------------------------------------------------------------- /tools/ColorGenerator.elm: -------------------------------------------------------------------------------- 1 | module ColorGenerator exposing (..) 2 | 3 | import Element 4 | import Element.Background 5 | import Shaders 6 | import User 7 | 8 | 9 | main = 10 | Element.layout [] colors 11 | 12 | 13 | colors = 14 | List.range 0 1000 15 | |> List.map 16 | (\userId -> 17 | Element.row 18 | [] 19 | [ Element.el 20 | [ Element.Background.color <| 21 | Shaders.userColor False <| 22 | User.userId userId 23 | , Element.width <| Element.px 100 24 | ] 25 | (Element.text (String.fromInt userId)) 26 | , Element.el 27 | [ Element.Background.color <| 28 | Shaders.userColor True <| 29 | User.userId userId 30 | , Element.width <| Element.px 100 31 | ] 32 | (Element.text "highlight") 33 | ] 34 | ) 35 | |> Element.column [] 36 | -------------------------------------------------------------------------------- /tools/Main.elm: -------------------------------------------------------------------------------- 1 | module Main exposing (..) 2 | 3 | import Ascii 4 | import Element 5 | import Element.Font 6 | import Html exposing (Html) 7 | import Html.Attributes 8 | import List.Extra as List 9 | 10 | 11 | main : Html msg 12 | main = 13 | Element.layout 14 | [ Element.Font.family [ Element.Font.monospace ], Element.Font.size 16, Element.moveDown 3 ] 15 | (Ascii.asciiChars 16 | |> List.greedyGroupsOf 25 17 | |> List.map 18 | (List.map 19 | (String.fromChar 20 | >> Element.text 21 | >> Element.el [ Element.width (Element.px 10), Element.height (Element.px 16) ] 22 | ) 23 | >> Element.row [] 24 | ) 25 | |> Element.column [ Element.spacing 2, Element.htmlAttribute <| Html.Attributes.style "white-space" "pre" ] 26 | ) 27 | --------------------------------------------------------------------------------