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 id="secondValue"></span>
</span> </span>
<br> <br>
<a id="download" onclick="downloadCanvasCommon('collatzConjecture', canvas)">Download</a> <a id="download" onclick="downloadCanvasCommon()">Download</a>
<br> <br>
<canvas id="canvas"></canvas> <canvas id="canvas"></canvas>

View File

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

View File

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