Skip to content

Commit

Permalink
Added more features
Browse files Browse the repository at this point in the history
Added more features
  • Loading branch information
npmnishantsharma committed Mar 2, 2023
1 parent d435d74 commit 2972f0d
Showing 1 changed file with 36 additions and 13 deletions.
49 changes: 36 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,37 @@
import { shadowizard } from '@developerso/shadowizard';
function shadowizard(options) {
let images = document.querySelectorAll('.shadowizard');

shadowizard({
shadow_type: 'soft',
padding: true,
border: true,
border_radius: true,
width: '200px',
height: '200px',
background_color: '#ffffff',
gradient: true,
gradient_direction: 'to right',
gradient_color: '#000000'
});
if(options.shadow_type == 'hard'){
options.shadow_type = '0px'
}else{
options.shadow_type = '15px'
}

images.forEach(image =>{
image.style.boxShadow = `10px 10px ${options.shadow_type} 1px rgba(0,0,0,0.12)`;
if(options.padding){
image.style.padding = '1em'; // Added missing '=' operator
}
if(options.border){
image.style.border = '1px solid black';
}
if(options.border_radius){
image.style.borderRadius = '50%';
}
if(options.width){
image.style.width = options.width;
}
if(options.height){
image.style.height = options.height;
}
if(options.background_color){
if(options.gradient){
image.style.background = `linear-gradient(${options.gradient_direction}, ${options.background_color}, ${options.gradient_color})`;
} else {
image.style.backgroundColor = options.background_color;
}
}
})
}

module.exports.shadowizard = shadowizard;

0 comments on commit 2972f0d

Please sign in to comment.