-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from aras-digital/feature/iframe-added
iframe added
- Loading branch information
Showing
3 changed files
with
179 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Parent Page</title> | ||
</head> | ||
<body> | ||
<h1>Ana Sayfa</h1> | ||
<iframe src="zbar-wasm/index.html" style="width: 600px; height: 400px;"></iframe> | ||
<script> | ||
window.addEventListener('message', (event) => { | ||
alert(`İframe'den gelen mesaj: ${event.data.value}`); | ||
}, false); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,96 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, minimum-scale=0.9"> | ||
<style> | ||
.container { | ||
margin-top: 1em; | ||
} | ||
h5, p { | ||
margin-top: 0.5em; | ||
} | ||
label { | ||
display: inline-block; | ||
} | ||
.viewport { | ||
display: inline-block; | ||
position: relative; | ||
width: 100%; | ||
} | ||
img, video { | ||
max-width: 100%; | ||
height: auto; | ||
} | ||
#canvas { | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
pre { | ||
font-size: 1.35rem; | ||
white-space: pre-wrap; | ||
word-wrap: break-word; | ||
margin-top: 0; | ||
} | ||
#timing.visible { | ||
display: block; | ||
} | ||
#timing { | ||
display: none; | ||
} | ||
</style> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, minimum-scale=0.9"> | ||
<style> | ||
.container { | ||
margin-top: 1em; | ||
} | ||
|
||
h5, | ||
p { | ||
margin-top: 0.5em; | ||
} | ||
|
||
label { | ||
display: inline-block; | ||
} | ||
|
||
.viewport { | ||
display: inline-block; | ||
position: relative; | ||
} | ||
|
||
img, | ||
video, | ||
#note, | ||
#timing { | ||
max-width: 100%; | ||
} | ||
|
||
#imgUrl { | ||
width: 25em; | ||
max-width: 100%; | ||
} | ||
|
||
#imgUrl.active { | ||
color: #ffffff; | ||
background-color: #33C3F0; | ||
} | ||
|
||
#imgUrl.active~.viewport>#img, | ||
#imgUrl.active~#note, | ||
#imgBtn.button-primary~.viewport>#img, | ||
#videoBtn.button-primary~.viewport>#video, | ||
#timing.visible { | ||
display: block; | ||
} | ||
|
||
#canvas { | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
#encoding { | ||
margin-right: 1em; | ||
} | ||
|
||
pre { | ||
font-size: 1.35rem; | ||
white-space: pre-wrap; | ||
word-wrap: break-word; | ||
margin-top: 0; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div class="viewport"> | ||
<canvas id="canvas"></canvas> | ||
<img id="img" crossorigin="anonymous" style="display:none;"> | ||
<video id="video" muted autoplay playsinline></video> | ||
</div> | ||
<h5>Result</h5> | ||
<div class="row"> | ||
<pre id="result" class="six columns"></pre> | ||
<div class="six columns"> | ||
<div id="timing"> | ||
Using <code>OffscreenCanvas</code> for image transfer: <span id="usingOffscreenCanvas"></span><br> | ||
Time since previous scan: <span id="waitingTime"></span> ms<br> | ||
<code>drawImage()</code>: <span id="drawImageTime"></span> ms<br> | ||
<code>getImageData()</code>: <span id="getImageDataTime"></span> ms<br> | ||
<code>scanImageData()</code>: <span id="scanImageDataTime"></span> ms | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<div class="viewport"> | ||
<canvas id="canvas" style="width: 100%;"></canvas> | ||
<img id="img" crossorigin="anonymous"> | ||
<video id="video" muted autoplay playsinline></video> | ||
</div> | ||
<div class="row"> | ||
<pre id="result" class="six columns"></pre> | ||
|
||
<div class="six columns"> | ||
<div id="timing"> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
<script type="module" src="js/utils.js"></script> | ||
<script type="module" src="js/scanner.js"></script> | ||
<script type="module" src="js/app.js"></script> | ||
</div> | ||
|
||
<script src="dist/index.js"></script> | ||
<script src="js/main.js"></script> | ||
|
||
</body> | ||
</html> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters