Files
character-browser/templates/create.html
Aodhan Collins c0e6cff7b7 Add outfit gallery and AI-powered creation for characters and outfits
- Add outfit gallery with CRUD operations (create, read, update, delete)
- Add AI-powered profile generation for both characters and outfits
- Add toggle to switch between AI generation and manual creation
- Auto-generate filenames from names with incrementing for duplicates
- Add 'full_body' and 'bottom' fields to wardrobe structure
- Update all character and outfit JSON files with new wardrobe fields
- Reorganize data into data/characters and data/clothing directories
- Update README with new features and JSON structure documentation
2026-02-19 18:34:46 +00:00

75 lines
3.7 KiB
HTML

{% extends "layout.html" %}
{% block content %}
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header bg-success text-white">Create New Character</div>
<div class="card-body">
<form action="{{ url_for('create_character') }}" method="post">
<div class="mb-3">
<label for="name" class="form-label">Character Name</label>
<input type="text" class="form-control" id="name" name="name" placeholder="e.g. Cyberpunk Ninja" required>
</div>
<div class="mb-3">
<label for="filename" class="form-label">Filename (Slug) <small class="text-muted">- optional, auto-generated if empty</small></label>
<input type="text" class="form-control" id="filename" name="filename" placeholder="e.g. cyberpunk_ninja">
<div class="form-text">Used for the JSON file and URL. No spaces or special characters. Auto-generated from name if left empty.</div>
</div>
<div class="mb-3 form-check form-switch">
<input class="form-check-input" type="checkbox" id="use_llm" name="use_llm" checked>
<label class="form-check-label" for="use_llm">Use AI to generate profile from description</label>
</div>
<div class="mb-3" id="prompt-group">
<label for="prompt" class="form-label">Description / Concept</label>
<textarea class="form-control" id="prompt" name="prompt" rows="5" placeholder="Describe the character's appearance, clothing, style, and personality. The AI will generate the full profile based on this."></textarea>
<div class="form-text">Required when AI generation is enabled.</div>
</div>
<div class="alert alert-info" id="ai-info">
<i class="bi bi-info-circle"></i> The AI will generate a complete character profile based on your description.
</div>
<div class="alert alert-secondary d-none" id="manual-info">
<i class="bi bi-info-circle"></i> A blank character profile will be created. You can edit it afterwards to add details.
</div>
<div class="d-grid">
<button type="submit" class="btn btn-success btn-lg" id="submit-btn">Create & Generate</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script>
document.getElementById('use_llm').addEventListener('change', function() {
const promptGroup = document.getElementById('prompt-group');
const aiInfo = document.getElementById('ai-info');
const manualInfo = document.getElementById('manual-info');
const submitBtn = document.getElementById('submit-btn');
const promptInput = document.getElementById('prompt');
if (this.checked) {
promptGroup.classList.remove('d-none');
aiInfo.classList.remove('d-none');
manualInfo.classList.add('d-none');
submitBtn.textContent = 'Create & Generate';
promptInput.required = true;
} else {
promptGroup.classList.add('d-none');
aiInfo.classList.add('d-none');
manualInfo.classList.remove('d-none');
submitBtn.textContent = 'Create Character';
promptInput.required = false;
}
});
</script>
{% endblock %}