-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.html
140 lines (120 loc) · 3.68 KB
/
home.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Central Object Properties Modal</title>
<style>
body {
font-family: Arial, sans-serif;
}
/* Modal container */
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
justify-content: center;
align-items: center;
}
/* Modal content */
.modal-content {
background-color: #fefefe;
padding: 20px;
border-radius: 10px;
width: 400px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
/* Close button */
.close {
float: right;
font-size: 24px;
cursor: pointer;
}
/* Input fields styling */
input[type="text"], input[type="number"], input[type="file"] {
width: 100%;
padding: 10px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
label {
font-weight: bold;
}
/* Submit button styling */
.submit-btn {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
.submit-btn:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<!-- Button to open the modal -->
<button id="openModalBtn">Set Central Object Properties</button>
<!-- The Modal -->
<div id="centralObjectModal" class="modal">
<div class="modal-content">
<span class="close" id="closeModal">×</span>
<h2>Set Central Object Properties</h2>
<form id="centralObjectForm">
<label for="height">Height of Column:</label>
<input type="number" id="height" name="height" placeholder="Enter column height (e.g., 20)">
<label for="texture">Texture:</label>
<input type="file" id="texture" name="texture" accept="image/*">
<label for="model">3D Model (optional):</label>
<input type="file" id="model" name="model" accept=".obj, .gltf, .fbx">
<button type="submit" class="submit-btn">Submit</button>
</form>
</div>
</div>
<script>
// Get the modal and button elements
const modal = document.getElementById("centralObjectModal");
const openModalBtn = document.getElementById("openModalBtn");
const closeModal = document.getElementById("closeModal");
// Open the modal when the button is clicked
openModalBtn.onclick = function() {
modal.style.display = "flex";
}
// Close the modal when the close button is clicked
closeModal.onclick = function() {
modal.style.display = "none";
}
// Close the modal if the user clicks outside of the modal content
window.onclick = function(event) {
if (event.target === modal) {
modal.style.display = "none";
}
}
// Handle form submission
const form = document.getElementById("centralObjectForm");
form.onsubmit = function(event) {
event.preventDefault();
const height = document.getElementById("height").value;
const texture = document.getElementById("texture").files[0];
const model = document.getElementById("model").files[0];
console.log("Central Object Properties:");
console.log("Height of Column:", height);
console.log("Texture File:", texture);
console.log("Model File:", model);
// Process the input data as needed (e.g., apply changes in Three.js scene)
// Close the modal after submission
modal.style.display = "none";
}
</script>
</body>
</html>