Showing
30 changed files
with
315 additions
and
15 deletions
No preview for this file type
11월 1주차 주간보고서.docx
0 → 100644
No preview for this file type
11월 2주차 면담보고서 .docx
0 → 100644
No preview for this file type
11월 3주차 주간보고서.docx
0 → 100644
No preview for this file type
11월 4주차 면담보고서 .docx
0 → 100644
No preview for this file type
12월 1주차 주간보고서.docx
0 → 100644
No preview for this file type
12월 2주차 주간보고서.docx
0 → 100644
No preview for this file type
12월 3주차 면담보고서 .docx
0 → 100644
No preview for this file type
9월 5주차 면담확인서_박진형 복사본.docx
deleted
100644 → 0
No preview for this file type
playwave.py
deleted
100644 → 0
sfsd.py
deleted
100644 → 0
static/app.js
0 → 100644
1 | +import { WaveGroup } from "./wavegroup.js"; | ||
2 | + | ||
3 | +class App{ | ||
4 | + constructor(){ | ||
5 | + this.canvas = document.createElement('canvas'); | ||
6 | + this.ctx = this.canvas.getContext('2d'); | ||
7 | + document.body.appendChild(this.canvas); | ||
8 | + | ||
9 | + this.waveGroup = new WaveGroup(); | ||
10 | + | ||
11 | + window.addEventListener('resize', this.resize.bind(this), false); | ||
12 | + this.resize(); | ||
13 | + | ||
14 | + requestAnimationFrame(this.animate.bind(this)); | ||
15 | + } | ||
16 | + | ||
17 | + resize() { | ||
18 | + this.stageWidth = document.body.clientWidth; | ||
19 | + this.stageHeight = document.body.clientHeight; | ||
20 | + | ||
21 | + this.canvas.width = this.stageWidth * 2; | ||
22 | + this.canvas.height = this.stageHeight * 2; | ||
23 | + this.ctx.scale(2,2); | ||
24 | + | ||
25 | + this.waveGroup.resize(this.stageWidth,this.stageHeight); | ||
26 | + } | ||
27 | + | ||
28 | + animate(t){ | ||
29 | + this.ctx.clearRect(0,0,this.stageWidth,this.stageHeight); | ||
30 | + this.waveGroup.draw(this.ctx); | ||
31 | + requestAnimationFrame(this.animate.bind(this)); | ||
32 | + } | ||
33 | +} | ||
34 | + | ||
35 | +window.onload = () =>{ | ||
36 | + new App(); | ||
37 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
static/point.js
0 → 100644
1 | +export class Point { | ||
2 | + constructor(index, x, y){ | ||
3 | + this.x = x; | ||
4 | + this.y = y; | ||
5 | + this.fixedY = y; | ||
6 | + this.speed = 0.03; | ||
7 | + this.cur = index; | ||
8 | + this.max = Math.random() * 100 +200; | ||
9 | + } | ||
10 | + | ||
11 | + update() { | ||
12 | + this.cur += this.speed; | ||
13 | + this.y = this.fixedY + (Math.sin(this.cur) * this.max); | ||
14 | + } | ||
15 | + | ||
16 | + | ||
17 | + | ||
18 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
static/style.css
0 → 100644
1 | +*{ | ||
2 | + user-select: none; | ||
3 | + -ms-user-select: none; | ||
4 | + outline: 0; | ||
5 | + margin: 0; | ||
6 | + padding: 0; | ||
7 | + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
8 | +} | ||
9 | + | ||
10 | +html { | ||
11 | + width: 100%; | ||
12 | + height: 100%; | ||
13 | +} | ||
14 | + | ||
15 | +body { | ||
16 | + width: 100%; | ||
17 | + height: 100%; | ||
18 | + overflow: hidden; | ||
19 | + background-color: #ffffff; | ||
20 | +} | ||
21 | + | ||
22 | +canvas { | ||
23 | + width: 100%; | ||
24 | + height: 100%; | ||
25 | +} | ||
26 | + | ||
27 | +button { | ||
28 | + width:100px; | ||
29 | + background-color: #f8585b; | ||
30 | + border: none; | ||
31 | + color:#fff; | ||
32 | + padding: 15px 0; | ||
33 | + border-radius:10px; | ||
34 | + text-align: center; | ||
35 | + text-decoration: none; | ||
36 | + display: inline-block; | ||
37 | + font-size: 20px; | ||
38 | + margin: 4px; | ||
39 | + cursor: pointer; | ||
40 | +} |
static/wave.js
0 → 100644
1 | +import { | ||
2 | + Point | ||
3 | +} from './point.js' | ||
4 | +export class Wave { | ||
5 | + constructor(index, totalPoints, color) { | ||
6 | + this.index = index; | ||
7 | + this.totalPoints = totalPoints; | ||
8 | + this.color = color; | ||
9 | + this.points = []; | ||
10 | + } | ||
11 | + | ||
12 | + resize(stageWidth, stageHeight){ | ||
13 | + this.stageWidth = stageWidth; | ||
14 | + this.stageHeight = stageHeight; | ||
15 | + | ||
16 | + this.centerX = stageWidth /2; | ||
17 | + this.centerY = stageHeight /2; | ||
18 | + | ||
19 | + this.pointGap = this.stageWidth/ (this.totalPoints - 1); | ||
20 | + | ||
21 | + | ||
22 | + this.init(); | ||
23 | + | ||
24 | + } | ||
25 | + init(){ | ||
26 | + this.points = []; | ||
27 | + for (let i = 0; i < this.totalPoints; i++){ | ||
28 | + const point = new Point( | ||
29 | + this.index +i, | ||
30 | + this.pointGap * i, | ||
31 | + this.centerY, | ||
32 | + ); | ||
33 | + this.points[i] = point; | ||
34 | + } | ||
35 | + } | ||
36 | + draw(ctx) { | ||
37 | + ctx.beginPath(); | ||
38 | + ctx.fillStyle = this.color; | ||
39 | + let prevX = this.points[0].x; | ||
40 | + let prevY = this.points[0].y; | ||
41 | + | ||
42 | + ctx.moveTo(prevX,prevY); | ||
43 | + for(let i = 1; i < this.totalPoints; i++){ | ||
44 | + if (i < this.totalPoints - 1){ | ||
45 | + this.points[i].update(); | ||
46 | + | ||
47 | + } | ||
48 | + const cx = (prevX + this.points[i].x) / 2; | ||
49 | + const cy = (prevY + this.points[i].y) / 2; | ||
50 | + | ||
51 | + ctx.quadraticCurveTo(prevX, prevY, cx,cy); | ||
52 | + | ||
53 | + prevX = this.points[i].x; | ||
54 | + prevY = this.points[i].y; | ||
55 | + } | ||
56 | + | ||
57 | + ctx.lineTo(prevX,prevY); | ||
58 | + ctx.lineTo(this.stageWidth,this.stageHeight); | ||
59 | + ctx.lineTo(this.points[0].x,this.stageHeight); | ||
60 | + ctx.fill(); | ||
61 | + ctx.closePath(); | ||
62 | + } | ||
63 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
static/wavegroup.js
0 → 100644
1 | +import{ | ||
2 | + Wave | ||
3 | +} from './wave.js' | ||
4 | + | ||
5 | +export class WaveGroup { | ||
6 | + constructor(){ | ||
7 | + this.totalWaves = 3; | ||
8 | + this.totalPoints = 6; | ||
9 | + | ||
10 | + this.color = ['rgba(255,199,235,0.4)','rgba(255,146,199,0.4)','rgba(0,87,158,0.4)']; | ||
11 | + | ||
12 | + this.waves = []; | ||
13 | + | ||
14 | + for (let i = 0; i < this.totalWaves; i++){ | ||
15 | + const wave = new Wave( | ||
16 | + i, | ||
17 | + this.totalPoints, | ||
18 | + this.color[i] | ||
19 | + ); | ||
20 | + this.waves[i] = wave; | ||
21 | + } | ||
22 | + } | ||
23 | + resize(stageWidth, stageHeight){ | ||
24 | + for (let i =0; i < this.totalWaves; i++){ | ||
25 | + const wave = this.waves[i]; | ||
26 | + wave.resize(stageWidth,stageHeight); | ||
27 | + | ||
28 | + } | ||
29 | + } | ||
30 | + draw(ctx){ | ||
31 | + for (let i =0; i < this.totalWaves; i++){ | ||
32 | + const wave = this.waves[i]; | ||
33 | + wave.draw(ctx); | ||
34 | + } | ||
35 | + | ||
36 | + } | ||
37 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
templates/index.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html lang="en"> | ||
3 | + <head> | ||
4 | + <meta charset="UTF-8"> | ||
5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
6 | + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> | ||
7 | + <title>Haptic Recording</title> | ||
8 | + <link rel="stylesheet" href="{{url_for('static', filename = 'style.css')}}"> | ||
9 | + <style> | ||
10 | + #start { | ||
11 | + width:100px; | ||
12 | + background-color: #f8585b; | ||
13 | + border: none; | ||
14 | + color:#fff; | ||
15 | + padding: 15px 0; | ||
16 | + border-radius:10px; | ||
17 | + text-align: center; | ||
18 | + text-decoration: none; | ||
19 | + display: inline-block; | ||
20 | + font-size: 20px; | ||
21 | + margin: 4px; | ||
22 | + cursor: pointer; | ||
23 | + } | ||
24 | + </style> | ||
25 | + </head> | ||
26 | + <body> | ||
27 | + <div style="text-align: center; padding-top: 10%;"> | ||
28 | + <h1>Haptic Data Recording</h1> | ||
29 | + <p style="margin-top: 2%;">Subeen Kang & Jinhyeong Park</p> | ||
30 | + <form method ="post" action="/record"> | ||
31 | + <button style="margin-top: 10%;" type="submit" id="start" > START </button> | ||
32 | + </form> | ||
33 | + </div> | ||
34 | + <script type="module" src="{{url_for('static', filename = 'app.js')}}"></script> | ||
35 | + </body> | ||
36 | +</html> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
templates/record.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | + <head> | ||
4 | + <meta charset="UTF-8"> | ||
5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
6 | + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> | ||
7 | + <title>Haptic Recording</title> | ||
8 | + <link rel="stylesheet" href="{{url_for('static', filename = 'style.css')}}"> | ||
9 | + <style> | ||
10 | + #stop, #home { | ||
11 | + width:100px; | ||
12 | + background-color: #f8585b; | ||
13 | + border: none; | ||
14 | + color:#fff; | ||
15 | + padding: 15px 0; | ||
16 | + border-radius:10px; | ||
17 | + text-align: center; | ||
18 | + text-decoration: none; | ||
19 | + display: inline-block; | ||
20 | + font-size: 20px; | ||
21 | + margin: 4px; | ||
22 | + cursor: pointer; | ||
23 | + } | ||
24 | + </style> | ||
25 | + </head> | ||
26 | + | ||
27 | + <body> | ||
28 | + <div style="text-align: center; padding-top: 10%;"> | ||
29 | + <h1>Converting...</h1> | ||
30 | + <h1 style="margin-top: 2%; color:#f8585b;"id="clock">00:00</h1> | ||
31 | + <form method ="post" action="/stop"> | ||
32 | + <button style="margin-top: 10%;" id="stop" type="submit"> STOP </button> | ||
33 | + </form> | ||
34 | + | ||
35 | + <button style="margin-top: 10%; visibility: hidden;" id="home" type="button" onclick="location.href='/'"> HOME </button> | ||
36 | + | ||
37 | + </div> | ||
38 | + <script type="module" src="{{url_for('static', filename = 'app.js')}}"></script> | ||
39 | + </body> | ||
40 | + | ||
41 | + <script> | ||
42 | + var clockTarget = document.getElementById("clock"); | ||
43 | + var seconds = 0; | ||
44 | + var miliseconds = 0; | ||
45 | + | ||
46 | + function clock() { | ||
47 | + clockTarget .innerText = `${seconds < 10 ? `0${seconds }`: seconds }:${miliseconds < 10 ? `0${miliseconds }` :miliseconds}`; | ||
48 | + miliseconds = miliseconds +1; | ||
49 | + if(miliseconds >99){ | ||
50 | + seconds = seconds +1; | ||
51 | + miliseconds = miliseconds %100; | ||
52 | + } | ||
53 | + } | ||
54 | + | ||
55 | + var inter; | ||
56 | + function init() { | ||
57 | + clock(); | ||
58 | + inter = setInterval(clock, 10); | ||
59 | + } | ||
60 | + | ||
61 | + function stopit(){ | ||
62 | + clearInterval(inter); | ||
63 | + document.getElementById("home").style.visibility="visible"; | ||
64 | + document.getElementById("stop").style.visibility="hidden"; | ||
65 | + } | ||
66 | + | ||
67 | + document.getElementById('stop').addEventListener('click', stopit); | ||
68 | + | ||
69 | + init(); | ||
70 | + </script> | ||
71 | +</html> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
templates/view.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | + <body> | ||
4 | + <div style="text-align: center;"> | ||
5 | + <video controls width="300"> | ||
6 | + <source src="{{url_for('static', filename = 'output.mp4')}}" type="video/mp4"></source> | ||
7 | + 이 문장은 여러분의 브라우저가 video 태그를 지원하지 않을 때 화면에 표시됩니다! | ||
8 | + </video> | ||
9 | + | ||
10 | +</div> | ||
11 | + </body> | ||
12 | +</html> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
test.wav
deleted
100644 → 0
No preview for this file type
test1.wav
deleted
100644 → 0
No preview for this file type
test2.wav
deleted
100644 → 0
No preview for this file type
test3.wav
deleted
100644 → 0
No preview for this file type
~$2 결과보고서.docx
0 → 100644
No preview for this file type
~$월 3주차 면담보고서 .docx
0 → 100644
No preview for this file type
~$월 4주차 면담보고서 복사본.docx
0 → 100644
No preview for this file type
~$코드.docx
0 → 100644
No preview for this file type
시청촉각.docx
deleted
100644 → 0
No preview for this file type
캡디2 결과보고서.docx
0 → 100644
This file is too large to display.
-
Please register or login to post a comment