Auto commit

上级 4f39fc67
<script setup>
import HelloWorld from './components/HelloWorld.vue'
import TheWelcome from './components/TheWelcome.vue'
</script>
<template> <template>
<header> <canvas ref="canvas" />
<img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" />
<div class="wrapper">
<HelloWorld msg="You did it!" />
</div>
</header>
<main>
<TheWelcome />
</main>
</template> </template>
<style scoped> <script>
header { export default {
line-height: 1.5; mounted() {
} const canvas = this.$refs.canvas;
const ctx = canvas.getContext("2d");
.logo {
display: block; canvas.width = window.innerWidth;
margin: 0 auto 2rem; canvas.height = window.innerHeight;
} ctx.fillStyle = "black";
ctx.fillRect(0, 0, canvas.width, canvas.height);
@media (min-width: 1024px) {
header { let count = 0;
display: flex;
place-items: center; const render = () => {
padding-right: calc(var(--section-gap) / 2); count++;
} ctx.fillStyle = `hsl(${count % 360}, 100%, 50%)`;
ctx.font = "bold 200px sans-serif";
.logo { ctx.textAlign = "center";
margin: 0 2rem 0 0; ctx.textBaseline = "middle";
} ctx.fillText("1024", canvas.width / 2, canvas.height / 2);
requestAnimationFrame(render);
};
render();
},
};
</script>
header .wrapper { <style>
display: flex; canvas {
place-items: flex-start; position: fixed;
flex-wrap: wrap; top: 0;
} left: 0;
width: 100%;
height: 100%;
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册