From e39bc2c559e6f45c1c71a14f4bf40e8e0f7039d4 Mon Sep 17 00:00:00 2001 From: PenguinRobert1 <152218269+PenguinRobert1@users.noreply.github.com> Date: Fri, 9 Feb 2024 17:59:02 +0000 Subject: [PATCH] 1 --- roberts games/ClusterTruckProject-master.zip | Bin 5329 -> 0 bytes .../ClusterTruckProject-master/.firebaserc | 5 + .../ClusterTruckProject-master/firebase.json | 10 ++ .../public/404.html | 33 +++++++ .../public/README.md | 2 + .../public/index.html | 46 +++++++++ .../public/markers.js | 91 ++++++++++++++++++ .../public/styles.css | 77 +++++++++++++++ 8 files changed, 264 insertions(+) delete mode 100644 roberts games/ClusterTruckProject-master.zip create mode 100644 roberts games/ClusterTruckProject-master/ClusterTruckProject-master/.firebaserc create mode 100644 roberts games/ClusterTruckProject-master/ClusterTruckProject-master/firebase.json create mode 100644 roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/404.html create mode 100644 roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/README.md create mode 100644 roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/index.html create mode 100644 roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/markers.js create mode 100644 roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/styles.css diff --git a/roberts games/ClusterTruckProject-master.zip b/roberts games/ClusterTruckProject-master.zip deleted file mode 100644 index 91cff93b6cc49a0638144bc4b5b5c6715b920f5f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5329 zcma)AbzGC}8XhemAt@y-&FK6_cXu~#Qlmx+NTXxaKtMXAQ@TMwhJ+GQihz`o0*bV7 z@OaMWPd|^xXM48&_Q!Qy@BMq9>%H$wM;!wb5AbzGhI_03`^SGiXaKkXc^7Y(7ueIl z)7#!z$J5OTZ12Sbwf*`R(9i%2fR_H0%uMG$2v`1%AONW46uv|dyWBT_kH8CY^aR`4 z!oZ&Pe}k33)6>!6WFH(+)8yqas?{sO{us){QR)aU6law|D{LQ}sGVp}w6lbLD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D#A|0?zUdI_CK}pxbxAdU zWo2h|4j+8UzSkHoX+}gkfKGXE!Eq$b&FKzI2-!It&OY4?>OavjdUv<4PpC(ZEIgg+ z8M;_^-MWBkL4&d}wu6R;mnm71_=!O&m6x0m`O35SigN87H&Ygq#5Xq`;@#k-TgcJ! zC@?oF7-EH}-G4Jn6hcyMD2!l|A1YAy3s^<0@7jaxGdfo}Kz; zzB)8}F}G>Kw>NeNxU`wiS{UZ9H%&|M7G$^3M)mf75b%~TJsLaSzq-?ZtQllqqgSQ1 z>fRrMw#DOY!YG@7RA!T+!KM*ABkI-iSWKdraff2{-k-8&+?evZpD4!)8^++a+8hql zl@N{v+RU6RL%l}Br?G3syF37R9A?WHpIyr+C(Df}u)3lJH2mnZ(_*@BtI4SJPEcA7 zZL5$?MXcz= z$ni!>JFf(D?xNtfxAj_&>>|*c_Wfa_{Gwv*(sFfXR(_B-$NXk+1FF0F5*Mz#{KEd} zMu}{zkaR7q%^ckLhTW*e{uFww#{MLmJN-k=uNBv%t@O`is~z85%NMP9f_xOyxyMST5_OS2P9jV{#y39b_amtmDU)H8)(T6mH zX3ds$>3oiPK9fs=3iC*6+~}g@gWFH*#s=Eh%x8$YnIM@6wgm0Z%l*E*HrtAQ<~-q` z9+i?o;j?ED=ERy@G2_y@Of11JE1={W6{1u1@~q?5paYnpT4<`eZHsHj2)Tw;=?GvSD24zve5Zfebgm6y)gZEzQx5)u(r-s%Tezt51;r!1Qnm>oMVE zMK&8^ZbF-eT0+nUvi4!KfO;c zYsYe-cG(?ed*VEcDI^O|tg>Pa^&^CzYl(L?1;Xzno(C5til6Q7JB2*apHTe5{B+c@u)o6K zUcU4%hf|qrUxPe;F#%g!Aut#sBrFaVvlp<12-@Bf=Cc(L2aEH8MMOj)cH#oILSp{{ DFcQ%t diff --git a/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/.firebaserc b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/.firebaserc new file mode 100644 index 00000000..4c0b5252 --- /dev/null +++ b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "nyevents-77bd9" + } +} diff --git a/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/firebase.json b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/firebase.json new file mode 100644 index 00000000..e7829392 --- /dev/null +++ b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/firebase.json @@ -0,0 +1,10 @@ +{ + "hosting": { + "public": "public", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ] + } +} diff --git a/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/404.html b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/404.html new file mode 100644 index 00000000..829eda8f --- /dev/null +++ b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/404.html @@ -0,0 +1,33 @@ + + + + + + Page Not Found + + + + +
+

404

+

Page Not Found

+

The specified file was not found on this website. Please check the URL for mistakes and try again.

+

Why am I seeing this?

+

This page was generated by the Firebase Command-Line Interface. To modify it, edit the 404.html file in your project's configured public directory.

+
+ + diff --git a/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/README.md b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/README.md new file mode 100644 index 00000000..a638ee02 --- /dev/null +++ b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/README.md @@ -0,0 +1,2 @@ +# ClusterTruckProject +Single page web app created as part of the ClusterTruck interview process diff --git a/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/index.html b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/index.html new file mode 100644 index 00000000..86b951ae --- /dev/null +++ b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/index.html @@ -0,0 +1,46 @@ + + + + + + + Document + + + + + + + + + +
+
+

ClusterTruck Take Home Problem

+

Created by: Logan Schiessle

+
+
+ +
+ None
+ 0
+ 1
+
+
+
+
+ + \ No newline at end of file diff --git a/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/markers.js b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/markers.js new file mode 100644 index 00000000..913280f3 --- /dev/null +++ b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/markers.js @@ -0,0 +1,91 @@ +var map; +var facetChoice; +var facetChosen = 0; +var sw; +var ne; + + +//Runs when the page is loaded, in order to create a google map with the center in New York City. +function initMap() { + var newYorkCityLatLong = new google.maps.LatLng(40.7128, -74.0059); + map = new google.maps.Map(document.getElementById('map'), { + center: newYorkCityLatLong, + zoom: 9, + }); + + //this listener works, but I am having a very hard time getting the NY Times api to work the way it is supposed to when using the sw, + //and ne parameters. When those are supplied it is supposed to keep the results to those within the box created by those two points, + //but it doesn't work, not here or in their console. A different way to do this would be to manually check if every point is within the + //parameters. + google.maps.event.addListener(map, 'bounds_changed', function() { + var bounds = map.getBounds(); + sw = bounds.getSouthWest(); + ne = bounds.getNorthEast(); + swLat = sw.lat().toFixed(5); + swLng = sw.lng().toFixed(5); + neLat = ne.lat().toFixed(5); + neLng = ne.lng().toFixed(5); + loadMarkers(); + }); +} + +//Queries the NY Times Geographic API and takes the results and creates markers out of them. +function loadMarkers() { + var url = "https://api.nytimes.com/svc/semantic/v2/geocodes/query.json"; + if(facetChosen) { + url += '?' + $.param({ + 'sw': swLat + ',' + swLng, + 'ne': neLat + ',' + neLng, + 'facet': facetChoice, + 'country_code': "US", + 'api-key': "af9bf1c31430421ab0ab8f940e8b987f" + }); + facetChosen = 0; + } else { + url += '?' + $.param({ + 'sw': swLat + ',' + swLng, + 'ne': neLat + ',' + neLng, + 'country_code': "US", + 'api-key': "af9bf1c31430421ab0ab8f940e8b987f" + }); +} + var things; + //This proxyurl was used to overcome a Access-Control-Allow-Origin error with CORS. + const proxyurl = "https://cors-anywhere.herokuapp.com/"; + //could use this fetch method, or a GET ajax call. + fetch(proxyurl + url) + .then(response => response.text()) + .then(contents => JSON.parse(contents)) + .then(function(data){ + console.log(url); + for (var i = 0; i < data.results.length; i++) { + var latLon = new google.maps.LatLng(data.results[i].latitude,data.results[i].longitude); + var marker = new google.maps.Marker({ + position: latLon, + }); + marker.addListener('click', addInfoWindow(data, marker, i)); + marker.setMap(map); + } + }); + } + +//Creates an info window to be opened when a marker is clicked. +function addInfoWindow(data, marker, index) { + return function() { + var infowindow = new google.maps.InfoWindow({ + content: '

' + data.results[index].name + '

' + + '

' + data.results[index].name + ' has a lat/lng of (' + data.results[index].latitude + ', ' + data.results[index].longitude + '). ' + + 'It also has an elevation of ' + data.results[index].elevation + ' feet.

' + }); + infowindow.open(map, marker); + } +} + +//Takes radio button input and reloads markers based on the change in facets. +function changeFacet(val) { + if (val > 0) { + facetChoice = val; + facetChosen = 1; + } + loadMarkers(); +} \ No newline at end of file diff --git a/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/styles.css b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/styles.css new file mode 100644 index 00000000..98a063d4 --- /dev/null +++ b/roberts games/ClusterTruckProject-master/ClusterTruckProject-master/public/styles.css @@ -0,0 +1,77 @@ +#title { + background-color: orange; + height: 100px; + width: 100%; + display: inline-block; +} + +#titleWords { + float: left; + width: 90%; + height: 100px; + margin: 0px; +} + +#map { + height: 100%; + width: 100%; +} + +html, body { + height: 100%; + margin: 0; + padding: 0; + font-family: 'Ubuntu', sans-serif; + background-color: #eee; +} + +h1, h2 { + margin-top: 0; + text-align: center; +} + +.facetButton { + background-color: black; + color: white; + padding: 16px; + font-size: 16px; + border: none; + cursor: pointer; +} + +.facetDrop { + float: right; + width: 10%; + height: 50px; + margin-top: 15px; +} + +.facetDrop-content { + display: none; + position: absolute; + background-color: #f9f9f9; + min-width: 160px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + z-index: 1; + width: 100%; +} + + +.facetDrop-content a { + color: black; + padding: 12px 16px; + display: block; +} + +.facetDrop-content a:hover { + background-color: #f1f1f1 +} + +.facetDrop:hover .facetDrop-content { + display: block; +} + +.facetDrop:hover .facetButton { + background-color: white; + color: black; +}