Skip to content

Commit 28c8010

Browse files
committed
解决左下角控件css问题
1 parent ccf4a42 commit 28c8010

File tree

3 files changed

+81
-9
lines changed

3 files changed

+81
-9
lines changed

mars3d-vue3-vite/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"devDependencies": {
1717
"@types/node": "^17.0.13",
1818
"@vitejs/plugin-vue": "^2.0.0",
19+
"less": "^4.1.2",
1920
"typescript": "^4.4.4",
2021
"vite": "^2.7.2",
2122
"vite-plugin-mars3d": "^1.1.4",

mars3d-vue3-vite/src/components/mars-work/mars-map.vue

Lines changed: 76 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ onUnmounted(() => {
119119
})
120120
</script>
121121

122-
<style>
122+
<style lang="less">
123123
/**cesium 工具按钮栏*/
124124
.cesium-viewer-toolbar {
125125
top: auto !important;
@@ -139,19 +139,23 @@ onUnmounted(() => {
139139
text-align: center;
140140
}
141141
.cesium-button {
142-
background-color: #3f4854;
142+
background-color: rgba(23, 49, 71, 0.8);
143143
color: #e6e6e6;
144144
fill: #e6e6e6;
145145
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
146146
line-height: 32px;
147147
}
148+
.cesium-button:hover {
149+
background: #3ea6ff;
150+
}
148151
149152
/**cesium 底图切换面板*/
150153
.cesium-baseLayerPicker-dropDown {
151154
bottom: 0;
152155
left: 40px;
153156
max-height: 700px;
154157
margin-bottom: 5px;
158+
background-color: rgba(23, 49, 71, 0.8);
155159
}
156160
157161
/**cesium 帮助面板*/
@@ -160,6 +164,18 @@ onUnmounted(() => {
160164
bottom: 0;
161165
left: 40px;
162166
transform-origin: left bottom;
167+
background: none;
168+
background-color: rgba(23, 49, 71, 0.8);
169+
.cesium-navigation-help-instructions {
170+
background: none;
171+
}
172+
.cesium-navigation-button {
173+
background: none;
174+
}
175+
.cesium-navigation-button-selected,
176+
.cesium-navigation-button-unselected:hover {
177+
background: rgba(0, 138, 255, 0.2);
178+
}
163179
}
164180
165181
/**cesium 二维三维切换*/
@@ -179,7 +195,7 @@ onUnmounted(() => {
179195
z-index: 9999;
180196
}
181197
.cesium-geocoder-searchButton {
182-
background-color: #3f4854;
198+
background-color: rgba(23, 49, 71, 0.8);
183199
}
184200
.cesium-viewer-geocoderContainer .cesium-geocoder-input {
185201
background-color: rgba(63, 72, 84, 0.7);
@@ -188,16 +204,16 @@ onUnmounted(() => {
188204
background-color: rgba(63, 72, 84, 0.9);
189205
}
190206
.cesium-viewer-geocoderContainer .search-results {
191-
background-color: #3f4854;
207+
background-color: rgba(23, 49, 71, 0.8);
192208
}
193209
194210
/**cesium info信息框*/
195211
.cesium-infoBox {
196212
top: 50px;
197-
background: rgba(63, 72, 84, 0.9);
213+
background-color: rgba(23, 49, 71, 0.8);
198214
}
199215
.cesium-infoBox-title {
200-
background-color: #3f4854;
216+
background-color: rgba(23, 49, 71, 0.8);
201217
}
202218
203219
/**cesium 任务栏的FPS信息*/
@@ -216,6 +232,59 @@ onUnmounted(() => {
216232
top: 10px;
217233
left: 10px;
218234
right: auto;
219-
background-color: #3f4854;
235+
}
236+
.cesium-cesiumInspector {
237+
background-color: rgba(23, 49, 71, 0.8);
238+
}
239+
240+
/**覆盖mars3d内部控件的颜色等样式*/
241+
.mars3d-compass .mars3d-compass-outer {
242+
fill: rgba(23, 49, 71, 0.8);
243+
}
244+
.mars3d-contextmenu-ul,
245+
.mars3d-sub-menu {
246+
background-color: rgba(23, 49, 71, 0.8);
247+
248+
> li > a:hover,
249+
> li > a:focus,
250+
> li > .active {
251+
background-color: #3ea6ff;
252+
}
253+
254+
> .active > a,
255+
> .active > a:hover,
256+
> .active > a:focus {
257+
background-color: #3ea6ff;
258+
}
259+
}
260+
261+
/* Popup样式*/
262+
.mars3d-popup-color {
263+
color: #ffffff;
264+
}
265+
.mars3d-popup-background {
266+
background: rgba(23, 49, 71, 0.8);
267+
}
268+
.mars3d-popup-content {
269+
margin: 15px;
270+
}
271+
.mars3d-template-content label {
272+
padding-right: 6px;
273+
}
274+
.mars3d-template-titile {
275+
border-bottom: 1px solid #3ea6ff;
276+
}
277+
.mars3d-template-titile a {
278+
font-size: 16px;
279+
}
280+
.mars3d-tooltip {
281+
background: rgba(23, 49, 71, 0.8);
282+
border: 1px solid rgba(23, 49, 71, 0.8);
283+
}
284+
285+
.mars3d-popup-btn-custom {
286+
padding: 3px 10px;
287+
border: 1px solid #209ffd;
288+
background: #209ffd1c;
220289
}
221290
</style>

mars3d-vue3-vite/src/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
2+
import "mars3d-cesium/Build/Cesium/Widgets/widgets.css"
3+
import "mars3d/dist/mars3d.css"
4+
15
import { createApp } from 'vue'
26
import App from './App.vue'
37
import "./style.css"
48

5-
import "mars3d-cesium/Build/Cesium/Widgets/widgets.css"
6-
import "mars3d/dist/mars3d.css"
79

810
createApp(App).mount('#app')

0 commit comments

Comments
 (0)