11import CT from './CardTransformable.js' ;
22import CM from './CardMouseShadowed.js' ;
3- import TF from '../../js/transformationNew /TransformationFunctions.js' ;
3+ import TF from '../../js/transformation /TransformationFunctions.js' ;
44import LA from '../../js/math/LinearAlgebra.js' ;
55
66/**
7- * Base for the transformation controller for card blocks, which automates
8- * the 3d effect
7+ * Base for the event controllers for card blocks, which automates
8+ * the effects
99 * @abstract
10- * @extends TransformationController
1110 */
1211export default class cardAbstract {
1312 /**
@@ -38,7 +37,7 @@ export default class cardAbstract {
3837 modifier ,
3938 postShadowFunction ,
4039 shadowFunction
41- )
40+ ) ;
4241 }
4342
4443 /**
@@ -64,7 +63,7 @@ export default class cardAbstract {
6463 rotAxis [ 1 ] ,
6564 - rotAxis [ 0 ]
6665 ] ;
67-
66+
6867 return {
6968 transform :
7069 `perspective(2000px) ` +
@@ -77,18 +76,24 @@ export default class cardAbstract {
7776 } ;
7877 }
7978
79+ /**
80+ * function which takes an object args which contains e mousemove
81+ * event (event) and returns css changes
82+ * @param {object } args
83+ * @returns {object } object of css properties and their values
84+ */
8085 static _shadowFunction ( args ) {
81- const
82- rect = args . eventControlElement . domElement . getBoundingClientRect ( ) ,
83- hover = [
84- args . event . clientX - rect . left ,
85- args . event . clientY - rect . top
86- ] ;
87-
86+ const
87+ rect = args . eventControlElement . domElement . getBoundingClientRect ( ) ,
88+ hover = [
89+ args . event . clientX - rect . left ,
90+ args . event . clientY - rect . top
91+ ] ;
92+
8893 return {
8994 '--card__inner--mouse-shadow-left' : hover [ 0 ] + 'px' ,
9095 '--card__inner--mouse-shadow-top' : hover [ 1 ] + 'px'
91- }
96+ } ;
9297 }
9398
9499 /**
0 commit comments