HOME  >   HTML5 CANVAS  >   How HTML5 Canvas Implements the Mouse Over the 3D Animation Background
How HTML5 Canvas Implements the Mouse Over the 3D Animation Background
BY Henry13 Nov,2020
Tags:

In the web page, we often set the background of the element, simply set the background color, and set the background image for the more complex. Today I will share with you an example of HTML5 canvas animation as the background of the web page. Place the canvas at the bottom of the text and draw a lot of 3D graphics on the canvas. When we roll the mouse over the background, these 3D graphics on the canvas will be flipped. The effect is very good. Cool.

Advertisement

How HTML5 Canvas Implements the Mouse Over the 3D Animation Background
HTML Body Code
<div class="content">
<h2 class="content__title">HTML5</h2>
<h3 class="content__subtitle">chocolaterie</h3>
</div>                        
Css Code
body {
  margin: 0; }

a:focus {
  outline: thin dotted; }

a:active, a:hover {
  outline: 0; }

h1 {
  font-size: 2em;
  margin: 0.67em 0; }

abbr[title] {
  border-bottom: 1px dotted; }

b, strong {
  font-weight: bold; }

dfn {
  font-style: italic; }

hr {
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  height: 0; }

mark {
  background: #ff0;
  color: #000; }

code, kbd, pre, samp {
  font-family: monospace,serif;
  font-size: 1em; }

pre {
  white-space: pre-wrap; }

q {
  quotes: "\201C" "\201D" "\2018" "\2019"; }                        

Advertisement