Skip to content

Commit 7dd0702

Browse files
committed
refactoring UI and structure
1 parent 4cbf38b commit 7dd0702

10 files changed

+260
-8
lines changed
File renamed without changes.

image/chat.svg

Lines changed: 46 additions & 0 deletions
Loading

image/favicon-32x32.png

1.19 KB
Loading
File renamed without changes.

index.html

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@
1919
<meta charset="utf-8">
2020
<title>全台灣郵筒位置地圖</title>
2121

22-
<script type="text/javascript" src="post_boxes_with_latlng.js"></script>
23-
22+
<script type="text/javascript" src="js/jquery-1.11.3.min.js" ></script>
23+
<script type="text/javascript" src="js/jquery.easing.min.js" ></script>
24+
<script type="text/javascript" src="js/jquery-1.11.3.min.js" ></script>
25+
<script type="text/javascript" src="js/easing.js"></script>
26+
<script type="text/javascript" src="js/post_boxes_with_latlng.js"></script>
27+
<script type="text/javascript" src="js/main.js"></script>
2428
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
2529
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
26-
30+
<link rel="icon" type="image/png" sizes="16x16" href="image/favicon-32x32.png">
2731
<style>
2832
#map {
2933
height: 100%;
@@ -109,8 +113,12 @@
109113
padding-left: 30px;
110114
margin: 8px;
111115
}
112-
#github-img {
113-
padding: 15px 0px 15px 70px;
116+
#img-container {
117+
padding: 15px 0px 15px 5px;
118+
}
119+
#comment-img {
120+
margin-right: 13px;
121+
cursor: pointer;
114122
}
115123
#fb-container {
116124
padding-top: 18px;
@@ -131,9 +139,10 @@
131139
<div class="col-md-6">
132140
<h1 id="web-title">全台灣郵筒位置地圖</h1>
133141
</div>
134-
<div class="col-md-1 offset-md-3" id="github-img">
142+
<div class="col-md-1 offset-md-3" id="img-container">
143+
<img id="comment-img" class="img" src="image/chat.svg" alt="Comment Image" width="32px" height="32px">
135144
<a href="https://github.com/Neilxx/neilxx.github.io" target="_blank">
136-
<img src="public/GitHub-Mark-120px-plus.png" alt="Github Image" width="32px" height="32px">
145+
<img class="img" src="image/GitHub-Mark-120px-plus.png" alt="Github Image" width="32px" height="32px">
137146
</a>
138147
</div>
139148
<div class="col-md-2" id="fb-container">
@@ -155,7 +164,7 @@ <h1 id="web-title">全台灣郵筒位置地圖</h1>
155164
});
156165

157166
var image = {
158-
url: 'public/postbox.svg',
167+
url: 'image/postbox.svg',
159168
scaledSize: new google.maps.Size(50, 50),
160169
origin: new google.maps.Point(0, 0),
161170
anchor: new google.maps.Point(0, 32)

js/easing.js

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
/*
2+
* jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
3+
*
4+
* Uses the built In easIng capabilities added In jQuery 1.1
5+
* to offer multiple easIng options
6+
*
7+
* Copyright (c) 2007 George Smith
8+
* Licensed under the MIT License:
9+
* http://www.opensource.org/licenses/mit-license.php
10+
*/
11+
12+
// t: current time, b: begInnIng value, c: change In value, d: duration
13+
14+
jQuery.extend( jQuery.easing,
15+
{
16+
easeInQuad: function (x, t, b, c, d) {
17+
return c*(t/=d)*t + b;
18+
},
19+
easeOutQuad: function (x, t, b, c, d) {
20+
return -c *(t/=d)*(t-2) + b;
21+
},
22+
easeInOutQuad: function (x, t, b, c, d) {
23+
if ((t/=d/2) < 1) return c/2*t*t + b;
24+
return -c/2 * ((--t)*(t-2) - 1) + b;
25+
},
26+
easeInCubic: function (x, t, b, c, d) {
27+
return c*(t/=d)*t*t + b;
28+
},
29+
easeOutCubic: function (x, t, b, c, d) {
30+
return c*((t=t/d-1)*t*t + 1) + b;
31+
},
32+
easeInOutCubic: function (x, t, b, c, d) {
33+
if ((t/=d/2) < 1) return c/2*t*t*t + b;
34+
return c/2*((t-=2)*t*t + 2) + b;
35+
},
36+
easeInQuart: function (x, t, b, c, d) {
37+
return c*(t/=d)*t*t*t + b;
38+
},
39+
easeOutQuart: function (x, t, b, c, d) {
40+
return -c * ((t=t/d-1)*t*t*t - 1) + b;
41+
},
42+
easeInOutQuart: function (x, t, b, c, d) {
43+
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
44+
return -c/2 * ((t-=2)*t*t*t - 2) + b;
45+
},
46+
easeInQuint: function (x, t, b, c, d) {
47+
return c*(t/=d)*t*t*t*t + b;
48+
},
49+
easeOutQuint: function (x, t, b, c, d) {
50+
return c*((t=t/d-1)*t*t*t*t + 1) + b;
51+
},
52+
easeInOutQuint: function (x, t, b, c, d) {
53+
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
54+
return c/2*((t-=2)*t*t*t*t + 2) + b;
55+
},
56+
easeInSine: function (x, t, b, c, d) {
57+
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
58+
},
59+
easeOutSine: function (x, t, b, c, d) {
60+
return c * Math.sin(t/d * (Math.PI/2)) + b;
61+
},
62+
easeInOutSine: function (x, t, b, c, d) {
63+
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
64+
},
65+
easeInExpo: function (x, t, b, c, d) {
66+
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
67+
},
68+
easeOutExpo: function (x, t, b, c, d) {
69+
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
70+
},
71+
easeInOutExpo: function (x, t, b, c, d) {
72+
if (t==0) return b;
73+
if (t==d) return b+c;
74+
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
75+
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
76+
},
77+
easeInCirc: function (x, t, b, c, d) {
78+
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
79+
},
80+
easeOutCirc: function (x, t, b, c, d) {
81+
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
82+
},
83+
easeInOutCirc: function (x, t, b, c, d) {
84+
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
85+
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
86+
},
87+
easeInElastic: function (x, t, b, c, d) {
88+
var s=1.70158;var p=0;var a=c;
89+
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
90+
if (a < Math.abs(c)) { a=c; var s=p/4; }
91+
else var s = p/(2*Math.PI) * Math.asin (c/a);
92+
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
93+
},
94+
easeOutElastic: function (x, t, b, c, d) {
95+
var s=1.70158;var p=0;var a=c;
96+
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
97+
if (a < Math.abs(c)) { a=c; var s=p/4; }
98+
else var s = p/(2*Math.PI) * Math.asin (c/a);
99+
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
100+
},
101+
easeInOutElastic: function (x, t, b, c, d) {
102+
var s=1.70158;var p=0;var a=c;
103+
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
104+
if (a < Math.abs(c)) { a=c; var s=p/4; }
105+
else var s = p/(2*Math.PI) * Math.asin (c/a);
106+
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
107+
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
108+
},
109+
easeInBack: function (x, t, b, c, d, s) {
110+
if (s == undefined) s = 1.70158;
111+
return c*(t/=d)*t*((s+1)*t - s) + b;
112+
},
113+
easeOutBack: function (x, t, b, c, d, s) {
114+
if (s == undefined) s = 1.70158;
115+
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
116+
},
117+
easeInOutBack: function (x, t, b, c, d, s) {
118+
if (s == undefined) s = 1.70158;
119+
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
120+
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
121+
},
122+
easeInBounce: function (x, t, b, c, d) {
123+
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
124+
},
125+
easeOutBounce: function (x, t, b, c, d) {
126+
if ((t/=d) < (1/2.75)) {
127+
return c*(7.5625*t*t) + b;
128+
} else if (t < (2/2.75)) {
129+
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
130+
} else if (t < (2.5/2.75)) {
131+
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
132+
} else {
133+
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
134+
}
135+
},
136+
easeInOutBounce: function (x, t, b, c, d) {
137+
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
138+
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
139+
}
140+
});
141+

js/jquery-1.11.3.min.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/jquery.easing.min.js

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
$(document).ready(function() {
2+
$("#comment-img").click(function() {
3+
$([document.documentElement, document.body]).animate({
4+
scrollTop: $("#fb-comments").offset().top - 100
5+
}, 1500, 'easeOutQuart');
6+
});
7+
});
File renamed without changes.

0 commit comments

Comments
 (0)