CultriX commited on
Commit
0125c43
·
verified ·
1 Parent(s): 056d44f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -7
app.py CHANGED
@@ -42,13 +42,17 @@ def read_qr(img):
42
  # Custom CSS styling as HTML for dark mode
43
  custom_css = """
44
  <style>
45
- body {background-color: #1e1e2f; font-family: Arial, sans-serif; color: #e0e0e0;}
46
- .gradio-container {max-width: 600px; margin: auto; padding: 20px; background-color: #2c2c3e; border-radius: 10px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);}
47
- h1, h2 {text-align: center; color: #f0f0f0; font-weight: 600;}
48
- .gr-button {background-color: #3a3a4f; color: #e0e0e0; padding: 10px 20px; border-radius: 5px; font-size: 15px; border: none;}
49
- .gr-button:hover {background-color: #505068;}
50
- input, textarea, .gr-box {background-color: #3a3a4f; border: 1px solid #555; border-radius: 5px; padding: 10px; font-size: 14px; color: #e0e0e0;}
 
 
 
51
  .gr-box:hover, input:hover, textarea:hover {border-color: #777;}
 
52
  </style>
53
  """
54
 
@@ -61,6 +65,7 @@ def create_gradio_interface():
61
  outputs=gr.Image(label="Generated QR Code"),
62
  title="Generate QR Code",
63
  description="Quickly create a QR code from any text or URL.",
 
64
  )
65
 
66
  # QR Code Reader Interface
@@ -70,6 +75,7 @@ def create_gradio_interface():
70
  outputs=gr.Textbox(label="Decoded Data"),
71
  title="Read QR Code",
72
  description="Upload an image with a QR code to decode the embedded data.",
 
73
  )
74
 
75
  # Combine interfaces into a single tabbed layout
@@ -81,9 +87,10 @@ def create_gradio_interface():
81
  # Launch interface with custom HTML for CSS styling
82
  with gr.Blocks() as demo:
83
  gr.HTML(custom_css) # Embed the custom CSS
 
84
  interface.render()
85
 
86
  demo.launch(share=True)
87
 
88
  # Run the Gradio interface
89
- create_gradio_interface()
 
42
  # Custom CSS styling as HTML for dark mode
43
  custom_css = """
44
  <style>
45
+ body {background-color: #1e1e2f; font-family: 'Arial', sans-serif; color: #e0e0e0;}
46
+ .gradio-container {max-width: 700px; margin: auto; padding: 25px; background-color: #2c2c3e;
47
+ border-radius: 15px; box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);}
48
+ h1, h2 {text-align: center; color: #ffffff; font-weight: bold; margin-bottom: 15px;}
49
+ .gr-button {background-color: #4a4a6a; color: #ffffff; padding: 10px 25px; border-radius: 8px;
50
+ font-size: 16px; border: none; transition: 0.3s;}
51
+ .gr-button:hover {background-color: #6a6a8a; transform: scale(1.05);}
52
+ input, textarea, .gr-box {background-color: #3a3a4f; border: 1px solid #555; border-radius: 10px;
53
+ padding: 10px; font-size: 14px; color: #e0e0e0;}
54
  .gr-box:hover, input:hover, textarea:hover {border-color: #777;}
55
+ .tab {margin-top: 20px;}
56
  </style>
57
  """
58
 
 
65
  outputs=gr.Image(label="Generated QR Code"),
66
  title="Generate QR Code",
67
  description="Quickly create a QR code from any text or URL.",
68
+ theme="compact",
69
  )
70
 
71
  # QR Code Reader Interface
 
75
  outputs=gr.Textbox(label="Decoded Data"),
76
  title="Read QR Code",
77
  description="Upload an image with a QR code to decode the embedded data.",
78
+ theme="compact",
79
  )
80
 
81
  # Combine interfaces into a single tabbed layout
 
87
  # Launch interface with custom HTML for CSS styling
88
  with gr.Blocks() as demo:
89
  gr.HTML(custom_css) # Embed the custom CSS
90
+ gr.Markdown("# QR Code Tool\nEasily generate and decode QR codes.")
91
  interface.render()
92
 
93
  demo.launch(share=True)
94
 
95
  # Run the Gradio interface
96
+ create_gradio_interface()