-
Notifications
You must be signed in to change notification settings - Fork 3
/
minimap.erb
79 lines (66 loc) · 1.76 KB
/
minimap.erb
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
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html>
<head>
<title>Minimap Browser</title>
<style type="text/css">
body {
max-width: 5.5in;
margin: 0 auto;
font-family: Helvetica, sans-serif;
background-color:#aaf;
}
h1 {
font-size: 60px;
margin: 1em 0 0 0;
}
input {
font-size:30px;
width: 100%;
margin: 1em 0 2em 0;
}
button {
font-size:24px;
color:#fff;
font-weight:bold;
background-color:#33f;
width:100%;
height:2em;
border:none;
border-radius:.5em;
-moz-border-radius:.5em;
-webkit-border-radius:.5em;
}
p {
font-size:18px;
display:none;
}
</style>
</head>
<body>
<h1>Type in a URL and press Enter.</h1>
<input autofocus>
<button>Learn More/Get The Code</button>
<p>Minimap.js uses <a href="http://www.sitepoint.com/a-primer-on-css3-transforms/">CSS3 transforms</a> to display a minimap of a webpage while you browse it. Get the javascript file <a href="/minimap.js">here</a>, see the full codebase <a href="http://github.com/laughinghan/minimap">here</a>.
<p>The project started as a one-hour hack by <a href="http://github.com/erikkrasner">Erik</a> and <a href="http://github.com/laughinghan">Han</a>. Erik, Han and <a href="http://github.com/heidiho">Heidi</a> developed it further at <a href="http://developer.yahoo.com/hacku/">Yahoo! HackU 2011</a>.
<p>Copyright 2011, GPL license.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery<%= ".min" unless @dev %>.js"></script>
<script type="text/javascript">
<% if @dev %>
window.onerror = function() {
$('html').css('background', 'red');
};
<% end %>
$('button').click(function() {
$('button').hide();
$('p').slideDown();
$('input').focus();
})
$('input').bind('keydown keypress', function(e) {
if (e.keyCode == 13) {
url = $(this).val();
window.location += '?' + escape(url);
}
})
</script>
</body>
</html>