Skip to content

Instantly share code, notes, and snippets.

View crestinglight's full-sized avatar

Evin Brooks crestinglight

  • SendCutSend
  • Omaha, NE
View GitHub Profile
//This function gets the X and Y coordinates of where the user clicked, relative to the image.
function getXY(e){
var xPosition = e.offsetX;
var yPosition = e.offsetY;
//Sending x and y to the server.
sendInfoToServer(xPosition, yPosition);
}
//Takes the x and y coordinates passed from the getXY function and sends them to the server to determine whether or not these coordinates are correct for Waldo.
function sendInfoToServer(x, y){
<div class="menu">
<div class="icons">
<a href="#" id="twitterIcon">Twitter</a>
<a href="#" id="githubIcon">Git</a>
<a href="#" id="linkedInIcon">LinkedIn</a>
</div>
<div class="shortcuts">
<a href="/articles">ARTICLES</a>
<a href="/about">ABOUT</a>
</div>
.menu {
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
color: #424242;
background-color: #d8d8d8;
box-shadow: 0px 3px 7px #c1c1c1;
padding-top: 23px;
padding-bottom: 23px;
.menu {
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
color: #424242;
background-color: #d8d8d8;
box-shadow: 0px 3px 7px #c1c1c1;
padding-top: 23px;
padding-bottom: 23px;
window.addEventListener("load", function(){
function showHideMenu(e){
e.preventDefault();
if (menuBlock.style.display === "none"){
menuBlock.style.display = "flex";
}
else if (menuBlock.style.display === "flex"){
menuBlock.style.display = "none";
// This function gets the X and Y coordinates of where the
// user clicked, relative to the image.
function getXY(e){
var xPosition = e.offsetX;
var yPosition = e.offsetY;
// Sending x and y to the server.
sendInfoToServer(xPosition, yPosition);
}
// Takes the x and y coordinates, passed from the getXY
// This function gets the X and Y coordinates of where the
// user clicked, relative to the image.
function getXY(e){
var xPosition = e.offsetX;
var yPosition = e.offsetY;
// Sending x and y to the server.
sendInfoToServer(xPosition, yPosition);
}
// Takes the x and y coordinates, passed from the getXY
// This function gets the X and Y coordinates of where the
// user clicked, relative to the image.
function getXY(e){
var xPosition = e.offsetX;
var yPosition = e.offsetY;
// Sending x and y to the server.
sendInfoToServer(xPosition, yPosition);
}
// Takes the x and y coordinates, passed from the getXY
// This function gets the X and Y coordinates of where the
// user clicked, relative to the image.
function getXY(e){
var xPosition = e.offsetX;
var yPosition = e.offsetY;
// Sending x and y to the server.
sendInfoToServer(xPosition, yPosition);
}
// Takes the x and y coordinates, passed from the getXY
// This function gets the X and Y coordinates of where the
// user clicked, relative to the image.
function getXY(e){
var xPosition = e.offsetX;
var yPosition = e.offsetY;
// Sending x and y to the server.
sendInfoToServer(xPosition, yPosition);
}
// Takes the x and y coordinates, passed from the getXY