text stringlengths 0 106k |
|---|
```javascript |
// Display the images |
let imageContainer = document.createElement('div'); |
imageContainer.style.display = 'flex'; |
imageContainer.style.flexWrap = 'wrap'; |
imageContainer.style.marginTop = '20px'; |
imageContainer.style.justifyContent = 'space-around'; |
urls.forEach(url => { |
let img = document.createElement('img'); |
img.src = url; |
img.style.width = isMobile() ? 'calc(100% - 20px)' : 'calc(50% - 20px)'; |
img.style.height = 'auto'; |
img.style.margin = '10px'; |
img.style.borderRadius = '15px'; // Add this line to make the images have rounded corners |
imageContainer.appendChild(img); |
}); |
// Add the image container to the DOM, right after the Generate button |
document.querySelector('.btn').after(imageContainer); |
``` |
In this code, I've added `img.style.borderRadius = '15px';` which applies a 15px border radius to each image, giving them rounded corners. You can adjust the '15px' value to make the corners more or less rounded according to your preference. |
[USER]: <!DOCTYPE html> |
<html lang="en"> |
<head> |
<meta charset="UTF-8"> |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
<title>AI Image Generator</title> |
<!--Bootstrap CSS--> |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> |
<!--Custom CSS--> |
<link rel="stylesheet" href="style.css"> |
</head> |
<body> |
<div class="container d-flex flex-column align-items-center vh-100"> |
<div class="input-container"> |
<label for="prompt" class="form-label">Prompt</label> |
<textarea id="prompt" class="form-control mb-3" rows="1" placeholder="Type a prompt..."></textarea> |
</div> |
<div class="input-container"> |
<label for="negative-prompt" class="form-label">Negative Prompt</label> |
<textarea id="negative-prompt" class="form-control mb-3" rows="1" placeholder="Type a negative prompt..."></textarea> |
</div> |
<div class="input-container"> |
<label for="provider" class="form-label">Provider</label> |
<select id="provider" class="form-control mb-3"></select> |
</div> |
<div class="input-container"> |
<label for="model" class="form-label">Model</label> |
<select id="model" class="form-control mb-3"></select> |
</div> |
<div class="input-container"> |
<label for="style" class="form-label">Style</label> |
<select id="style" class="form-control mb-3"></select> |
</div> |
<div class="input-container"> |
<label for="ratio" class="form-label">Aspect Ratio</label> |
<select id="ratio" class="form-control mb-3"></select> |
<div class="input-container"> |
<label for="num-images" class="form-label">Number of Images</label> |
<input type="number" id="num-images" class="form-control mb-3" min="1" max="4" value="4"> |
</div> |
</div> |
<button class="btn btn-primary mt-3">Generate</button> |
</div> |
<!--Bootstrap JS--> |
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> |
<!--Custom JS--> |
<script src="script.js"></script> |
</body> |
</html> |
body { |
background: #f8f9fa; |
} |
.container { |
padding: 2rem; |
} |
.input-container { |
text-align: left; |
width: 100%; |
} |
.form-label { |
font-size: 0.8rem; |
font-weight: bold; |
color: #333; |
margin-bottom: 0.5rem; |
} |
.form-control { |
height: auto; |
font-size: 1.2rem; |
overflow: hidden; |
resize: none; |
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.