imseldrith commited on
Commit
3425732
1 Parent(s): 0669403

Update templates/output.html

Browse files
Files changed (1) hide show
  1. templates/output.html +12 -10
templates/output.html CHANGED
@@ -36,9 +36,11 @@
36
  height: auto;
37
  border-radius: 5px;
38
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
 
 
39
  }
40
 
41
- .fullscreen-image {
42
  position: fixed;
43
  top: 0;
44
  left: 0;
@@ -51,7 +53,7 @@
51
  z-index: 9999;
52
  }
53
 
54
- .fullscreen-image img {
55
  max-width: 90%;
56
  max-height: 90%;
57
  border-radius: 5px;
@@ -121,9 +123,7 @@
121
  <div class="container">
122
  <h1>Generated Image</h1>
123
  <div class="image-container">
124
- <a href="{{ url_for('static', filename='example.jpeg') }}" target="_blank">
125
- <img src="{{ url_for('static', filename='example.jpeg') }}" alt="Generated Image" onclick="toggleFullScreen()">
126
- </a>
127
  </div>
128
  <div class="button-container">
129
  <a href="/static/example.jpeg" class="btn btn-success" onclick="downloadImage()"><i class="fas fa-download"></i> Download Image</a>
@@ -156,9 +156,12 @@
156
  link.click();
157
  }
158
 
159
- function toggleFullScreen() {
160
- var bodyElement = document.querySelector('body');
161
- bodyElement.classList.toggle('fullscreen-image');
 
 
 
162
  }
163
  </script>
164
  <footer>
@@ -166,5 +169,4 @@
166
  </footer>
167
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.5.0/dist/js/bootstrap.bundle.min.js"></script>
168
  </body>
169
- </html>
170
-
 
36
  height: auto;
37
  border-radius: 5px;
38
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
39
+ transition: all 0.3s ease;
40
+ cursor: pointer;
41
  }
42
 
43
+ .enlarged {
44
  position: fixed;
45
  top: 0;
46
  left: 0;
 
53
  z-index: 9999;
54
  }
55
 
56
+ .enlarged img {
57
  max-width: 90%;
58
  max-height: 90%;
59
  border-radius: 5px;
 
123
  <div class="container">
124
  <h1>Generated Image</h1>
125
  <div class="image-container">
126
+ <img src="{{ url_for('static', filename='example.jpeg') }}" alt="Generated Image" onclick="toggleImageSize(this)">
 
 
127
  </div>
128
  <div class="button-container">
129
  <a href="/static/example.jpeg" class="btn btn-success" onclick="downloadImage()"><i class="fas fa-download"></i> Download Image</a>
 
156
  link.click();
157
  }
158
 
159
+ function toggleImageSize(image) {
160
+ if (image.classList.contains('enlarged')) {
161
+ image.classList.remove('enlarged');
162
+ } else {
163
+ image.classList.add('enlarged');
164
+ }
165
  }
166
  </script>
167
  <footer>
 
169
  </footer>
170
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.5.0/dist/js/bootstrap.bundle.min.js"></script>
171
  </body>
172
+ </html>