Skip to content

Commit e593237

Browse files
mgermeriegchoqueux
authored andcommitted
examples: change view source button style
1 parent 30bee5f commit e593237

8 files changed

+74
-11
lines changed

examples/css/example.css

+21-1
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,28 @@ body {
7575

7676
#view-source {
7777
position: fixed;
78-
right: 10px;
78+
right: 25px;
7979
bottom: 10px;
80+
width: 30px;
81+
height: 30px;
82+
padding: 0;
83+
box-sizing: border-box;
84+
85+
border: 1px solid #222222;
86+
border-radius: 7px;
87+
background-color: #313336bb;
88+
89+
background-image: url('../images/code-logo.svg');
90+
background-repeat: no-repeat;
91+
background-position: center;
92+
background-size: 90%;
93+
}
94+
95+
#view-source:hover {
96+
cursor: pointer;
97+
}
98+
#view-source:active {
99+
background-color: #222222;
80100
}
81101

82102
/* NAVIGATION (LEFT) */

examples/images/code-logo.svg

+43
Loading

examples/index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<div id="main">
1313
<iframe id="content" class="scroll-section" frameborder="0" height="100%"></iframe>
14-
<div id="view-source" class="text"></div>
14+
<button id="view-source" class="text" title="View source"></button>
1515
</div>
1616

1717
<nav class="scroll-section">
@@ -50,10 +50,10 @@
5050
iframe.src = url.replace('index.html', '');
5151
iframe.focus();
5252

53-
var viewSrc = '<a href="https://github.com/iTowns/itowns/blob/master/examples/';
54-
viewSrc += window.location.hash.substr(1) || 'view_3d_map';
55-
viewSrc += '.html" target="_blank">View source</a>';
56-
document.getElementById('view-source').innerHTML = viewSrc;
53+
let viewSrc = `https://github.com/iTowns/itowns/blob/master/examples/${
54+
window.location.hash.substr(1) || 'view_3d_map'
55+
}.html`;
56+
document.getElementById('view-source').onclick = () => { window.open(viewSrc); };
5757
}
5858

5959
function initNavigation(list) {

examples/misc_orthographic_camera.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
// Add a scale :
7878
const scale = new itowns_widgets.Scale(view, {
7979
position: 'bottom-right',
80-
translate: { x: -120 },
80+
translate: { x: -70 },
8181
});
8282

8383
// request redraw

examples/view_25d_map.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
// Add a scale :
129129
const scale = new itowns_widgets.Scale(view, {
130130
position: 'bottom-right',
131-
translate: { x: -120 },
131+
translate: { x: -70 },
132132
});
133133

134134
// Request redraw

examples/view_2d_map.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
// Add a scale :
7171
const scale = new itowns_widgets.Scale(view, {
7272
position: 'bottom-right',
73-
translate: { x: -120 },
73+
translate: { x: -70 },
7474
});
7575

7676
// Request redraw

examples/view_3d_map.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
// ---------- ADD SOME WIDGETS : ----------
8080

8181
// ADD A SCALE :
82-
const scale = new itowns_widgets.Scale(view, { position: 'bottom-right', translate: { x: -120 } });
82+
const scale = new itowns_widgets.Scale(view, { position: 'bottom-right', translate: { x: -80 } });
8383

8484
// ADD A MINIMAP :
8585
const minimap = new itowns_widgets.Minimap(

examples/widgets_scale.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181
const scale = new itowns_widgets.Scale(view, {
8282
position: 'bottom-right',
83-
translate: { x: -120 },
83+
translate: { x: -70 },
8484
});
8585

8686

0 commit comments

Comments
 (0)