diff --git a/src/Clipboard.elm b/src/Clipboard.elm deleted file mode 100644 index 5097b8c..0000000 --- a/src/Clipboard.elm +++ /dev/null @@ -1,4 +0,0 @@ -port module Clipboard exposing (copyToClipboard) - - -port copyToClipboard : String -> Cmd msg diff --git a/src/Main.elm b/src/Main.elm index eb46284..f214969 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -5,14 +5,11 @@ import Array import Browser import Browser.Events as Events import Camera3d -import Clipboard exposing (copyToClipboard) import Color import Direction3d import Element exposing (..) import Element.Background as Background -import Element.Border as Border import Element.Font as Font -import Element.Input exposing (button) import Html exposing (Html) import Http import Length @@ -86,6 +83,17 @@ init flags = ( { w = width, h = height, mesh = Nothing, textures = Nothing, angle = 0 }, Cmd.batch [ getMesh, getTexture ] ) + +-- type alias Object3d = +-- TriangularMesh +-- { position : Point3d Length.Meters Obj.Decode.ObjCoordinates +-- , normal : Vector3d Quantity.Unitless Obj.Decode.ObjCoordinates +-- , uv : ( Float, Float ) +-- } +-- type alias Object3d = +-- TriangularMesh (Point3d Length.Meters Obj.Decode.ObjCoordinates) + + type alias Object3d = TriangularMesh { position : Point3d Length.Meters Obj.Decode.ObjCoordinates, uv : ( Float, Float ) } @@ -95,7 +103,6 @@ type Msg | GotMesh (Result Http.Error Object3d) | GotTexture (Result WebGL.Texture.Error (Material.Texture Color.Color)) | Rotate Time.Posix - | Copy String update : Msg -> Model -> ( Model, Cmd Msg ) @@ -136,9 +143,6 @@ update msg model = Rotate time -> wrap { model | angle = model.angle + 2 * (2 + sin (toFloat (Time.posixToMillis time) / 1000)) } - Copy text -> - ( model, copyToClipboard text ) - subscribe : Model -> Sub Msg subscribe _ = @@ -163,39 +167,6 @@ vh model percent = Basics.toFloat model.h * percent / 100 -white : Color -white = - rgb 255 255 255 - - -black : Color -black = - rgb 0 0 0 - - -btnStyle : List (Attribute msg) -btnStyle = - [ padding 10 - , Font.color (rgb255 255 255 255) - , Font.family [ Font.typeface "Rubik" ] - , Font.semiBold - , Font.size 20 - , Border.width 2 - , Border.color white - , mouseOver [ Background.color white, Font.color black ] - ] - - -linkBtn : String -> String -> Element msg -linkBtn disp addr = - newTabLink btnStyle { url = addr, label = text (String.toUpper disp) } - - -btn : String -> Msg -> Element Msg -btn disp act = - button btnStyle { onPress = Just act, label = text (String.toUpper disp) } - - view : Model -> Browser.Document Msg view model = { title = "MacGregor House" @@ -239,19 +210,7 @@ view model = , Font.family [ Font.typeface "Imbue" ] , Font.size 96 ] - (column - [ spacing 20 - ] - [ text "MacGregor House" - , row - [ spacing 20 - ] - [ linkBtn "Events" "https://calendar.google.com/calendar/embed?src=c_c9fb13003264d5becb74cf9ba42a087d8a4a180d927441994458a07ac146eb88%40group.calendar.google.com&ctz=America%2FNew_York" - , linkBtn "Space" "https://forms.gle/KxFAG65TQuPxdYak8" - , btn "iCal" (Copy "https://calendar.google.com/calendar/ical/c_c9fb13003264d5becb74cf9ba42a087d8a4a180d927441994458a07ac146eb88%40group.calendar.google.com/public/basic.ics") - ] - ] - ) + (text "MacGregor House") , el [ alignRight , alignTop diff --git a/src/index.html b/src/index.html index 07b678a..86fe716 100644 --- a/src/index.html +++ b/src/index.html @@ -6,7 +6,7 @@ @@ -18,15 +18,6 @@ node: document.getElementById("app"), flags: [window.innerWidth, window.innerHeight], }); - - app.ports.copyToClipboard.subscribe((text) => { - var textArea = document.createElement("textarea"); - textArea.value = text; - document.body.appendChild(textArea); - textArea.select(); - document.execCommand("copy"); - document.body.removeChild(textArea); - });