0% found this document useful (0 votes)
5 views3 pages

Root VFinal

The document outlines a web interface for activating admin features, including managing site rules and generating AI chat and art. Users can input a key to access admin permissions, customize rules, and utilize AI functionalities. The script includes functions for character preparation, messaging, and art generation with options for customization and downloading generated content.

Uploaded by

tekkafaliwither
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Root VFinal

The document outlines a web interface for activating admin features, including managing site rules and generating AI chat and art. Users can input a key to access admin permissions, customize rules, and utilize AI functionalities. The script includes functions for character preparation, messaging, and art generation with options for customization and downloading generated content.

Uploaded by

tekkafaliwither
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

<div id="keySection">

<input id="keyInput" type="password" placeholder="Enter key">


<button id="activateBtn" onclick="activate()">Activate</button>
</div>

<div id="adminSection" hidden>


<button id="getAdminBtn" onclick="getAdminPermissions()">Get Admin
Permissions</button>
<div id="rulesCtn" hidden>
<h3>Site Rules and Regulations</h3>
<textarea id="rulesTextarea" rows="10" cols="50"></textarea>
<button id="customizeBtn" onclick="customizeRules()">Customize</button>
<button id="okayBtn" onclick="saveRules()">Okay</button>
</div>
</div>

<div id="aiSection" hidden>


<button id="chatBtn" onclick="showAiChat()">Unlimited AI Chat</button>
<button id="artBtn" onclick="showAiArt()">Unlimited AI Art Generate</button>
</div>

<div id="aiChatCtn" hidden>


<textarea id="charDescInput" placeholder="Describe the character you want to talk
to"></textarea>
<button id="prepareCharBtn" onclick="prepareCharacter()">Prepare
Character</button>
<div id="chatArea" hidden>
<div id="messages"></div>
<input id="userMsgInput" placeholder="Your message">
<button id="sendMsgBtn" onclick="sendMessage()">Send</button>
</div>
</div>

<div id="aiArtCtn" hidden>


<textarea id="artPromptInput" placeholder="Describe what you want in the
image"></textarea>
<textarea id="artNegativeInput" placeholder="Describe what you don't want in the
image"></textarea>
<input id="artCountInput" type="number" placeholder="Number of images">
<input id="artSizeInput" placeholder="Image size (e.g., 512x512)">
<input id="artStyleInput" placeholder="Image style">
<button id="generateArtBtn" onclick="generateArt()">Generate Art</button>
<div id="artGallery"></div>
</div>

<script>
let adminAccess = false;
let rules = "1. No illegal content\n2. Be respectful\n3. No spamming";

function activate() {
if (keyInput.value === "Rem") {
adminSection.hidden = false;
keySection.hidden = true;
}
}

function getAdminPermissions() {
adminAccess = true;
rulesCtn.hidden = false;
rulesTextarea.value = rules;
}

function customizeRules() {
rulesTextarea.readOnly = false;
}

function saveRules() {
rules = rulesTextarea.value;
rulesTextarea.readOnly = true;
if (adminAccess) {
aiSection.hidden = false;
adminSection.hidden = true;
}
}

function showAiChat() {
aiSection.hidden = true;
aiChatCtn.hidden = false;
}

function showAiArt() {
aiSection.hidden = true;
aiArtCtn.hidden = false;
}

async function prepareCharacter() {


prepareCharBtn.disabled = true;
prepareCharBtn.textContent = "⏳ Preparing...";
let response = await generateText(`Create a character based on this
description: ${charDescInput.value}`);
alert(`Character prepared! It will be ready in ${Math.floor(Math.random() * 10)
+ 1} seconds.`);
chatArea.hidden = false;
prepareCharBtn.hidden = true;
}

async function sendMessage() {


let userMsg = userMsgInput.value;
messages.innerHTML += `<p><strong>You:</strong> ${userMsg}</p>`;
userMsgInput.value = "";
let botResponse = await generateText(`Respond as the character to this message:
${userMsg}`);
messages.innerHTML += `<p><strong>Character:</strong> ${botResponse}</p>`;
}

async function generateArt() {


generateArtBtn.disabled = true;
generateArtBtn.textContent = "⏳ Generating...";
let prompt = `Create ${artCountInput.value} image(s) of size $
{artSizeInput.value} in ${artStyleInput.value} style.
Include: ${artPromptInput.value}.
Exclude: ${artNegativeInput.value}`;
for (let i = 0; i < artCountInput.value; i++) {
let imgData = await generateImage(prompt);
let img = document.createElement('img');
img.src = imgData;
img.style.maxWidth = "300px";
let downloadBtn = document.createElement('button');
downloadBtn.textContent = "Download";
downloadBtn.onclick = () => {
let a = document.createElement('a');
a.href = imgData;
a.download = `generated_art_${i+1}.png`;
a.click();
};
let customizeBtn = document.createElement('button');
customizeBtn.textContent = "Customize";
customizeBtn.onclick = () => customizeImage(img);
let container = document.createElement('div');
container.appendChild(img);
container.appendChild(downloadBtn);
container.appendChild(customizeBtn);
artGallery.appendChild(container);
}
generateArtBtn.disabled = false;
generateArtBtn.textContent = "Generate Art";
}

function customizeImage(img) {
let newPrompt = prompt("Enter new customization instructions:");
if (newPrompt) {
generateImage(newPrompt).then(newImgData => {
img.src = newImgData;
});
}
}
</script>

You might also like