情人节-动态爱心背景(html5+css+js)

2023-11-06

一、效果图

二、源代码

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>情人节爱心背景</title>

<style>
body{
  overflow: hidden;
  margin: 0;
}
h1{
  position: fixed;
  top: 40%;
  left: 0;
  width: 100%;
  text-align: center;
  transform:translateY(-50%);
  font-family: 'Love Ya Like A Sister', cursive;
  font-size: 40px;
  color: #c70012;
  padding: 0 20px;
}

@media (min-width:1200px){
  h1{
    font-size: 100px;
  }
}
</style>

</head>
<body>

<canvas></canvas>
<h1>情人节快乐!</h1>

<script>
var canvas = document.querySelector("canvas"),
  ctx = canvas.getContext("2d"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

情人节-动态爱心背景(html5+css+js) 的相关文章