-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPractice.html
62 lines (57 loc) · 2.49 KB
/
Practice.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Generated by Codia AI</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400&display=swap" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400&display=swap" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400&display=swap" />
<link rel="stylesheet" href="assets/css/Index.css" />
</head>
<body>
<div class="main-container">
<div class="flex-row-de">
<div class="square"></div>
<div class="rectangle">
</div>
</div>
<div class="flex-row-b">
<span class="span-pick-radius">Pick a radius <br />(eps)</span>
<span class="span-pick-number">Pick number of close points <br />(min_sample)</span>
</div>
<div class="flex-row-ef">
<!-- Slider 1 with 5 values -->
<input type="range" class="slider" id="slider-radius" min="0" max="4" step="1" value="2" />
</div>
<div class="flex-row-ef-2">
<!-- Slider 2 with 5 values -->
<input type="range" class="slider" id="slider-points" min="0" max="4" step="1" value="2" />
</div>
<div class="rectangle-3">
<!-- Placeholder for the dynamic photo -->
<img id="dynamic-photo" src="assets/used/2_2.png" class="photo" />
</div>
<button class="frame"><span class="run">Run</span></button>
</div>
<script src="script.js"></script>
<script>
const sliderRadius = document.getElementById("slider-radius");
const sliderPoints = document.getElementById("slider-points");
const dynamicPhoto = document.getElementById("dynamic-photo");
const runButton = document.querySelector(".frame"); // Select the 'Run' button
console.log(runButton);
// Function to update the photo based on slider values when "Run" is clicked
function updatePhoto() {
const radiusValue = sliderRadius.value;
const pointsValue = sliderPoints.value;
// Construct the image file name based on the slider values
const imageName = `assets/used/${radiusValue}_${pointsValue}.png`;
// Update the src attribute of the image
dynamicPhoto.src = imageName;
}
// Add event listener to the "Run" button
runButton.addEventListener("click", updatePhoto);
</script>
</body>
</html>