From e72ad5b89b1737213d15e80b4dba39e2b71e1fd7 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Mon, 22 Feb 2021 22:32:53 -0600 Subject: I don't like JavaScript --- csci4131/hw3/contacts.js | 59 ++++++++++++++++++++++++++++++++++++++-- csci4131/hw3/myContacts.html | 65 +++++++++++++++++++------------------------- csci4131/hw3/style.css | 24 ++++++++++------ 3 files changed, 100 insertions(+), 48 deletions(-) diff --git a/csci4131/hw3/contacts.js b/csci4131/hw3/contacts.js index 0e9b8bb..94340b2 100644 --- a/csci4131/hw3/contacts.js +++ b/csci4131/hw3/contacts.js @@ -1,8 +1,61 @@ -function change(big, small, row) { - // document.getElementById("bigboi").src = big; - document.getElementById("smol" + row).src = small; +function change(small, row) { + document.getElementsByClassName("smol")[row].src = small; } function lucky() { var image = ["carlson.jpg", "johnston.jpg", "morrill.jpg", "shepherd.jpg", "snyder.jpg", "walter.jpg"]; document.getElementById("bigboi").src = image[Math.floor(6 * Math.random())]; } +let map; +function initMap() { + map = new google.maps.Map(document.getElementById("map"), { + center: { lat: 44.9727, lng: -93.23540000000003 }, + zoom: 14, + }); + + var service = new google.maps.places.PlacesService(map); + entries = document.getElementsByClassName("entry"); + locations = []; + for (e=0; e" + + "" + newEntry.getElementsByClassName("name")[0].textContent + "" + "
" + + newEntry.getElementsByClassName("category")[0].textContent + "
" + + newEntry.getElementsByClassName("room")[0].textContent + " " + newEntry.getElementsByClassName("street")[0].textContent + "
" + + newEntry.getElementsByClassName("city")[0].textContent + + "", + } + }); + marker.addListener('click', function () { + if (!this.infoWindow) { + this.infoWindow = new google.maps.InfoWindow({ + content: this.data.content, + // content: newEntry.getElementsByClassName("address")[0], + }); + } + this.infoWindow.open(map, this); + }) + } +} \ No newline at end of file diff --git a/csci4131/hw3/myContacts.html b/csci4131/hw3/myContacts.html index 14de8be..5a4169c 100644 --- a/csci4131/hw3/myContacts.html +++ b/csci4131/hw3/myContacts.html @@ -30,43 +30,43 @@ Email URL - - Joan Gabel - Industry - 100 Church Street SE
202 Morrill Hall
Minneapolis MN 55455 - President of the University of Minnesota
+ + Joan Gabel + Industry + 100 Church Street SE
202 Morrill Hall
Minneapolis MN 55455 + President of the University of Minnesota
upres@umn.edu Home Page - - Mostafa Kaveh - Industry - 117 Pleasant St SE
105 Walter Library
Minneapolis MN 55455 - Dean of the College of Science and Engineering
+ + Mostafa Kaveh + Industry + 117 Pleasant St SE
105 Walter Library
Minneapolis MN 55455 + Dean of the College of Science and Engineering
mos@umn.edu Home Page - - John Coleman - Industry - 101 Pleasant Street SE
215 Johnston Hall
Minneapolis MN 55455 - Dean of the College of Liberal Arts
+ + John Coleman + Industry + 101 Pleasant Street SE
215 Johnston Hall
Minneapolis MN 55455 + Dean of the College of Liberal Arts
coleman@umn.edu Home Page - - Valery Forbes - Industry - 1475 Gortner Avenue
123 Snyder Hall
St. Paul MN 55108 - Dean of the College of Biological Sciences
+ + Valery Forbes + Industry + 1475 Gortner Avenue
123 Snyder Hall
St. Paul MN 55108 + Dean of the College of Biological Sciences
cbsdeans@umn.edu Home Page - - Sri Zaheer - Industry - 321 19th Avenue S
Suite 4-300 Carlson School of Management
Minneapolis MN 55455 - Dean of the Carlson School of Management
+ + Sri Zaheer + Industry + 321 19th Avenue S
Suite 4-300 Carlson School of Management
Minneapolis MN 55455 + Dean of the Carlson School of Management
szaheer@umn.edu Home Page @@ -75,18 +75,9 @@ Goldy Gopher

-
- - +
+ + diff --git a/csci4131/hw3/style.css b/csci4131/hw3/style.css index 970ef9b..a4e9ec2 100644 --- a/csci4131/hw3/style.css +++ b/csci4131/hw3/style.css @@ -8,16 +8,17 @@ body { background-color: white; border-collapse: separate; } + /* Contacts */ table, th, td { - max-width: 70%; + max-width: 80%; overflow-x:auto; border: 1px solid black; border-collapse: collapse; } table { float:left; - max-width: 50%; + max-width: 60%; } tr:nth-child(even) { background-color:blanchedalmond; @@ -31,20 +32,27 @@ tr:nth-child(odd) { } .large { float: right; - max-width:max-content + max-width: max-content; } #bigboi { width: 25em; height: 15em; object-fit: cover; + margin-right: 0; } #map { - height: 50%; - margin-left: 10%; - margin-right: 10%; - margin-top: 10%; - float: bottom; + padding-top: 30%; + margin-top: 25em; + margin-left: .2em; + position: bottom; + width: 60%; + height: 30%; + max-height: 40%; +} +.id { + text-align: center; } + /* Form */ .Form { background-color: whitesmoke; -- cgit v1.2.3