New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aframe-href-component

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aframe-href-component - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

examples/basic/animation.html

32

index.js

@@ -33,10 +33,38 @@ if (typeof AFRAME === 'undefined') {

if (target) {
var animation = '';
var exitAnimation = null;
var animationendHandler = null;
console.log('target to ' + target);
if (target.indexOf('#') >= 0) {
var li = target.split('#');
target = li[0];
animation = li[1];
console.log('target to ' + target + ' & animate ' + animation);
}
switch(target) {
case '_blank':
window.open(url);
if (animation) {
exitAnimation = document.getElementById(animation);
exitAnimation.addEventListener('animationend', function animationendHandler() {
exitAnimation.removeEventListener('animationend', animationendHandler);
window.open(url);
});
this.el.emit('href');
} else {
window.open(url);
}
break;
case 'window':
default:
window.location.href = url;
if (animation) {
exitAnimation = document.getElementById(animation);
exitAnimation.addEventListener('animationend', function animationendHandler() {
exitAnimation.removeEventListener('animationend', animationendHandler);
console.log()
window.location.href = url;
});
this.el.emit('href');
} else {
window.location.href = url;
}
break;

@@ -43,0 +71,0 @@ }

2

package.json
{
"name": "aframe-href-component",
"version": "0.4.0",
"version": "0.5.0",
"description": "Hyper Link component for A-Frame.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,2 +13,6 @@ ## aframe-href-component

### Animation support (experimental)
When link is clicked, the href-component will emit a `href` event within this object. You can append the animation id in `target` attribute, such as `target="#out-animation"` (a shortcut of `target="window#out-animation"`) or `target="_blank#out-animation"` to trigger the animation directly. If your animation is not defined within this object, you should emit the event manually.
### Anchor support (experimental)

@@ -15,0 +19,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc