Skip to content

Commit

Permalink
Add iframe demo
Browse files Browse the repository at this point in the history
  • Loading branch information
hbruch committed Nov 29, 2024
1 parent 7d3c76f commit 1beb0ea
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ module.exports = function(grunt) {
src: 'src/tiny.html',
dest: 'dist/tiny.html'
},
iframedemo: {
src: 'src/iframe.html',
dest: 'dist/iframe.html'
},
},
watch: {
files: ['Gruntfile.js', 'src/**/*.js', 'src/**/*.css', 'src/**/*.html', 'src/**/*.html', 'images/*', 'test/**/*.js'],
Expand Down
13 changes: 13 additions & 0 deletions src/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,19 @@ <h4>JavaScript code</h4>

</section>

<section>

<h2 class="mt-5">Address box via IFrame</h2>

<h4>HTML code</h4>
<pre>&lt;iframe src="iframe.html?address=Marktplatz 5, 71083 Herrenberg&name=Rathaus&lat=48.5965246&lon=8.8704940"
width="100%" height="500" title="Adress Box IFrame Demo"/&gt;</pre>

<div id='widget-6' class="stadtnavi-widget">
<iframe src="iframe.html?address=Marktplatz 5, 71083 Herrenberg&name=Rathaus&lat=48.5965246&lon=8.8704940" width="100%" height="500" title="Adress Box IFrame Demo"/>
</div>
</section>

</main>


Expand Down
38 changes: 38 additions & 0 deletions src/iframe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<title>stadtnavi</title>

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- widget imports -->
<link rel="stylesheet" href="latest/stadtnavi-widget.css"/>
<script src="latest/stadtnavi-widget.js"></script>
<style>
body {
margin: 0px;
}
.stadtnavi-widget {
width: 100%;
height: 100vh;
}
</style>

</head>
<body>
<div id='widget' class="stadtnavi-widget"></div>

<script type="text/javascript">
let params = new URLSearchParams(document.location.search);
new StadtnaviAddressBox('widget', params.get("name"), params.get("address"), {
pinPrimaryColor: params.get("pinPrimaryColor") || "#9FC727",
pinSecondaryColor: params.get("pinSecondaryColor") || "#FFFFFF",
},
params.get("lat"),
params.get("lon"));
</script>
</body>
</html>


0 comments on commit 1beb0ea

Please sign in to comment.