-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d7fd8a5
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<html> | ||
<head> | ||
<title>Image Generator App</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<div class="container text-center"> | ||
<h1>Image Generator App</h1> | ||
<p>Enter text to generate an image:</p> | ||
<input type="text" id="textInput" class="form-control mb-3" placeholder="Enter text"> | ||
<button onclick="generateImage()" class="btn btn-primary">Generate Image</button> | ||
<div id="imageContainer" class="mt-3"></div> | ||
</div> | ||
|
||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script> | ||
<script src="./style.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
function generateImage() { | ||
const text = document.getElementById('textInput').value; | ||
const imageContainer = document.getElementById('imageContainer'); | ||
|
||
// You can make an AJAX call here to fetch image based on text input | ||
// For demonstration purposes, let's just display a placeholder image | ||
const placeholderImageUrl = 'https://source.unsplash.com/featured/?' + text; | ||
|
||
const imageElement = document.createElement('img'); | ||
imageElement.setAttribute('src', placeholderImageUrl); | ||
imageElement.setAttribute('class', 'img-fluid'); | ||
|
||
imageContainer.innerHTML = ''; | ||
imageContainer.appendChild(imageElement); | ||
} |