-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaps.html
More file actions
111 lines (105 loc) · 3.57 KB
/
maps.html
File metadata and controls
111 lines (105 loc) · 3.57 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Product Location in Store</title>
<style>
h1
{
margin-bottom: 30px;
background-color: beige;
border-radius: 20px;
color: brown;
}
body {
font-family: Arial, sans-serif;
text-align: center;
padding: 20px;
background-color: lightgreen;
}
.product-container {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 20px;
}
.product {
position: relative;
display: inline-block;
}
.product img {
width: 150px;
height: 150px;
object-fit: cover;
border-radius: 8px;
cursor: pointer;
transition: transform 0.3s;
}
.product img:hover {
transform: scale(1.05);
}
.product .location {
display: none;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
background-color: rgba(0, 128, 0, 0.8);
color: white;
padding: 10px;
border-radius: 8px;
white-space: nowrap;
}
.product:hover .location {
display: block;
}
</style>
</head>
<body>
<h1>Find Product Location in Store</h1>
<!-- Product Images -->
<div class="product-container">
<div class="product" onmouseover="showLocation('Oil')">
<img src="oil.webp" alt="Oil">
<div class="location" id="Oil-location"></div>
</div>
<div class="product" onmouseover="showLocation('Kids Wear')">
<img src="kidswear.webp" alt="Kids Wear">
<div class="location" id="Kids-Wear-location"></div>
</div>
<div class="product" onmouseover="showLocation('Wheat')">
<img src="wheat.jpeg" alt="Wheat">
<div class="location" id="Wheat-location"></div>
</div>
<div class="product" onmouseover="showLocation('Appliance')">
<img src="appliance.jpg" alt="Appliance">
<div class="location" id="Appliance-location"></div>
</div>
<div class="product" onmouseover="showLocation('Men\'s Wear')">
<img src="menswear.jpeg" alt="Men's Wear">
<div class="location" id="Mens-Wear-location"></div>
</div>
</div>
<script>
// Sample location data for products in the store
const productLocations = [
{ name: "Oil", floor: 1, lane: "A", rack: 5 },
{ name: "Kids Wear", floor: 2, lane: "B", rack: 3 },
{ name: "Wheat", floor: 1, lane: "C", rack: 2 },
{ name: "Appliance", floor: 3, lane: "A", rack: 7 },
{ name: "Men's Wear", floor: 2, lane: "D", rack: 1 }
];
function showLocation(productName) {
const product = productLocations.find(p => p.name === productName);
const locationDiv = document.getElementById(`${productName.replace(/'/g, '').replace(/\s+/g, '-')}-location`);
if (product) {
locationDiv.textContent = `Floor ${product.floor}, Lane ${product.lane}, Rack ${product.rack}`;
} else {
locationDiv.textContent = "Location not found.";
locationDiv.style.backgroundColor = "red";
}
}
</script>
</body>
</html>