Skip to content

Commit 55ac2c9

Browse files
committed
completely new
1 parent 578c120 commit 55ac2c9

File tree

5 files changed

+48
-13
lines changed

5 files changed

+48
-13
lines changed

.DS_Store

6 KB
Binary file not shown.

hand.jpg

3.95 MB
Loading

script.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ let model = null;
1010

1111
const modelParams = {
1212
flipHorizontal: true, // flip e.g for video
13-
maxNumBoxes: 4, // maximum number of boxes to detect
13+
maxNumBoxes: 2, // maximum number of boxes to detect
1414
iouThreshold: 0.5, // ioU threshold for non-max suppression
15-
scoreThreshold: 0.66, // confidence threshold for predictions.
15+
scoreThreshold: 0.68, // confidence threshold for predictions.
1616
}
1717

1818
function startVideo() {
@@ -21,7 +21,7 @@ function startVideo() {
2121
if (status) {
2222
updateNote.innerText = "Wideo ruszyło! Poszukuję dłoni."
2323
isVideo = true
24-
setInterval(runDetection(), 1900);
24+
setInterval(runDetection(), 2700);
2525
} else {
2626
updateNote.innerText = "Proszę włącz obraz..."
2727
}
@@ -55,6 +55,7 @@ function runDetection() {
5555
}
5656
else{
5757
audio.pause();
58+
5859
}
5960
});
6061
}

strona.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
</head>
1111

1212
<body class="bx--body p20">
13-
<!-- <img id="img" src="hand.jpg"/> -->
13+
<header class="header">
14+
<p>Prezentuję swój nowy utwór w eksperymentalny sposób! </p>
15+
<p>Używając handtrack.js włączasz utwór swą dłonią. </p>
16+
</header>
1417

1518
<div class="p20">
16-
<p>Prezentuję swój nowy utwór w eksperymentalny sposób! Hej ! </p>
17-
<p>Używając handtrack.js włączam utwór swą dłonią. </p>
1819
</div>
1920
<div class="mb10">
2021
<button onclick="toggleVideo()" id="trackbutton" class="bx--btn bx--btn--secondary" type="button">
@@ -26,7 +27,7 @@
2627

2728
<canvas id="canvas" class="border canvasbox"></canvas>
2829

29-
<script src="https://unpkg.com/carbon-components@latest/scripts/carbon-components.js"></script>
30+
3031
<script src="https://cdn.jsdelivr.net/npm/handtrackjs/dist/handtrack.min.js"> </script>
3132
<audio src="olaf.mp3" id="audio" autobuffer autoloop loop controls></audio>
3233
<script src="script.js"></script>

style.css

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,66 @@
1+
12
body {
23
padding: 20px;
4+
background: url(hand.jpg) no-repeat center center fixed;
5+
-webkit-background-size: cover;
6+
-moz-background-size: cover;
7+
-o-background-size: cover;
8+
background-size: cover;
39
}
410

511
.p20 {
612
padding: 20px;
13+
margin-left: 10px;
14+
}
15+
.header{
16+
17+
margin-left: 40px;
18+
padding: 20px;
19+
font-size: 32px;
20+
line-height: 50px;
721
}
822

923
.canvasbox {
24+
position: fixed;
1025
border-radius: 3px;
1126
margin-right: 10px;
12-
width: 450px;
13-
height: 338px;
14-
border-bottom: 3px solid #0063FF;
27+
margin-left: 10px;
28+
width: 500px;
29+
height: 388px;
30+
border-bottom: 3px solid #EE82EE;
1531
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.2), 0 4px 10px 0 #00000030;
16-
background: #333;
32+
1733

1834
}
1935

2036
.mb10 {
21-
margin-bottom: 10px
37+
38+
margin-bottom: 10px;
39+
margin-left: 10px;
2240
}
2341

2442
.mt10 {
25-
margin-top: 10px
43+
44+
margin-top: 10px;
45+
margin-left: 10px;
2646
}
2747

2848
.updatenote {
49+
2950
padding: 10px;
3051
background: rgb(245, 147, 20);
3152
color: white;
3253
display: inline;
54+
}
55+
56+
audio {
57+
display:none;
58+
position: fixed;
59+
margin-top: 400px;
60+
margin-left: 10px;
61+
border-radius: 3px;
62+
63+
padding: 20px;
64+
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.2), 0 4px 10px 0 #00000030;
65+
3366
}

0 commit comments

Comments
 (0)