Compare commits

..

No commits in common. "main" and "1.0.0" have entirely different histories.
main ... 1.0.0

7 changed files with 47 additions and 76 deletions

2
.gitignore vendored
View file

@ -16,5 +16,3 @@ result-*
# ---> Project
# Ignore compiled elm files
compiled
# Ignore hosting-specific files
/index.html

View file

@ -1 +1 @@
/nix/store/4wj49hvsmkannf285i53qczyjggvly5w-pre-commit-config.json
/nix/store/i4wcn83p1273vgv0nggpdbjqppq33aj7-pre-commit-config.json

View file

@ -2,19 +2,4 @@
The all-new (very experimental) MacGregor House website
## Building
To build, run
`nix build .`
For live preview, run
`bash watch.sh` and
`nix run nixpkgs#live-server`
then navigate to the `src` directory.
## Models
![A 3D model of MacGregor House](./assets/img/macg.png)

View file

@ -88,11 +88,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1740274080,
"narHash": "sha256-tDNZc/PVt9z2m7i5PKuYJ9Ii60A2oNrtl6qTeqqmoJc=",
"lastModified": 1739064336,
"narHash": "sha256-LTZznyurm9WWchG3uPH+8Sf5hkzZyHoa9FvDW0cLk0M=",
"owner": "jeslie0",
"repo": "mkElmDerivation",
"rev": "93c08ae888748f71873539bebcae981cf72f3f44",
"rev": "2d5f1acc6da7e6d5deeff5c9f47729a671ab8f9a",
"type": "github"
},
"original": {
@ -119,11 +119,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1740695751,
"narHash": "sha256-D+R+kFxy1KsheiIzkkx/6L63wEHBYX21OIwlFV8JvDs=",
"lastModified": 1739446958,
"narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6313551cd05425cd5b3e63fe47dbc324eabb15e4",
"rev": "2ff53fe64443980e139eaa286017f53f88336dd0",
"type": "github"
},
"original": {

View file

@ -48,10 +48,8 @@
elm make src/Main.elm --output Main.js --optimize
'';
installPhase = ''
mkdir -p $out/dist/elm
cp Main.js $out/dist/elm
sed 's/..compiled\/Main.js/\/elm\/Main.js/' src/index.html > $out/dist/index.html
cp -r assets $out/dist/assets
mkdir $out
cp Main.js $out
'';
};
};
@ -72,6 +70,7 @@
nil.enable = true;
statix.enable = true;
markdownlint.enable = true;
mdsh.enable = true;
typos.enable = true;
check-merge-conflicts.enable = true;
commitizen.enable = true;

View file

@ -82,7 +82,6 @@ type alias Model =
, h : Int
, last : String
, url : Url.Url
, path : String
, key : Nav.Key
, mesh : Maybe Object3d
, textures : Maybe (Material.Textured Obj.Decode.ObjCoordinates)
@ -96,20 +95,19 @@ type alias Model =
type alias Flags =
( Int, Int, String )
( Int, Int )
init : Flags -> Url.Url -> Nav.Key -> ( Model, Cmd Msg )
init flags url key =
let
( width, height, path ) =
( width, height ) =
flags
in
( { w = width
, h = height
, last = ""
, url = url
, path = path
, key = key
, mesh = Nothing
, textures = Nothing
@ -397,7 +395,7 @@ bodyText =
[ Font.color white
, Font.family [ Font.typeface "Inter" ]
, Font.size 20
, width (px 500)
, width (px 600)
]
@ -461,12 +459,12 @@ id =
Html.Attributes.id >> Element.htmlAttribute
getPaths : String -> String -> List String
getPaths path base =
getPaths : String -> List String
getPaths base =
let
root : String
root =
path ++ base
"/" ++ base
in
List.map ((++) root) [ "", "/", "/index.html" ]
@ -486,18 +484,13 @@ itemize multikeys entry =
[]
sitemap : Model -> Dict String (Model -> List (Html Msg))
sitemap model =
let
getter : String -> List String
getter =
getPaths model.path
in
sitemap : Dict String (Model -> List (Html Msg))
sitemap =
Dict.fromList
(itemize ([ "/", "/index.html", model.path ] ++ getter "src" ++ getter "index" ++ getter "home") pageHome
++ itemize (getter "entries") pageEntries
++ itemize (getter "about") pageAbout
++ itemize (getter "colophon") colophon
(itemize ([ "/", "/index.html" ] ++ getPaths "src" ++ getPaths "index" ++ getPaths "home") pageHome
++ itemize (getPaths "entries") pageEntries
++ itemize (getPaths "about") pageAbout
++ itemize (getPaths "colophon") colophon
)
@ -506,7 +499,7 @@ loadUrl model =
let
req : Maybe (Model -> List (Html Msg))
req =
Dict.get model.url.path (sitemap model)
Dict.get model.url.path sitemap
in
case req of
Just builder ->
@ -540,9 +533,9 @@ menu model =
, Font.size 18
]
(row [ spacing 20 ]
[ inlineLinkInt "Entries" (model.path ++ "entries")
, inlineLinkInt "Access" (model.path ++ "about")
, inlineLinkInt "Colophon" (model.path ++ "colophon")
[ inlineLinkInt "Entries" "/entries"
, inlineLinkInt "Access" "/about"
, inlineLinkInt "Colophon" "/colophon"
]
)
@ -789,7 +782,7 @@ pageAbout model =
, column [ spacing 15 ]
[ row
[ spacing 15 ]
[ linkBtnInt " Back" model.path
[ linkBtnInt " Back" "/"
, btn "Directions" (Scroll "one")
]
, row [ spacing 15 ]
@ -816,7 +809,7 @@ pageAbout model =
, column
(page model ++ [ id "one" ])
[ image (fullImage model)
{ src = model.path ++ "../assets/img/map.png"
{ src = "../assets/img/map.png"
, description = "mit campus map with pin at macgregor house"
}
, column (pageText model)
@ -947,7 +940,7 @@ pageEntries model =
[ entryLink "A entry" "A"
, text ", "
, entryLink "Bentry" "B"
, text ", "
, text " (Office of the President), "
, entryLink "Centry" "C"
, text " (the C is silent), "
, entryLink "Dentry" "D"
@ -967,7 +960,7 @@ pageEntries model =
[ row
[ spacing 15
]
[ linkBtnInt " Back" model.path
[ linkBtnInt " Back" "/"
, btn "Explore " (ScrollToEntry "J")
]
]
@ -1005,7 +998,7 @@ pageEntries model =
, image [ width (px 80), padding 12 ] { description = "flag of j entry", src = "../assets/img/jentry.png" }
]
, paragraph (bodyText ++ [ Font.size 32 ])
[ text "(J Entry) The heart of MacGregor. Historic culture, big lore. Jentry memes. J is for Jamily. We're an eclectic community, filled with everyone from introverts to extroverts, crazy vibes, chill vibes, and everything in between."
[ text "(J Entry) The heart of MacGregor. Historic culture, big lore. Jentry memes. Greatest MacGregor Housecomm representation of any entry. Jamily is forever."
]
]
, el
@ -1038,7 +1031,7 @@ pageEntries model =
subheading
[ text "Welcome to A Entry." ]
, paragraph (bodyText ++ [ Font.size 32 ])
[ text "Top floor. Top dog. Alpha wolf. Unity and strength. Positive, above average."
[ text "Top floor. Top dog. Lots of dogs, in fact. Historic MacGregor cultural epicenter."
]
]
, el
@ -1071,7 +1064,7 @@ pageEntries model =
subheading
[ text "Welcome to Bentry." ]
, paragraph (bodyText ++ [ Font.size 32 ])
[ text "(B Entry) Bentry is loud and fun and very social. We like to hang out with each other and check in, catch up, and go out. We banter a lot too but we are always there for each other. Were a family for sure."
[ text "(B Entry) Office of the President. Sweeping views. Crossroads of the High Rise. B is for burgers?"
]
]
, el
@ -1104,7 +1097,7 @@ pageEntries model =
subheading
[ text "Welcome to Centry." ]
, paragraph (bodyText ++ [ Font.size 32 ])
[ text "(C Entry) Chill. Calmer. Sloths."
[ text "(C Entry) Ceriously quiet. High enough to see the clouds, but low enough to stay grounded. MacGregor's creative capital core."
]
]
, el
@ -1127,7 +1120,7 @@ pageEntries model =
)
]
, column
(page model ++ [ id "D", Background.color (rgb255 40 140 240) ])
(page model ++ [ id "D", Background.color (rgb255 240 140 40) ])
[ column (pageText model)
[ row [ spacing 10 ]
[ btn "" (ScrollToEntry "C")
@ -1137,7 +1130,7 @@ pageEntries model =
subheading
[ text "Welcome to Dentry." ]
, paragraph (bodyText ++ [ Font.size 32 ])
[ text "(D Entry) D is for doing. Whether we stay in or go out (mostly go out), we have fun! D is also for degenerate. We are up the latest of all entries."
[ text "(D Entry) Office of the Vice President. Active after dark. Diligently working until dusk. The culture is palpable."
]
]
, el
@ -1160,7 +1153,7 @@ pageEntries model =
)
]
, column
(page model ++ [ id "E", Background.color (rgb255 221 162 126) ])
(page model ++ [ id "E", Background.color (rgb255 40 20 30) ])
[ column (pageText model)
[ row [ spacing 10 ]
[ btn "" (ScrollToEntry "D")
@ -1170,7 +1163,7 @@ pageEntries model =
subheading
[ text "Welcome to E entry." ]
, paragraph (bodyText ++ [ Font.size 32 ])
[ text "We're a really cozy and friendly entry! We love having baking/cooking nights, watching movies, playing games, and just hanging out to chat. We also go out for dinners occasionally!"
[ text "Board games over Briggs field. Excellence in everything. End of story."
]
]
, el
@ -1193,7 +1186,7 @@ pageEntries model =
)
]
, column
(page model ++ [ id "F", Background.color (rgb255 200 125 150) ])
(page model ++ [ id "F", Background.color (rgb255 200 50 75) ])
[ column (pageText model)
[ row [ spacing 10 ]
[ btn "" (ScrollToEntry "E")
@ -1203,7 +1196,7 @@ pageEntries model =
subheading
[ text "Welcome to the Fentry." ]
, paragraph (bodyText ++ [ Font.size 32 ])
[ text "(F entry) Typical nights for us look like playing poker, watching a movie, or just chilling and doing homework."
[ text "(F entry) F is for Food. F is for Feast. F is for First (low rise block). F is Forever."
]
]
, el
@ -1226,7 +1219,7 @@ pageEntries model =
)
]
, column
(page model ++ [ id "G", Background.color (rgb255 250 150 50) ])
(page model ++ [ id "G", Background.color (rgb255 200 50 150) ])
[ column (pageText model)
[ row [ spacing 10 ]
[ btn "" (ScrollToEntry "F")
@ -1236,7 +1229,7 @@ pageEntries model =
subheading
[ text "Welcome to the Gentry." ]
, paragraph (bodyText ++ [ Font.size 32 ])
[ text "(G entry) Chill but welcoming. The G in Gentry stands for Goofy, Gamers, and Good Times."
[ text "(G entry) G is for Greatness. Spans the Charles. Overlooks Fenway. Good things start in Gentry."
]
]
, el
@ -1259,7 +1252,7 @@ pageEntries model =
)
]
, column
(page model ++ [ id "H", Background.color (rgb255 50 175 50) ])
(page model ++ [ id "H", Background.color (rgb255 200 150 50) ])
[ column (pageText model)
[ row [ spacing 10 ]
[ btn "" (ScrollToEntry "G")
@ -1269,7 +1262,7 @@ pageEntries model =
subheading
[ text "Welcome to the Hentry." ]
, paragraph (bodyText ++ [ Font.size 32 ])
[ text "(H entry) Where the walls are hexagonal (not really), the vibes are chaotic-good, and the only thing more structured than our beehive of activity is our legendary group chats."
[ text "(H entry) Lots of chickens. Crossroads of the Low Rise. Largest entry in MacGregor."
]
]
, el
@ -1348,7 +1341,7 @@ notFound model =
[ text "You were likely redirected here by a link to a page on the old website, the last known archive of which can be found "
, inlineLink "here" "https://web.archive.org/web/20170529064230/http://macgregor.mit.edu/"
, text ". Unless you want to conduct research on ancient MIT traditions, you can probably find what you're looking for on the new "
, inlineLinkInt "main page" (model.path ++ "/src")
, inlineLinkInt "main page" "/src"
, text ". If you believe this page really is missing, "
, inlineLink "contact the webmaster" "mailto:ananthv@mit.edu"
, text "."
@ -1422,7 +1415,7 @@ colophon model =
]
[ text "Colophon."
, row [ spacing 15 ]
[ linkBtnInt " Back" model.path
[ linkBtnInt " Back" "/"
, linkBtn "Source" "https://forgejo.mit.edu/ananthv/macgregor"
, btn "Literature" (Scroll "one")
]

View file

@ -16,11 +16,7 @@
<script>
var app = Elm.Main.init({
node: document.getElementById("app"),
flags: [
window.innerWidth,
window.innerHeight,
window.location.pathname,
],
flags: [window.innerWidth, window.innerHeight],
});
app.ports.copyToClipboard.subscribe((tuple) => {