From: Brian Flowers Date: Thu, 6 May 2021 23:03:08 +0000 (-0400) Subject: Initial commit X-Git-Url: http://git.slightlycyberpunk.com%2C%20git.slightlycyberpunk.com/git/?a=commitdiff_plain;p=gsvg.git Initial commit --- 36a6b7cdd1bdbad84950b118adf56c239c71719b diff --git a/gsvg.js b/gsvg.js new file mode 100644 index 0000000..d48448e --- /dev/null +++ b/gsvg.js @@ -0,0 +1,131 @@ +// Google Street View Gun (GSVG) 0.3 Javascript +// Created by Brian Flowers +// +// javascript:{{ var svjs=document.createElement("script"); svjs.src = "http://personal.psu.edu/bsf5033/shootview/shootview.js"; svjs.type="text/javascript"; document.getElementsByTagName("body")[0].appendChild(svjs);} stub(); } +// M9 Gunshot sound effect from: http://soundbible.com/1906-Barreta-M9.html + +var svXscale = 1; +var svYscale = 1; +var hitNum = 0; +var selectedGun = "m9"; + +function run() +{ + document.body.style.cursor = "none"; + + var overlay = document.createElement("img"); + overlay.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/crosshair.png"); + overlay.setAttribute("id", "crosshair"); + overlay.style.width = "50px"; + overlay.style.height = "50px"; + overlay.style.position = "absolute"; + overlay.style.left = "100px"; + overlay.style.top = "100px"; + overlay.style.zIndex = "1000"; + overlay.onclick = fire; + document.body.appendChild(overlay); + + var gunImage = document.createElement("img"); + gunImage.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/gun.png"); + gunImage.setAttribute("id", "gunImage"); + gunImage.style.width = "400px"; + gunImage.style.height = "300px"; + gunImage.style.position = "absolute"; + gunImage.style.right = "0px"; + gunImage.style.bottom = "0px"; + gunImage.style.zIndex = "1000"; + document.body.appendChild(gunImage); + + document.onmousemove = UpdateCrosshairPosition; + + fire(null); + reFocus(); +} + +function UpdateCrosshairPosition(e) +{ + document.getElementById("crosshair").style.left = (e.pageX-25)+"px"; + document.getElementById("crosshair").style.top = (e.pageY-25)+"px"; + + var gunImage = document.getElementById("gunImage"); + + xDist = (window.innerWidth - parseInt(gunImage.style.width)) - e.pageX; + svXscale = xDist*2 / window.innerWidth; + + yDist = window.innerHeight - e.pageY; + svYscale = yDist / window.innerHeight; + + gunImage.style.width = (150+250*svXscale)+"px"; + gunImage.style.bottom = (-100+100*svYscale)+"px"; +} + +function drawMuzzleFlash() +{ + var flash = document.createElement("img"); + flash.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/muzzleFlash.png"); + flash.setAttribute("id", "muzzleFlash"); + + if(svXscale < 0) + svXscale = 0.01; + + flash.style.width = (800*(svXscale/2))+"px"; + flash.style.height = (200)+"px"; + flash.style.position = "absolute"; + flash.style.right = ((150+225*svXscale)-(400*(svXscale/2)))+"px"; + flash.style.bottom = ((75+100*svYscale))+"px"; + flash.style.zIndex = "900"; + document.body.appendChild(flash); + setTimeout("remove('muzzleFlash');", 25); +} + +function fire(e) +{ + var hitDiv = document.createElement("div") + var hitDivId = "hitDiv"+hitNum; + var hitImgId = "hitImg"+hitNum + hitNum++; + hitDiv.setAttribute("id", hitDivId); + + var shotSound = document.createElement("embed"); + shotSound.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/fire.mp3"); + shotSound.setAttribute ("autostart", "true"); + shotSound.setAttribute("id", "shotSound"); + shotSound.setAttribute("enablejavascript", "true"); + hitDiv.appendChild(shotSound); + + var hitImage = document.createElement("img"); + hitImage.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/hit.gif"); + hitImage.setAttribute("id", hitImgId); + hitImage.style.width = "15px"; + hitImage.style.height = "15px"; + hitImage.style.position = "absolute"; + hitImage.style.top = (e.pageY-7)+"px"; + hitImage.style.left = (e.pageX-10)+"px"; + hitImage.style.zIndex = "1000"; + hitDiv.appendChild(hitImage); + document.body.appendChild(hitDiv); + drawMuzzleFlash(); + hitNum++; + + setTimeout("remove('"+hitImgId+"')", 350); + setTimeout("remove('"+hitDivId+"')", 1000); + + reFocus(); +} + +function reFocus() +{ + document.getElementById("panoflash1").focus() +} + +function remove(id) +{ + element = document.getElementById(id); + element.parentNode.removeChild(element); +} + +function stub() +{} + +alert("GSVG will start in 5 seconds -- take this time to hide the maps side pane. And if you haven't selected your street view location yet, better hurry up!"); +setTimeout("run();", 5000); \ No newline at end of file diff --git a/gsvg_testing.js b/gsvg_testing.js new file mode 100644 index 0000000..3e13da5 --- /dev/null +++ b/gsvg_testing.js @@ -0,0 +1,128 @@ +// Google Street View Gun (GSVG) 0.2 Javascript +// Created by Brian Flowers +// +// javascript:{{ var svjs=document.createElement("script"); svjs.src = "http://personal.psu.edu/bsf5033/shootview/shootview.js"; svjs.type="text/javascript"; document.getElementsByTagName("body")[0].appendChild(svjs);} stub(); } +// M9 Gunshot sound effect from: http://soundbible.com/1906-Barreta-M9.html + +var svXscale = 1; +var svYscale = 1; +var hitNum = 0; +var selectedGun = "m9"; + +function run() +{ + document.body.style.cursor = "none"; + + var overlay = document.createElement("img"); + overlay.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/crosshair.png"); + overlay.setAttribute("id", "crosshair"); + overlay.style.width = "50px"; + overlay.style.height = "50px"; + overlay.style.position = "absolute"; + overlay.style.left = "100px"; + overlay.style.top = "100px"; + overlay.style.zIndex = "1000"; + overlay.onclick = fire; + document.body.appendChild(overlay); + + var gunImage = document.createElement("img"); + gunImage.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/gun.png"); + gunImage.setAttribute("id", "gunImage"); + gunImage.style.width = "400px"; + gunImage.style.height = "300px"; + gunImage.style.position = "absolute"; + gunImage.style.right = "0px"; + gunImage.style.bottom = "0px"; + gunImage.style.zIndex = "1000"; + document.body.appendChild(gunImage); + + document.onmousemove = UpdateCrosshairPosition; + + fire(null); + reFocus(); +} + +function UpdateCrosshairPosition(e) +{ + document.getElementById("crosshair").style.left = (e.pageX-25)+"px"; + document.getElementById("crosshair").style.top = (e.pageY-25)+"px"; + + var gunImage = document.getElementById("gunImage"); + + xDist = (window.innerWidth - parseInt(gunImage.style.width)) - e.pageX; + svXscale = xDist*2 / window.innerWidth; + + yDist = window.innerHeight - e.pageY; + svYscale = yDist / window.innerHeight; + + gunImage.style.width = (150+250*svXscale)+"px"; + gunImage.style.bottom = (-100+100*svYscale)+"px"; +} + +function drawMuzzleFlash() +{ + var flash = document.createElement("img"); + flash.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/muzzleFlash.png"); + flash.setAttribute("id", "muzzleFlash"); + flash.style.width = (800*(svXscale/2))+"px"; + flash.style.height = (200)+"px"; + flash.style.position = "absolute"; + flash.style.right = ((150+225*svXscale)-(400*(svXscale/2)))+"px"; + flash.style.bottom = ((75+100*svYscale))+"px"; + flash.style.zIndex = "900"; + document.body.appendChild(flash); + setTimeout("remove('muzzleFlash');", 25); +} + +function fire(e) +{ + var hitDiv = document.createElement("div") + var hitDivId = "hitDiv"+hitNum; + var hitImgId = "hitImg"+hitNum + hitNum++; + hitDiv.setAttribute("id", hitDivId); + + var shotSound = document.createElement("embed"); + shotSound.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/fire.mp3"); + shotSound.setAttribute ("autostart", "true"); + shotSound.setAttribute("id", "shotSound"); + shotSound.setAttribute("enablejavascript", "true"); + hitDiv.appendChild(shotSound); + + var hitImage = document.createElement("img"); + hitImage.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/hit.gif"); + hitImage.setAttribute("id", hitImgId); + hitImage.style.width = "15px"; + hitImage.style.height = "15px"; + hitImage.style.position = "absolute"; + hitImage.style.top = (e.pageY-7)+"px"; + hitImage.style.left = (e.pageX-10)+"px"; + hitImage.style.zIndex = "1000"; + hitDiv.appendChild(hitImage); + document.body.appendChild(hitDiv); + drawMuzzleFlash(); + hitNum++; + + setTimeout("remove('"+hitImgId+"')", 350); + setTimeout("remove('"+hitDivId+"')", 1000); + + reFocus(); +} + +function reFocus() +{ + document.getElementById("panoflash1").focus() +} + +function remove(id) +{ + element = document.getElementById(id); + element.parentNode.removeChild(element); +} + +function stub() +{} + +//alert("GSVG will start in 5 seconds -- take this time to hide the maps side pane. And if you haven't selected your street view location yet, better hurry up!"); +//setTimeout("run();", 5000); +run(); \ No newline at end of file diff --git a/guns/m9/crosshair.png b/guns/m9/crosshair.png new file mode 100644 index 0000000..0c2774a Binary files /dev/null and b/guns/m9/crosshair.png differ diff --git a/guns/m9/fire.mp3 b/guns/m9/fire.mp3 new file mode 100644 index 0000000..f734303 Binary files /dev/null and b/guns/m9/fire.mp3 differ diff --git a/guns/m9/fire.wav b/guns/m9/fire.wav new file mode 100644 index 0000000..0228460 Binary files /dev/null and b/guns/m9/fire.wav differ diff --git a/guns/m9/gun.png b/guns/m9/gun.png new file mode 100644 index 0000000..99385a0 Binary files /dev/null and b/guns/m9/gun.png differ diff --git a/guns/m9/hit.gif b/guns/m9/hit.gif new file mode 100644 index 0000000..413f4c1 Binary files /dev/null and b/guns/m9/hit.gif differ diff --git a/guns/m9/muzzleFlash.png b/guns/m9/muzzleFlash.png new file mode 100644 index 0000000..d47da86 Binary files /dev/null and b/guns/m9/muzzleFlash.png differ diff --git a/hit.gif b/hit.gif new file mode 100644 index 0000000..9c8614a Binary files /dev/null and b/hit.gif differ diff --git a/index.html b/index.html new file mode 100755 index 0000000..3772e52 --- /dev/null +++ b/index.html @@ -0,0 +1,57 @@ + + + Google Street View Gun (GSVG) + + + +

Google Street View Gun (GSVG) 0.3

+

This project is a reaction to Google's shutdown of Google Shoot View

+ +

+To "install" Google Street view Gun, drag this link onto your Firefox bookmarks menu:
+GSVG +
+Then, open a google maps street view window, and click the bookmark!

+Controls: +

+Compatibility + +Known bugs:
+ + +

Want to help out?

+

Right now I'm looking for artwork. Need to replace most of the existing pictures/animations with something better. +Also looking to expand this to multiple guns -- will need new artwork and sounds for any of those. All work must be freely licensed (creative commons, +public domain, etc.) Contact me if you have any suggestions or would like to help out: gsvg-admn@bsflowers.net
+Also, feel free to contact me with any bugs or issues!

+ +

Thanks to:

+

M9 sound effect from: SoundBible.com

+ +

+ + + +

+ +

+ \ No newline at end of file diff --git a/old/gsvg.0.2.js b/old/gsvg.0.2.js new file mode 100644 index 0000000..9c1f5dc --- /dev/null +++ b/old/gsvg.0.2.js @@ -0,0 +1,111 @@ +// Google Street View Gun (GSVG) 0.2 Javascript +// Created by Brian Flowers +// +// javascript:{{ var svjs=document.createElement("script"); svjs.src = "http://personal.psu.edu/bsf5033/shootview/shootview.js"; svjs.type="text/javascript"; document.getElementsByTagName("body")[0].appendChild(svjs);} stub(); } +// M9 Gunshot sound effect from: http://soundbible.com/1906-Barreta-M9.html + +var svXscale = 1; +var svYscale = 1; +var hitNum = 0; +var selectedGun = "m9"; + +function run() +{ + document.body.style.cursor = "none"; + + var overlay = document.createElement("img"); + overlay.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/crosshair.png"); + overlay.setAttribute("id", "crosshair"); + overlay.style.width = "50px"; + overlay.style.height = "50px"; + overlay.style.position = "absolute"; + overlay.style.left = "100px"; + overlay.style.top = "100px"; + overlay.style.zIndex = "1000"; + overlay.onclick = fire; + document.body.appendChild(overlay); + + var gunImage = document.createElement("img"); + gunImage.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/gun.png"); + gunImage.setAttribute("id", "gunImage"); + gunImage.style.width = "400px"; + gunImage.style.height = "300px"; + gunImage.style.position = "absolute"; + gunImage.style.right = "0px"; + gunImage.style.bottom = "0px"; + gunImage.style.zIndex = "1000"; + document.body.appendChild(gunImage); + + document.onmousemove = UpdateCrosshairPosition; + + fire(null); + reFocus(); +} + +function UpdateCrosshairPosition(e) +{ + document.getElementById("crosshair").style.left = (e.pageX-25)+"px"; + document.getElementById("crosshair").style.top = (e.pageY-25)+"px"; + + var gunImage = document.getElementById("gunImage"); + + xDist = (window.innerWidth - parseInt(gunImage.style.width)) - e.pageX; + svXscale = xDist*2 / window.innerWidth; + + yDist = window.innerHeight - e.pageY; + svYscale = yDist / window.innerHeight; + + gunImage.style.width = (150+250*svXscale)+"px"; + gunImage.style.bottom = (-100+100*svYscale)+"px"; +} + +function fire(e) +{ + var hitDiv = document.createElement("div") + var hitDivId = "hitDiv"+hitNum; + var hitImgId = "hitImg"+hitNum + hitNum++; + hitDiv.setAttribute("id", hitDivId); + + var shotSound = document.createElement("embed"); + shotSound.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/fire.mp3"); + shotSound.setAttribute ("autostart", "true"); + shotSound.setAttribute("id", "shotSound"); + shotSound.setAttribute("enablejavascript", "true"); + hitDiv.appendChild(shotSound); + + var hitImage = document.createElement("img"); + hitImage.setAttribute("src", "http://www.personal.psu.edu/bsf5033/gsvg/guns/"+selectedGun+"/hit.gif"); + hitImage.setAttribute("id", hitImgId); + hitImage.style.width = "15px"; + hitImage.style.height = "15px"; + hitImage.style.position = "absolute"; + hitImage.style.top = (e.pageY-7)+"px"; + hitImage.style.left = (e.pageX-10)+"px"; + hitImage.style.zIndex = "1000"; + hitDiv.appendChild(hitImage); + document.body.appendChild(hitDiv); + hitNum++; + + setTimeout("remove('"+hitImgId+"')", 350); + setTimeout("remove('"+hitDivId+"')", 1000); + + reFocus(); +} + +function reFocus() +{ + document.getElementById("panoflash1").focus() +} + +function remove(id) +{ + element = document.getElementById(id); + element.parentNode.removeChild(element); +} + +function stub() +{} + +alert("GSVG will start in 5 seconds -- take this time to hide the maps side pane. And if you haven't selected your street view location yet, better hurry up!"); +setTimeout("run();", 5000); \ No newline at end of file diff --git a/preview.jpg b/preview.jpg new file mode 100644 index 0000000..372a27b Binary files /dev/null and b/preview.jpg differ diff --git a/soundEmbed.html b/soundEmbed.html new file mode 100644 index 0000000..b852a6b --- /dev/null +++ b/soundEmbed.html @@ -0,0 +1,4 @@ +If the audio clip embedded below plays, sound in GSVG should work properly. If it shows a broken plugin, you'll need to fix that first. +

+ +Back to GSVG \ No newline at end of file