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