BraydenMoore commited on
Commit
7a8c299
·
1 Parent(s): 35e9ce0

Update styling

Browse files
Files changed (2) hide show
  1. web/static/styles.css +56 -119
  2. web/templates/index.html +19 -44
web/static/styles.css CHANGED
@@ -1,58 +1,53 @@
1
  body {
2
  font-family: 'Helvetica';
3
- margin-top: 100px;
4
- margin-left: 100px;
5
- margin-right: 100px;
6
  padding: 0;
7
  }
8
 
9
  .header {
10
- margin-top: 40px;
11
- margin-bottom: 20px;
12
-
13
- color: #000000;
14
- position: absolute;
15
  text-align: center;
16
- top: 40px;
17
- left: 50%;
18
- transform: translateX(-50%);
 
 
 
 
 
19
  }
20
 
21
  .container {
22
- margin-top: 120px;
23
- height: auto;
24
- top: 100px;
25
  display: flex;
26
- justify-content: space-around;
27
- padding: 20px;
28
- position: relative;
29
- align-items: stretch;
30
  }
31
 
32
- .left-container {
33
- width: 52%;
34
- padding: 20px;
35
- text-align: center;
 
 
36
  align-items: center;
37
- align-content: center;
 
38
  }
39
 
40
  .right-container {
41
- margin-left:-2px;
42
- width: 48%;
43
  padding: 20px;
44
  border: 2px solid #000000;
45
  text-align: left;
 
46
  }
47
 
48
- .dropzone {
49
- width: 52%;
50
- min-height: 500px;
51
- border: 2px solid #000000;
52
- display: flex;
53
- justify-content: center;
54
  align-items: center;
55
- cursor: pointer;
 
56
  }
57
 
58
  #uploaded-image {
@@ -62,106 +57,48 @@ body {
62
  align-items: center;
63
  }
64
 
65
- .github-container {
66
- display: flex;
67
- justify-content: center;
68
- margin-top: 100px;
69
- }
70
-
71
- .github-container a {
72
- display: flex;
73
- color:#000000;
74
- align-items: center;
75
- }
76
-
77
- .feature-select {
78
- display: flex;
79
- justify-content: center;
80
- margin-top: 10px;
81
- }
82
-
83
- /* The container for the predicted images */
84
  #predicted-images {
 
85
  display: grid;
86
  row-gap: 1%;
87
  column-gap: 1%;
88
- width: 100%;
89
- grid-template-columns: repeat(3, 1fr);
90
- grid-template-rows: repeat(3, fr);
91
- position: relative; /* Set the container as a relative positioning context */
92
  }
93
 
94
- /* The predicted image */
95
- #predicted-images img {
96
- width: 100%;
97
- height: auto;
98
- display: block;
99
- align-items: center;
100
- }
101
 
102
- /* The tooltip */
103
- .image-tooltip {
104
- position: absolute;
105
- bottom: 100%; /* Position the tooltip above the image */
106
- left: 50%; /* Center the tooltip horizontally */
107
- transform: translate(0%, -60%); /* Center both horizontally and vertically */
108
- background-color: rgba(0, 0, 0, 0.6);
109
- padding-left: 10px;
110
- padding-right: 10px;
111
- padding-top: 10px;
112
- padding-bottom: 20px;
113
- color: white;
114
- font-size: 12px;
115
- pointer-events: none;
116
- opacity: 0; /* Initially set the tooltip to be transparent */
117
- }
118
-
119
- /* Apply the hover effect */
120
- #predicted-images img {
121
- /* Set initial transition properties */
122
- transition: all 0.3s ease-in-out;
123
- transform: scale(1); /* Set the initial scale to 1 (normal size) */
124
  }
125
 
126
- #predicted-images img:hover {
127
- filter: brightness(70%);
128
- transform: scale(1.07); /* Scale the image up to 1.1 times its original size on hover */
 
129
  }
130
 
131
- /* Show the tooltip on image hover */
132
- #predicted-images .image-container:hover .image-tooltip {
133
- opacity: 1; /* Make the tooltip visible on image hover */
134
- visibility: visible; /* Show the tooltip on image hover */
135
- }
136
 
137
- /* The caption */
138
- .image-caption {
139
- bottom: 0;
140
- left: 0;
141
- width: auto;
142
- gap: 0%;
143
- padding: 10px;
144
- align-items: center;
145
- text-decoration: none;
146
- font-size: 14px;
147
- text-align: center;
148
- font-weight: normal;
149
- pointer-events: none; /* Prevent caption from blocking clicks */
150
- }
151
 
152
- .image-species {
153
- opacity: 0;
154
- }
155
 
156
- #predicted-images a {
157
- color: #4e4e4e;
158
- text-decoration: none;
159
- font-weight: normal;
160
- }
161
 
162
- #predicted-images > div > a:hover .image-caption{
163
- color: #000000;
164
- font-size: 14px;
165
- transition: 0.5s;
166
  }
167
-
 
1
  body {
2
  font-family: 'Helvetica';
3
+ margin: 0;
 
 
4
  padding: 0;
5
  }
6
 
7
  .header {
 
 
 
 
 
8
  text-align: center;
9
+ margin: 20px 0;
10
+ color: #000000;
11
+ }
12
+
13
+ .feature-select {
14
+ display: flex;
15
+ justify-content: center;
16
+ margin: 20px 0;
17
  }
18
 
19
  .container {
 
 
 
20
  display: flex;
21
+ flex-direction: column;
22
+ align-items: center;
 
 
23
  }
24
 
25
+ .dropzone {
26
+ width: 90%;
27
+ min-height: 300px;
28
+ border: 2px solid #000000;
29
+ display: flex;
30
+ justify-content: center;
31
  align-items: center;
32
+ margin-bottom: 20px;
33
+ cursor: pointer;
34
  }
35
 
36
  .right-container {
37
+ width: 90%;
 
38
  padding: 20px;
39
  border: 2px solid #000000;
40
  text-align: left;
41
+ margin-bottom: 20px;
42
  }
43
 
44
+ .left-container {
45
+ width: 90%;
46
+ padding: 20px;
47
+ text-align: center;
 
 
48
  align-items: center;
49
+ align-content: center;
50
+ margin-bottom: 20px;
51
  }
52
 
53
  #uploaded-image {
 
57
  align-items: center;
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  #predicted-images {
61
+ width: 90%;
62
  display: grid;
63
  row-gap: 1%;
64
  column-gap: 1%;
65
+ grid-template-columns: repeat(1, 1fr);
 
 
 
66
  }
67
 
68
+ /* ... Rest of the styles remain unchanged ... */
 
 
 
 
 
 
69
 
70
+ .github-container {
71
+ display: flex;
72
+ justify-content: center;
73
+ margin: 20px 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
75
 
76
+ .github-container a {
77
+ display: flex;
78
+ color: #000000;
79
+ align-items: center;
80
  }
81
 
82
+ /* For tablets and desktops, add a breakpoint */
83
+ @media (min-width: 768px) {
84
+ body {
85
+ margin: 100px;
86
+ }
87
 
88
+ .container {
89
+ flex-direction: row;
90
+ justify-content: space-around;
91
+ }
 
 
 
 
 
 
 
 
 
 
92
 
93
+ .left-container, .dropzone {
94
+ width: 48%;
95
+ }
96
 
97
+ .right-container {
98
+ width: 48%;
99
+ }
 
 
100
 
101
+ #predicted-images {
102
+ grid-template-columns: repeat(3, 1fr);
103
+ }
 
104
  }
 
web/templates/index.html CHANGED
@@ -1,52 +1,27 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>What Plant Is This?</title>
5
- <link rel="stylesheet" href="static/styles.css">
6
- <link rel="icon" type="image/png" href="https://images.squarespace-cdn.com/content/v1/64790f5777b5d772678cce83/6d71eaee-f825-4324-be9b-2def32469eac/Untitled+drawing+%2811%29.png?format=100w">
7
- </head>
8
- <body>
9
- <div class="header">
10
- <h1>What Plant is This?</h1>
11
- <p> Have a neural net try to identify the plant you found.</p>
12
 
13
- <div class="feature-select">
14
- <label for="feature">This is a picture of a...</label>
15
- <select name="feature" id="feature-select">
16
- <option value="flower">flower</option>
17
- <option value="leaf">leaf</option>
18
- <option value="fruit">fruit</option>
19
- </select>
20
- </div>
21
-
22
- </div>
23
 
24
- <div class="container">
 
25
  <div id="image-dropzone" class="dropzone">
26
  <p>Drop an image</p>
27
  </div>
28
- <img id="uploaded-image" src="#" alt="Uploaded Image" />
29
- <div class="right-container">
30
- <h2 id="thinking-text">Suggestions will appear here...</h2>
31
- <div class="image-grid">
32
- <div id="predicted-images">
33
- </div>
34
  </div>
35
  </div>
36
  </div>
37
-
38
- <!-- Add the GitHub link and icon below the container -->
39
- <div class="github-container">
40
- <a href="https://github.com/brayden1moore/What-Plant-Is-This" target="_blank">
41
- <img src="https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg" height=20px />
42
- <p> See the code</p>
43
- </a>
44
- </div>
45
-
46
- <div class="spacing">
47
- <p><br> <br> <br> </p>
48
- </div>
49
- <script src="https://cdn.jsdelivr.net/gh/alexcorvi/heic2any/dist/heic2any.js"></script>
50
- <script src="static/script.js"></script>
51
- </body>
52
- </html>
 
1
+ <div class="header">
2
+ <h1>What Plant is This?</h1>
3
+ <p> Have a neural net try to identify the plant you found.</p>
4
+ </div>
 
 
 
 
 
 
 
5
 
6
+ <div class="feature-select">
7
+ <label for="feature">This is a picture of a...</label>
8
+ <select name="feature" id="feature-select">
9
+ <option value="flower">flower</option>
10
+ <option value="leaf">leaf</option>
11
+ <option value="fruit">fruit</option>
12
+ </select>
13
+ </div>
 
 
14
 
15
+ <div class="container">
16
+ <div class="right-container">
17
  <div id="image-dropzone" class="dropzone">
18
  <p>Drop an image</p>
19
  </div>
20
+ <h2 id="thinking-text">Suggestions will appear here...</h2>
21
+ <div class="image-grid">
22
+ <div id="predicted-images">
 
 
 
23
  </div>
24
  </div>
25
  </div>
26
+ <img id="uploaded-image" src="#" alt="Uploaded Image" />
27
+ </div>