-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
145 lines (124 loc) · 4.54 KB
/
index.html
File metadata and controls
145 lines (124 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Art Tracker</title>
<link rel="stylesheet" type="text/css" href="styles.css">
<style>
/* Style the tab */
.tab {
overflow: hidden;
border: 1px solid #ccc;
background-color: #f1f1f1;
}
/* Style the buttons inside the tab */
.tab button {
background-color: inherit;
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 14px 16px;
transition: 0.3s;
font-size: 17px;
}
/* Change background color of buttons on hover */
.tab button:hover {
background-color: #ddd;
}
/* Create an active/current tablink class */
.tab button.active {
background-color: #ccc;
}
/* Style the tab content */
.tabcontent {
display: none;
padding: 6px 12px;
border: 1px solid #ccc;
border-top: none;
}
.gallery-image:fullscreen {
object-fit: contain;
width: 100%;
height: 100%;
}
.gallery-image {
width: 300px; /* Width of the images */
height: auto; /* Maintain aspect ratio */
cursor: pointer; /* Indicates that the image is clickable */
}
/* Optional: style for the full-screen mode to reset any specific dimensions */
.gallery-image:fullscreen {
width: 100%;
height: 100%;
object-fit: contain;
}
</style>
</head>
<body>
<!-- Tab links -->
<div class="tab">
<button class="tablinks" onclick="openTab(event, 'Upload')">Upload</button>
<button class="tablinks" onclick="openTab(event, 'Gallery')" id="defaultOpen">Gallery</button>
</div>
<!-- Tab content for Image Upload and Daily Prompt -->
<div id="Upload" class="tabcontent">
<h3>Today's prompt:</h3>
<!-- Display prompt of the day -->
<p id="promptDisplay">Today's Prompt: <span id="todayPrompt">Loading prompt...</span></p>
<h3>Upload Image:</h3>
<input type="file" id="uploadButton" accept="image/*"/>
<br>
<p>
<label for="timeTakenInput">Time Taken:</label>
<input type="text" id="timeTakenInput" placeholder="(e.g., 2 hours)">
<br>
<label for="materialsUsedInput">Materials Used:</label>
<input type="text" id="materialsUsedInput" placeholder="(e.g., Watercolors, 300gsm paper)">
<input type="hidden" id="promptOfTheDayInput" value="">
</p>
<br>
<button id="saveButton" disabled>Save Image</button>
</div>
<!-- Tab content for Gallery -->
<div id="Gallery" class="tabcontent">
<div id="gallery"></div>
</div>
<div id="myModal" class="modal">
<span class="close">×</span>
<img class="modal-content" id="img01">
<div id="caption"></div>
</div>
<script>
function openTab(evt, tabName) {
var i, tabcontent, tablinks;
// Get all elements with class="tabcontent" and hide them
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
// Get all elements with class="tablinks" and remove the class "active"
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
// Show the current tab, and add an "active" class to the button that opened the tab
document.getElementById(tabName).style.display = "block";
if (evt) { // Check if event object exists
evt.currentTarget.className += " active";
} else { // Programmatically called, find the correct button to activate
for (i = 0; i < tablinks.length; i++) {
if (tablinks[i].textContent === tabName) {
tablinks[i].className += " active";
break;
}
}
}
}
// Open default tab
document.getElementById("defaultOpen").click();
</script>
<script src="renderer.js"></script>
</body>
</html>