Auto commit

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