rpg-convers
Advanced tools
Comparing version 1.0.5 to 1.0.7
18
index.js
@@ -53,2 +53,18 @@ const generateStyle = require("./tools/generateStyle.js") | ||
} | ||
addClassNameToELement(elementType, newClassName){ | ||
switch(elementType){ | ||
case "container": | ||
this.mainContainer.classList.add(newClassName) | ||
break | ||
case "text": | ||
this.convText.classList.add(newClassName) | ||
break | ||
case "image": | ||
this.convCharacImg.classList.add(newClassName) | ||
break; | ||
case "button": | ||
this.convNextBtn.classList.add(newClassName) | ||
break; | ||
} | ||
} | ||
createElement(document,elementType, className, textInside){ | ||
@@ -61,3 +77,3 @@ const elem = document.createElement(elementType) | ||
setImageOfSpeaker(imageDirectory,isLeft){ | ||
this.convCharacImg.style.left = isLeft ? "0" : "100%-300px" | ||
this.convCharacImg.style.left = isLeft ? "90%" : "0" | ||
if(imageDirectory){ | ||
@@ -64,0 +80,0 @@ this.convCharacImg.src = imageDirectory |
{ | ||
"name": "rpg-convers", | ||
"version": "1.0.5", | ||
"description": "An rpg conversation maker, To use first call new Conversation([{name: '', message: '', isLeft: bool}], howfast The speaker is in miliseconds, callback function ) ", | ||
"version": "1.0.7", | ||
"description": "An rpg conversation maker, To use first call new Conversation([{name: '', message: '', isLeft: bool define if the speaker will be on left or right, imageDirectory: the file for your image if have}], howfast The speaker is in miliseconds, callback function ) ", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -11,3 +11,3 @@ function generateStyle(element, style, elementType){ | ||
eStyle.transform = "translate(-50%,-50%) scale(1)" | ||
eStyle.bottom = bottom ? bottom : "10%" | ||
eStyle.bottom = bottom ? bottom : "5%" | ||
eStyle.left= "50%" | ||
@@ -14,0 +14,0 @@ eStyle.width = "80%" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8124
165