collatzConjecture: fixing download button

dotLines: fixing controls
This commit is contained in:
Sheldan
2025-08-09 00:00:43 +02:00
parent 8c86e89470
commit 8a6e3b86df
3 changed files with 19 additions and 5 deletions

View File

@@ -51,7 +51,7 @@ Beware of ... interesting outcomes as this can cause the created tree to become
<span id="secondValue"></span>
</span>
<br>
<a id="download" onclick="downloadCanvasCommon('collatzConjecture', canvas)">Download</a>
<a id="download" onclick="downloadCanvasCommon()">Download</a>
<br>
<canvas id="canvas"></canvas>

View File

@@ -25,14 +25,21 @@
left: 150px;
top: 3px;
}
.controls {
position: absolute;
top: 0px;
right: 10px
}
</style>
</head>
<body>
<div id="content">
<canvas id="canvas" ></canvas>
<input type="button" class="top" id="pauseBtn" value="pause" onclick="pause()" />
<input type="button" class="top" id="showAllBtn" value="show all" onclick="showAll()" />
<a id="download" class="top" onclick="downloadCanvasCommon('dotLines', canvas)">Download</a> <br>
<div class="controls">
<input type="button" class="top" id="pauseBtn" value="pause" onclick="pause()" />
<input type="button" class="top" id="showAllBtn" value="show all" onclick="showAll()" />
<a id="download" class="top" onclick="downloadCanvasCommon()">Download</a> <br>
</div>
</div>
<script type="module" src="js/main.js"></script>

View File

@@ -1,5 +1,5 @@
import {
docReady, getMousePos, pointDistance, roundedRandom
docReady, downloadCanvasWithoutButton, getMousePos, pointDistance, roundedRandom
} from "canvas-common";
@@ -166,4 +166,11 @@ docReady(function () {
});
function downloadCanvasDotlines() {
downloadCanvasWithoutButton('dotLines', canvas);
}
window.downloadCanvasCommon = downloadCanvasDotlines;
window.pause = pause;
window.showAll = showAll;