ASCII-Art-Web-Stylize is a web-based implementation of the ASCII-Art project. It allows users to input text and transform it into a graphical representation using ASCII characters. The web interface with HTML & CSS supports multiple banner styles, including shadow, standard, and thinkertoy.
- Ismail Bentour
- Hamza Maach
-
Clone the repository:
git clone https://github.com/hamzamaach/ascii-art-web.git cd ascii-art-export-file -
Run the Go application:
go run . -
Open your web browser and navigate to:
http://localhost:8080
-
Clone the repository:
git clone https://github.com/hamzamaach/ascii-art-web.git cd ascii-art-export-file -
Build the Docker image:
docker build -t ascii-art-web-img . -
Run the Docker container:
docker run -d -p 8080:8080 --name ascii-art-web-con ascii-art-web-img
-
Open your web browser and navigate to:
http://localhost:8080
To stop and remove the container:
docker stop ascii-art-web-con
docker rm ascii-art-web-con- Enter your text in the input field.
- Select the desired banner style (shadow, standard, or thinkertoy) using the dropdown selector.
- Click the "Generate" button to generate the ASCII art or "Download" button to export the output as file.
- Input Parsing: The input string is read from the user via an HTML form.
- Banner Selection: The selected banner style is determined based on user input.
- Text Conversion: The input string is converted to its ASCII representation using the selected banner style.
- Output Rendering: The resulting ASCII art can be displayed on the webpage or downloaded.
main.go: The main Go file that contains the HTTP server logic.index.html: Main page template.about.html: About page template.features/: Directory containing files that contain all functions.assets/: Directory containing all the CSS assets.banners/: Directory containing banner files (shadow.txt,standard.txt,thinkertoy.txt).Dockerfile: Contains instructions for building the Docker image.
-
GET /: Sends the HTML response for the main page.
- Status Code: 200 OK
-
POST /ascii-art: Receives text and banner data from the form, processes it, and returns the ASCII art.
- Status Code:
- 200 OK: If the text is successfully converted.
- 400 Bad Request: If the request is invalid.
- 404 Not Found: If the page or the banner style is not found.
- 500 Internal Server Error: For unhandled errors.
- Status Code:
- Invalid Input: Returns a 400 Bad Request status.
- Page not Found: Returns a 404 Not Found status.
- Invalid Banner: Returns a 404 Not Found status.
- Entity Too Large: Returns a 413 Entity Too Large.
- Method Not Allowed: Returns a Method Not Allowed status.
- Unhandled Errors: Returns a 500 Internal Server Error status.
The application can be containerized using Docker. The Dockerfile in the root directory contains the necessary instructions to build the image.
To build and run the Docker container, follow the steps in the "Usage" section under "Option 2: Using Docker".