Skip to content

removed limiter #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
dist/
package-lock.json
node_modules/
.cache/
12 changes: 12 additions & 0 deletions dist/download-png.57be48d1.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/download-png.57be48d1.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="x-ua-compatible" content="ie=edge"><meta name="viewport" content="width=device-width"><meta name="description" content="complicated math equation generator. What is a very complicated math
expression/problem that equals xxx? Enter a solution and get a hard equation that gives that answer."><meta name="keywords" content="math, complicated math, math equation, complicated equation generator, complicated math equation"><title>num2math - Complicated math equation generator</title><link href="styles.0140bd46.css" rel="stylesheet" type="text/css"><script async src="https://www.googletagmanager.com/gtag/js?id=G-W8GSQN5XSZ"></script><script>function a(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],a("js",new Date),a("config","G-W8GSQN5XSZ");</script><script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script><script src="https://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/canvg/1.4/rgbcolor.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/stackblur-canvas/1.4.1/stackblur.min.js"></script><script src="https://cdn.jsdelivr.net/npm/canvg/dist/browser/canvg.min.js"></script><script src="script.9c5c7eab.js"></script><script src="download-png.57be48d1.js"></script></head><body> <div class="menu"> <a href="https://www.buymeacoffee.com/enjeck" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a> <a href="https://github.com/enjeck/num2math"> GitHub</a> </div> <div id="frame"> <div id="mobile-notice"> <span class="close"> x </span> <h3>Mobile Notice</h3> <p> You appear to be on a device with a narrow screen width (i.e you are probably on a mobile device). Due to the nature of mathematics on this site, it best views in landscape mode. On narrow screens, some math expressions may run off the side of the screen (you should be able to scroll to see them) </p> </div> <div class="intro"> <h1>num2math</h1> <h3> A math expression generator. <br>What is a complicated math equation that equals x? Let's find out! </h3> </div> <form id="form"> <label for="input"> Enter an integer between 0 and 1000 inclusive </label> <br> <input id="input" type="number" name="input" required> <br> <div class="lr"> <div class="left"> <input type="checkbox" id="display" checked> <label for="display">Display style</label> </div> <div class="right"> <input type="submit" value="Generate" id="render" name="submit"> </div> </div> </form> <div class="options"> <div> <input type="checkbox" id="gamma-function" name="gamma-function" value="gamma-function" checked> <label for="gamma-function"> Gamma function </label> </div> <div> <input type="checkbox" id="eulers-identity" name="eulers-identity" value="eulers-identity" checked> <label for="eulers-identity"> Euler's identity </label> </div> <div> <input type="checkbox" id="limits-exponential" name="limits-exponential" value="limits-exponential" checked> <label for="limits-exponential"> Exponential Limits </label> </div> <div> <input type="checkbox" id="limits-polynomial" name="limits-polynomial" value="limits-polynomial" checked> <label for="limits-polynomial"> Polynomial Limits </label> </div> <div> <input type="checkbox" id="trig" name="trig" value="trig" checked> <label for="trig"> Trig Identity </label> </div> <div> <input type="checkbox" id="geometric-series" name="geometric-series" value="geometric-series" checked> <label for="geometric-series"> Geometric Series </label> </div> </div> <div id="output"></div> <button id="download-img">Download as PNG</button> <div class="tips"> <h4><em> Tips </em></h4> <ul> <li> There is an endless number of math expressions for every number. Click "Generate" several times for a different output. </li> <li> Right click (or long press if on a mobile device) on an equation to copy the TeX commands or MathML code. </li> </ul> </div> </div> </body></html>
12 changes: 12 additions & 0 deletions dist/script.9c5c7eab.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/script.9c5c7eab.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/styles.0140bd46.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/styles.0140bd46.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 2 additions & 19 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,7 @@
/>
<title>num2math - Complicated math equation generator</title>
<link href="src/styles.css" rel="stylesheet" type="text/css" />

<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-W8GSQN5XSZ"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());

gtag("config", "G-W8GSQN5XSZ");
</script>


<!-- MathJax-->
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script
Expand Down Expand Up @@ -82,9 +67,7 @@ <h3>
<br />
<input
id="input"
type="number"
min="0"
max="1000"
type="integer"
name="input"
required
/>
Expand Down
2 changes: 1 addition & 1 deletion src/download-png.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $(document).ready(function () {

// Convert SVG data to PNG image
canvas.toBlob(function (blob) {
download(`complicated-equation-that-equals-${number}.png`, blob);
download(`complicated-equation-that-equals-${number}.tif`, blob);
});
},
});
Expand Down
8 changes: 4 additions & 4 deletions src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ $(document).ready(function () {
var number = document.getElementById("input").value;

// Validating input
if (isNaN(number) || number === "" || number > 1000 || number < 0) {
return;
}
if (isNaN(number) || number === "") {
return;
}

// Checkboxes

Expand All @@ -47,7 +47,7 @@ $(document).ready(function () {
}

function isPrime(n) {
if (n <= 1) return false; // handling negatives
if (n <= 1) return true; // allow negatives
if (n % 2 == 0 && n > 2) return false; // handling even numbers
const s = Math.sqrt(n); // store the square to loop faster
for (let i = 3; i <= s; i += 2) {
Expand Down