-
Notifications
You must be signed in to change notification settings - Fork 0
/
vg.html
160 lines (140 loc) · 4.82 KB
/
vg.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Virtual Try-On Glasses</title>
<style>
body {
font-family: PT Serif, Georgia, Times New Roman, Times, serif;
margin: 0;
padding: 0;
background-color: #f5f5f5;
}
header {
background-color: #672b7a;
color: #fff;
padding: 10px 20px;
text-align: center;
font-size: larger;
}
.product-page {
display: flex;
margin: 20px;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.product-images {
flex: 1;
text-align: center;
position: relative;
max-width: 50%;
}
#content {
width: 500px;
height: 500px;
background-color: #eaeaea;
border-radius: 10px;
position: relative;
}
canvas, video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover; /* Fill the container while maintaining aspect ratio */
}
.product-details {
flex: 2;
margin-left: 20px;
}
.product-details h1 {
font-size: 40px;
margin: 0 0 10px;
}
.product-details p {
margin: 10px 0;
color: #666;
font-size: 30px;
}
.price {
color: #e74c3c;
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
.add-to-cart, .try-on {
display: inline-block;
padding: 10px 20px;
text-transform: uppercase;
border: none;
cursor: pointer;
border-radius: 5px;
margin-top: 20px;
font-size: 20px;
}
.add-to-cart {
background-color: #27ae60;
color: #fff;
}
.add-to-cart:hover {
background-color: #219150;
}
.try-on {
margin-left: 10px;
background-color: #3498db;
color: #fff;
}
.try-on:hover {
background-color: #2980b9;
}
footer {
background-color: #7a7878;
color: #0f0b0b;
text-align: center;
padding: 1px 0;
margin-top: 20px;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
font-size: small;
}
</style>
</head>
<body>
<header>
<h2>Virtual Try-On Glasses</h2>
</header>
<div class="product-page">
<div class="product-images">
<div id="content">
<video id="video" autoplay></video>
<canvas id="canvas"></canvas>
</div>
</div>
<div class="product-details">
<h2>Blue Round Rimmed Eyeglasses</h2>
<p style="font-size: 18px;">Unisex, Fastrack FT1510UFA1MBLV</p>
<p class="price">$120</p>
<h4 style="font-size: 16px;">Stylish blue round rimmed eyeglasses for both men and women. Designed with precision to provide you with the best look and comfort.</h4>
<button class="add-to-cart">Add to Cart</button>
<button class="try-on" id="tryOnButton"><img src="image.png" alt="Try On Icon" height="20px" width="20px" style="vertical-align: middle; margin-right: 5px;"> Try On</button>
</div>
</div>
<footer>
<p>© 2024 LensLab. All rights reserved.</p>
</footer>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/facemesh"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/loaders/OBJLoader.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/loaders/MTLLoader.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/loaders/GLTFLoader.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/controls/OrbitControls.js"></script>
<script src="app.js"></script>
</body>
</html>