IMVU HTML Description
IMVU HTML Description
// ==/UserScript==
(function() {
'use strict';
function toggleDropShadow() {
textShadow = document.getElementById('dropShadowCheckbox').checked ? '2px 2px
4px rgba(0,0,0,0.8)' : 'none';
injectHTMLCode();
localStorage.setItem('rememberShadow',
document.getElementById('dropShadowCheckbox').checked);
}
function changeFontColor() {
textColor = document.getElementById('fontColorPicker').value;
injectHTMLCode();
localStorage.setItem('chosenColor', textColor);
}
function getUserIdFromLink() {
const userIdMatch =
document.querySelector('a.notranslate').getAttribute('href').match(/user=(\d+)/);
return userIdMatch ? userIdMatch[1] : null;
}
function injectHTMLCode() {
const userId = getUserIdFromLink();
const derivedFromNumber = window.location.href.match(/edit_product_html\/(\d+)/) ?
window.location.href.match(/edit_product_html\/(\d+)/)[1] : '';
if (userId) {
const userImages = document.getElementById('userImages').value.split('\n');
const backgroundImage = localStorage.getItem('chosenImage') || '';
const bannerCode = document.getElementById('bannerBox').value.trim();
const footerTextColor = document.getElementById('fontColorPicker').value;
const additionalHtml = document.getElementById('additionalHtml').value;
const dropShadowImageUrl =
'https://userimages-akm.imvu.com/userdata/38/39/59/89/userpics/Snap_j4ogbJlGKQ101228
5644.png';
const injectedHtmlCode =
`<center>${gaf210Code}${iframeCode}<style>body{background-image:url('${backgroundIma
ge}');background-repeat:no-repeat;background-attachment:fixed;background-size:cover;colo
r:${textColor};text-shadow:${textShadow};padding:0;margin:0}.autoHtmlFooter{position:absol
ute;bottom:10px;right:10px;font-size:12px;color:${footerTextColor};margin:0;padding:0}.previ
ew-container{display:flex;flex-direction:column;align-items:center}</style><div
class="preview-container">${imageHTML}</div>${bannerCode ? bannerCode : ''}<div
class="autoHtmlFooter">EZ-AutoHTML by Punishment,
spcckz@discord</div>${additionalHtml}</center>`;
function loadSavedValues() {
document.getElementById('userImages').value = localStorage.getItem('userImages') ||
'';
document.getElementById('bannerBox').value = localStorage.getItem('bannerCode') ||
'';
document.getElementById('backgroundImageInput').value =
localStorage.getItem('chosenImage') || '';
document.getElementById('additionalHtml').value =
localStorage.getItem('additionalHtml') || '';
}
function saveInputValues() {
localStorage.setItem('userImages', document.getElementById('userImages').value);
localStorage.setItem('bannerCode', document.getElementById('bannerBox').value);
localStorage.setItem('chosenImage',
document.getElementById('backgroundImageInput').value);
localStorage.setItem('additionalHtml',
document.getElementById('additionalHtml').value);
}
function addButtonAndInput() {
const container = document.createElement('div');
container.style.cssText =
'position:absolute;top:235px;right:200px;z-index:9999;font-size:16px;display:flex;flex-directio
n:column;align-items:center';
container.appendChild(button);
container.appendChild(input);
container.appendChild(bgImgLabel);
container.appendChild(backgroundImageInput);
container.appendChild(colorLabel);
container.appendChild(colorPicker);
container.appendChild(document.createElement('br'));
container.appendChild(shadowLabel);
container.appendChild(shadowCheckbox);
container.appendChild(document.createElement('br'));
container.appendChild(bannerLabel);
container.appendChild(bannerBox);
container.appendChild(document.createElement('br'));
container.appendChild(additionalHtmlLabel);
container.appendChild(additionalHtml);
document.body.appendChild(container);
window.addEventListener('load', addButtonAndInput);
})();