character expressions are now draggable

This commit is contained in:
RossAscends
2023-04-18 18:35:36 +09:00
parent 473c7a614d
commit ac7ee2f11f
4 changed files with 66 additions and 10 deletions

View File

@ -248,7 +248,7 @@ async function setExpression(character, expression, force) {
img.attr('src', imgUrl);
img.removeClass('default');
img.off('error');
img.on('error', function() {
img.on('error', function () {
$(this).attr('src', '');
if (force && extension_settings.expressions.showDefault) {
setDefault();
@ -285,7 +285,11 @@ function onClickExpressionImage() {
(function () {
function addExpressionImage() {
const html = `<div id="expression-holder" class="expression-holder"><img class="expression"></div>`;
const html = `
<div id="expression-holder" class="expression-holder">
<div id="expression-holderheader" class="fa-solid fa-grip drag-grabber"></div>
<img class="expression">
</div>`;
$('body').append(html);
}
function addSettings() {

View File

@ -5,7 +5,7 @@
}
.expression-holder {
max-height: 90vh;
/* max-height: 90vh;
max-width: calc((100vw - 800px)/2);
width: 100%;
position: fixed;
@ -16,14 +16,34 @@
text-align: center;
filter: drop-shadow(2px 2px 2px #51515199);
transition: 500ms;
z-index: 3; */
/* min-width: 100px;
min-height: 100px; */
max-height: 90vh;
max-width: 90vh;
width: calc((100vw - var(--sheldWidth)) /2);
position: absolute;
bottom: 1px;
padding: 0;
filter: drop-shadow(2px 2px 2px #51515199);
z-index: 3;
resize: both;
overflow: hidden;
/* border: 1px solid red; */
}
img.expression {
max-width: 100%;
max-height: 90vh;
/* max-width: 90vw;
max-height: 90vh; */
width: 100%;
height: 100%;
vertical-align: bottom;
object-fit: cover;
object-fit: contain;
}
img.expression.default {