Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
perspective-transform.js
Advanced tools
Readme
This is an extremely useful class for advanced CSS 3d animation. You can set the x, y point of the corners of a DOM element and do need to think about the complicated Matrix formula behind it.
##Usage##
// create PerspectiveTransfrom
var transform = new PerspectiveTransform(elem, width, height, useBackFacing);
// the properties represent the 4 corners are "topLeft", "topRight", "bottomLeft" and "bottomRight"
transform.bottomRight.x = 200;
transform.bottomRight.y = 200;
// check the polygon error before updating
if(transform.checkError()==0){
transform.update(); // update the perspective transform
elem.style.display = "block"; // show the element
}else{
elem.style.display = "none"; // hide the element
}
##Firefox on retina screen fix##
PerspectiveTransform.useDPRFix = true; // put true if you need to apply this fix
window.onresize = function(){
PerspectiveTransform.dpr = window.devicePixelRatio; // update the dpr
transform.update(); // update the PerspectiveTransform instance
}
##Credit## The original PerspectiveTransform.js is created by Israel Pastrana http://www.is-real.net/experiments/css3/wonder-webkit/js/real/display/PerspectiveTransform.js
Matrix Libraries from a Java port of JAMA: A Java Matrix Package, http://math.nist.gov/javanumerics/jama/ Developed by Dr Peter Coxhead: http://www.cs.bham.ac.uk/~pxc/ Available here: http://www.cs.bham.ac.uk/~pxc/js/
I simply removed some irrelevant variables and functions and merge everything into a smaller function. I also added some error checking functions and bug fixing things.
FAQs
This is an extremely useful class for advanced CSS 3d animation. You can set the x, y point of the corners of a DOM element and do need to think about the complicated Matrix formula behind it.
The npm package perspective-transform.js receives a total of 0 weekly downloads. As such, perspective-transform.js popularity was classified as not popular.
We found that perspective-transform.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.