Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
jcponce committed Feb 26, 2024
1 parent 01ce37b commit d7aa146
Show file tree
Hide file tree
Showing 12 changed files with 3,285 additions and 5 deletions.
Binary file modified .DS_Store
Binary file not shown.
8 changes: 7 additions & 1 deletion 3d-plotter/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,14 @@
</div>
</div>

<br/>
<div>
<input type="button" id="createLink" value="Create Link"><br>
</div>

<hr style="border: 1px solid rgb(78, 78, 78);" />


<div>
<span style="text-decoration: none;" class="about showHelp">About this program</span><br>
</div>
Expand Down Expand Up @@ -241,7 +247,7 @@ <h3><strong>About</strong></h3>
This program was originally created by
<a class="w3-hover-text-light-blue w3-text-indigo" href="https://replit.com/@DavidBrock1" target="_blank">David
Brock</a>. The source code is available in
<a class="w3-hover-text-light-blue w3-text-indigo" href="https://replit.com/@DavidBrock1/complexplotter#main.js"
<a class="w3-hover-text-light-blue w3-text-indigo" href="https://replit.com/@DavidBrock1/complexplotter#index.html"
target="_blank">replit</a>.

</p>
Expand Down
21 changes: 19 additions & 2 deletions 3d-plotter/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ function initEquation() {
}
});

$("#createLink").click(function () {
var search = "?equation=" + encodeURIComponent(graph.currEquation);
var url = location.href.split("?")[0] + search;

prompt("Use this URL to shere or save the current equation.", url);
});

function update() {
const equation = equationInput.val();
const plot = graph.objects.plot;
Expand Down Expand Up @@ -581,9 +588,19 @@ function animate() {
requestAnimationFrame(animate);
};

//function readURLParms() {
// var hash = decodeURIComponent(location.hash.substring(1)); //"substr" is deprecated
// if (hash.length > 1) $("#equations").val(hash);
//}

function readURLParms() {
var hash = decodeURIComponent(location.hash.substring(1)); //"substr" is deprecated
if (hash.length > 1) $("#equations").val(hash);
location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) {
value = decodeURIComponent(value);
if (key == "equation") {
graph.currEquation = value;
$("#equations").val(value);
}
});
}

$(window).resize(onResize);
Expand Down
4 changes: 2 additions & 2 deletions 3d-plotter/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ h1, h2, h3, p {
background: rgb(231, 231, 231) !important;
border-radius: 5px;
overflow: auto;
line-height: 20px;
line-height: 18px;
z-index: 1;
font-size: 16px;
font-size: 16px !important;
transition: height 0.3s ease, width 0.3s ease;
}

Expand Down
Loading

0 comments on commit d7aa146

Please sign in to comment.