优化响应式代码配置

This commit is contained in:
lVAL 2021-01-07 17:28:20 +08:00
parent 759ee0631c
commit 284b6e3829
5 changed files with 36 additions and 20 deletions

View File

@ -107,8 +107,8 @@ export default {
if (canvas) { if (canvas) {
canvas.width = width * ratio; canvas.width = width * ratio;
canvas.height = height * ratio; canvas.height = height * ratio;
canvas.style.width = width/10 + "em"; canvas.style.width = width / 10 + "em";
canvas.style.height = height/10 + "em"; canvas.style.height = height / 10 + "em";
ctx.setTransform(ratio, 0, 0, ratio, 0, 0); ctx.setTransform(ratio, 0, 0, ratio, 0, 0);
let renderTask = page.render({ let renderTask = page.render({

View File

@ -1,16 +1,16 @@
<template> <template>
<div class="copy"> <div class="copy">
<div class="container"> <div class="container">
<div v-for="(el, i) in copys" :key="i"> <span v-for="(el, i) in copys" :key="i">
<b-link v-if="el.href" :href="el.href"> <b-link v-if="el.href" :href="el.href">
{{ el.name }} {{ el.name }}
</b-link> </b-link>
<span v-else> {{ el.name }} </span> <span v-else> {{ el.name }} </span>
</div> </span>
<div class="line" /> <span class="line" />
<div v-for="(el, i) in links" :key="copys.length+i"> <span v-for="(el, i) in links" :key="copys.length + i">
<b-link :href="el.href"> {{ el.name }}</b-link> <b-link :href="el.href"> {{ el.name }}</b-link>
</div> </span>
</div> </div>
</div> </div>
</template> </template>
@ -59,12 +59,10 @@ a {
background-color: #e6e6e6; background-color: #e6e6e6;
text-align: center; text-align: center;
color: #666; color: #666;
padding: 1em 0;
.container { .container {
width: 100%; width: 100%;
height: 5em;
display: flex;
justify-content: center;
align-items: center; align-items: center;
} }

View File

@ -141,35 +141,35 @@ export default {
@media (min-width: 320px) { @media (min-width: 320px) {
.frame { .frame {
width: 220px; width: 220px;
height: 180px; height: 120px;
} }
} }
@media (min-width: 480px) { @media (min-width: 480px) {
.frame { .frame {
width: 300px; width: 300px;
height: 200px; height: 180px;
} }
} }
@media (min-width: 760px) { @media (min-width: 760px) {
.frame { .frame {
width: 560px; width: 600px;
height: 220px; height: 180px;
} }
} }
@media (min-width: 960px) { @media (min-width: 960px) {
.frame { .frame {
width: 1000px; width: 1000px;
height: 260px; height: 220px;
} }
} }
@media (min-width: 1200px) { @media (min-width: 1200px) {
.frame { .frame {
width: 1100px; width: 1100px;
height: 300px; height: 280px;
} }
} }
</style> </style>

View File

@ -49,14 +49,31 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.pdf { .pdf {
background: #f7f7f9; background: #f7f7f9;
padding: 10px 0; padding: 1em 0;
min-height: 100vh; min-height: 100vh;
.page { .page {
width: 55%;
margin: auto; margin: auto;
background: #fff; background: #fff;
margin-bottom: 10px; margin-bottom: 1em;
}
@media (min-width: 320px) {
.page {
width: 100%;
}
}
@media (min-width: 768px) {
.page {
width: 80%;
}
}
@media (min-width: 1025px) {
.page {
width: 60%;
}
} }
} }
</style> </style>

View File

@ -31,6 +31,7 @@ export default {
background: #f7f7f9; background: #f7f7f9;
padding: 1em; padding: 1em;
width: 100%; width: 100%;
min-height: 100vh;
.container { .container {
margin: auto; margin: auto;