-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo_splash_2.html
193 lines (160 loc) · 6.39 KB
/
demo_splash_2.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Splash 2</title>
<link rel="icon" type="image/png" href="./img/leaflet.png"/>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="description" content="Demonstrate Leaflet Splash Screen" />
<meta name="keywords" content="">
<meta name="author" content="Essam A. El-Sherif" />
<link rel="stylesheet" type="text/css" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
<style type="text/css">
html { width: 100%; height: 100%; }
body{ height: 100%; margin:0; padding:0; background-color: rgb(217, 153, 85);}
#welcome{
position: absolute;
top: 0; left: 0;
margin: 0; padding: 0;
width: 100%; height: 100%;
}
#welcome-1{ top: 0; left: 0; }
#welcome-2{ top: 0; right: 0; }
#welcome-1, #welcome-2{
position: absolute;
width: 50%; height: 100%;
background-image: url('./img/splash/splash_2_background.jpg');
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
transition: 0.7s;
}
#welcome-content{
position: absolute;
top:30%; left:0;
width: 100%;
height: 40%;
margin:auto;
color: #FFEFD5;
font-family: verdana;
font-weight: bold;
font-size: 30px;
text-align: center;
text-decoration: none;
text-shadow: -3px -3px 5px black, 4px 4px 8px black;
text-shadow: 0 2px 5px black;
cursor: pointer;
}
#mapid{
position: relative;
width: 100%; height: 100%;
top: 0; left: 0;
margin:0; padding:0;
border: none;
box-shadow: none;
}
/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {
#welcome-content{ font-size: 18px; }
}
/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) {
#welcome-content{ font-size: 20px; }
}
/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {
#welcome-content{ font-size: 26px; }
}
/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {
#welcome-content{ font-size: 28px; }
}
/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {
#welcome-content{ font-size: 30px; }
}
</style>
<script type="text/javascript" src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script type="text/javascript">
window.onload = function(){
var basemap_layers = {}, basemap_default;
init_basemap();
var map_elt= document.getElementById('mapid');
var map_center = L.latLng(28.652031, 30.750732), map_zoom = 5;
var map_1;
var wc = document.getElementById('welcome-content');
wc.addEventListener('click', wLinkClick, {once: true});
function wLinkClick(){
var w1 = document.getElementById('welcome-1');
var w2 = document.getElementById('welcome-2');
w1.style.width = '0';
w2.style.width = '0';
this.remove();
}
var w2 = document.getElementById('welcome-2');
w2.addEventListener('transitionend', wTransitEnd, {once: true});
function wTransitEnd(){
var w = document.getElementById('welcome');
w.remove();
init_map();
}
function init_map(){
map_elt.style.display = 'block';
map_1 = L.map(map_elt, {center: map_center, zoom: map_zoom, zoomControl:false, attributionControl:false});
basemap_default.addTo(map_1);
map_1_screen();
}
function init_basemap(){
var basemap_credits = {};
if(document.location.protocol === 'https:'){
basemap_layers['Satellite'] = 'https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}';
basemap_layers['Open Street'] = 'https://tile.openstreetmap.org/{z}/{x}/{y}.png';
basemap_layers['Toner'] = 'https://stamen-tiles.a.ssl.fastly.net/toner-background/{z}/{x}/{y}.png';
basemap_layers['Watercolor'] = 'https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png';
}
else{
basemap_layers['Satellite'] = 'https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}';
basemap_layers['Open Street'] = 'http://tile.openstreetmap.org/{z}/{x}/{y}.png';
basemap_layers['Toner'] = 'http://tile.stamen.com/toner-background/{z}/{x}/{y}.png';
basemap_layers['Watercolor'] = 'http://tile.stamen.com/watercolor/{z}/{x}/{y}.png';
}
basemap_credits['Satellite'] = 'Map data ©2015 Google';
basemap_credits['Open Street'] = '© OpenStreetMap contributors, CC-BY-SA';
basemap_credits['Toner'] = 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.';
basemap_credits['Watercolor'] = 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.';
for(var i in basemap_layers){
basemap_layers[i] = L.tileLayer(basemap_layers[i], {attribution:basemap_credits[i]});
}
basemap_default = basemap_layers['Open Street'];
}
function map_1_screen(){
map_1.options.doubleClickZoom = scrollWheelZoom = true;
/* add zoom control */
var control_zoom = L.control.zoom({position:'topleft'});
control_zoom.addTo(map_1);
/* add scale control */
var control_scale = L.control.scale({imperial:false, maxWidth:100});
control_scale.addTo(map_1);
/* add baselayers control */
var control_layers_base = L.control.layers(basemap_layers, {}, {position:'topright', title: 'Baselayers'});
control_layers_base.addTo(map_1);
/* add attribution control */
var control_attr = L.control.attribution({position:'bottomright'});
control_attr.addTo(map_1);
}
};
</script>
</head>
<body>
<div id="mapid"></div>
<div id="welcome">
<div id="welcome-1"></div>
<div id="welcome-2"></div>
<div id="welcome-content"">
EGYPT<br/>
welcome to exploring the map<br/>
click to proceed
</div>
</div>
</body>
</html>