This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getVertices() { | |
const cos = Math.cos(this.rotation) | |
const sin = Math.sin(this.rotation) | |
return [ | |
{ | |
x: this.position.x + cos * 30 - sin * 0, | |
y: this.position.y + sin * 30 + cos * 0, | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This adds the animation to slide a div with text up and down. | |
However, I only want this to happen if the feature is supported (it is on most browsers -- | |
https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-text-fill-color) | |
*/ | |
@supports (-webkit-text-fill-color: transparent) { | |
.container { | |
/* hide the container above it's actual location */ | |
transform: translateY(-100%); | |
transform-origin: top; |
There are many times we need to validate the data that is entered is what we expect it to be. A common area we need to validate data for is a phone number. In the United States, although there is a proper format for the phone number, in this day of computers, many people don't use that format. Regex will allow us to test the most common formats of phone numbers for validity.