-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
69 lines (62 loc) · 2.19 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head>
<title>OptiSpeed</title>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"
src="index.js"
></script>
</head>
<body>
<div id="container">
<div></div>
Page speed from Google insights
<div>
<h1>OptiSpeed</h1>
<input id="to" type="text" placeholder="Enter E-mail to receive notifications" /><br>
<input id="url" type="text" placeholder="Enter URL to be tested"/><br>
<input type="radio" name="strategy" value="desktop" checked> Desktop<br>
<input type="radio" name="strategy" value="mobile"> Mobile<br>
<!-- <textarea id="content" cols="40" rows="5" placeholder="Write what you want to send"></textarea><br> -->
<button id="submit">Submit</button>
<p></p>
</div>
</body>
<script>
// $(document).ready(function(){
// var from,to,subject,text;
// $("#send_email").click(function(){
// to = $("#to").val();
// subject = $("#subject").val();
// text = $("#content").val();
// $("#message").text("Sending E-mail...Please wait");
// $.get("http://localhost:3000/send", {to:to, subject:subject, text:text}, function(data){
// if(data == "sent"){
// $("#message").empty().html("Email is been sent at "+to+" . Please check inbox!");
// }
// });
// });
// });
$(document).ready(function(){
var client_email, url, strategy;
$("#submit").click(function(){
client_email = $("#to").val();
url = $("#url").val();
strategy = $("input[name=strategy]:checked").val();
$("p").append("Setting sights on your page speed...")
$.get("http://localhost:3000/send", {client_email:client_email, url:url, strategy:strategy}, function(data){
if(data){
console.log($("input[name=strategy]:checked").val())
console.log("hi")
console.log(data)
$("p").empty();
$("p").append("RadarGun clocked your page speed at "+data+"/100");
}
});
});
});
</script>
<!-- https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=https://saferout.herokuapp.com&strategy=desktop&key=AIzaSyA-vJWyH1LdKFGFVCFzFam3ccbBIIHAaNk -->
</html>