diff --git a/README b/README new file mode 100644 index 0000000..2989f4c --- /dev/null +++ b/README @@ -0,0 +1,10 @@ +# Progress Bar Styles + +This application supports multiple styles for progress bars. You can select a style using the `style` query parameter in the URL. + +## Available Styles + +- **Default**: The original style of the progress bar. +- **Flat**: A new flat design for the progress bar. + +To use a specific style, append `?style=flat` to your progress bar URL for the flat style. diff --git a/app.py b/app.py index da12402..12edaf1 100644 --- a/app.py +++ b/app.py @@ -1,3 +1,13 @@ +from flask import Flask, request, render_template + +app = Flask(__name__) + +@app.route('/progress') +def progress(): + style = request.args.get('style', 'default') + if style not in ['default', 'flat']: + style = 'default' + return render_template(f'{style}_progress.svg') from flask import Flask, make_response, redirect, render_template, request app = Flask(__name__) diff --git a/templates/flat_progress.svg b/templates/flat_progress.svg new file mode 100644 index 0000000..978fd76 --- /dev/null +++ b/templates/flat_progress.svg @@ -0,0 +1,5 @@ + + + + {progress}% + diff --git a/vercel.json b/vercel.json index 5e10ba2..f48ea5c 100644 --- a/vercel.json +++ b/vercel.json @@ -1,6 +1,12 @@ { + { + "src": "app.py", "version": 2, + { + "src": "/(.*)", "builds": [ + "dest": "app.py" + } { "src": "app.py", "use": "@vercel/python" @@ -12,4 +18,4 @@ "dest": "app.py" } ] -} \ No newline at end of file +}