svelte-reactions
Version:
Easy to use emoji reactions for your app.
42 lines (41 loc) • 909 B
JavaScript
const placement = (position) => {
if (position == 'bottom-left') {
return {
top: '100% ',
right: 'none',
bottom: 'none',
left: '0% '
};
}
if (position == 'bottom-right') {
return {
top: '100% ',
right: '0% ',
bottom: 'none',
left: 'none'
};
}
if (position == 'top-left') {
return {
top: 'none',
right: 'none',
bottom: '100% ',
left: '0% '
};
}
if (position == 'top-right') {
return {
top: 'none',
right: '0% ',
bottom: '100% ',
left: 'none'
};
}
return {
top: '100% ',
right: 'none',
bottom: 'none',
left: '0% '
};
};
export { placement };