add Header

This commit is contained in:
lb
2023-05-08 15:15:43 +08:00
parent bf70872359
commit 822df97edd
14 changed files with 162 additions and 3 deletions

View File

@@ -10,4 +10,6 @@
<script></script>
<style lang="scss"></style>
<style lang="scss">
</style>

BIN
src/assets/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
src/assets/company.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
src/assets/date.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/assets/header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

View File

@@ -0,0 +1,10 @@
// functions
@import "variables";
@function h($height) {
@return $height * ($actual_height / $design_height);
}
@function w($width) {
@return $width * ($actual_width / $design_width);
}

View File

@@ -0,0 +1,14 @@
// variables
// $design_width: 4480px;
$design_width: 8960px;
$design_height: 2160px;
$actual_width: 3840px;
$actual_height: 1080px;
$height: 1080px;
$default_ratio: 0.875;
// colors
$main-color: #6bf2ff;

66
src/components/Header.vue Normal file
View File

@@ -0,0 +1,66 @@
<template>
<header class="header relative">
<div>
<span style="width: 50px; height: 50px; background: red"></span>
<h1>凯盛晶华玻璃院公司800t/d特种玻璃生产线大数据指挥中心</h1>
</div>
<span class="header--wing absolute company"></span>
<span class="header--wing absolute datetime"></span>
</header>
</template>
<script>
export default {
name: "Header",
};
</script>
<style scoped lang="scss">
@import "../assets/styles/functions";
@import "../assets/styles/variables";
header {
background: url(../assets/header.png) center/cover no-repeat;
height: h(300px);
width: $actual_width;
display: grid;
place-items: center;
> div {
display: flex;
align-items: center;
margin-bottom: 20px;
h1 {
margin-left: 20px;
font-size: 40px;
// line-height: 100px;
// background: #eee;
user-select: none;
letter-spacing: 8px;
font-weight: 500;
// color: #6bf2ff;
color: $main-color;
font-family: "微软雅黑", "MS YaHei", "Helvicate", sans-serif;
}
}
}
.header--wing {
left: 0;
bottom: 10px;
height: h(78px);
}
.company {
margin-left: w(1180px);
width: w(1460px);
background: url("../assets/company.png") center/cover no-repeat;
}
.datetime {
margin-left: w(6300px);
width: w(1407px);
background: url("../assets/date.png") center/cover no-repeat;
}
</style>

27
src/components/Main.vue Normal file
View File

@@ -0,0 +1,27 @@
<template>
<main>
main content
</main>
</template>
<script>
export default {
name: "Main",
props: {},
data() {
return {};
},
created() {},
mounted() {},
methods: {},
};
</script>
<style scoped lang="scss">
@import '../assets/styles/functions';
main {
height: 1px;
flex: 1;
}
</style>

View File

@@ -3,6 +3,9 @@ import App from './App.vue'
import router from './router'
import store from './store'
import 'normalize.css'
import './style.css'
Vue.config.productionTip = false
new Vue({

9
src/style.css Normal file
View File

@@ -0,0 +1,9 @@
.relative {
position: relative;
}
.absolute {
position: absolute;
}

View File

@@ -1,10 +1,17 @@
<template>
<div class="home-view">home view</div>
<div class="home-view">
<BigHeader />
<Main />
</div>
</template>
<script>
import BigHeader from '../components/Header.vue'
import Main from '../components/Main.vue'
export default {
name: "HomeView",
components: { BigHeader, Main },
props: {},
data() {
return {};
@@ -15,4 +22,19 @@ export default {
};
</script>
<style scoped></style>
<style scoped lang="scss">
@import '../assets/styles/functions';
.home-view {
// width: 100vw;
// height: 100vh;
height: $actual_height;
width: $actual_width;
overflow: hidden;
background: url(../assets/bg.png) center/cover no-repeat ;
color: white;
background-color: #ccc;
display: flex;
flex-direction: column;
}
</style>