summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-27 20:21:58 -0400
committerpommicket <pommicket@gmail.com>2023-08-27 20:22:41 -0400
commitf790b4e1baa5dfe1296cf0887011583bee7afca8 (patch)
treea5cbcc3558f39bd3754dfceb9e4ba9f3d4dc0c28
parent9e0ac08aa6d804fae327cd3ec4850aa0dcdbde6f (diff)
minimum, maximum
-rw-r--r--README.md2
-rw-r--r--credits.txt1
-rw-r--r--index.html12
-rw-r--r--pugl.js28
-rw-r--r--style.css8
5 files changed, 39 insertions, 12 deletions
diff --git a/README.md b/README.md
index aaf458f..16271ef 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@
online shader thingamabob
+the main files of interest are `index.html` and `pugl.js`.
+
### JS features
i have been pretty liberal about using modern javascript;
diff --git a/credits.txt b/credits.txt
deleted file mode 100644
index 94ffb57..0000000
--- a/credits.txt
+++ /dev/null
@@ -1 +0,0 @@
-https://commons.wikimedia.org/wiki/File:Long-beakedEchidna.jpg
diff --git a/index.html b/index.html
index e82cd4b..be3525b 100644
--- a/index.html
+++ b/index.html
@@ -9,8 +9,8 @@
<link rel="stylesheet" href="style.css">
</head>
-<body>
-<script src="pugl.js"></script>
+<body class="no-margin overflow-hidden">
+<script src="pugl.js" async></script>
<noscript>
<p>
This page requires JavaScript to function.<br>
@@ -80,14 +80,16 @@
<h2>about pugl</h2>
<hr>
<p>
- Lorem ipsum dolor sit amet
+ pugl is a tool that lets you create &amp; share shaders without writing any code.
+ </p>
+ <p>
+ to learn how to use pugl, check out <a href="guide/index.html" target="_blank">the guide</a>.
</p>
<h3>credits</h3>
<hr>
<p>
icon based on
- <a href="https://commons.wikimedia.org/wiki/File:Long-beakedEchidna.jpg
-">Long-beakedEchidna.jpg from WikiMedia</a>
+ <a href="https://commons.wikimedia.org/wiki/File:Long-beakedEchidna.jpg" target="_blank">Long-beakedEchidna.jpg from WikiMedia</a>
CC BY-SA 3.0.
</p>
<p>
diff --git a/pugl.js b/pugl.js
index 2448271..f1744dd 100644
--- a/pugl.js
+++ b/pugl.js
@@ -3,10 +3,6 @@
/*
TODO:
- guide
-- about dialog
-- widgets:
- - min
- - max
*/
const APP_ID = 'dh3YgVZQdX1Q';
@@ -911,6 +907,30 @@ float worley(vec3 p, vec3 freq) {
return sqrt(sqd);
}
`,
+ `
+//! .name: Minimum
+//! .description: minimum of two values
+//! .category: math
+//! .id: min
+` +
+ GLSL_FLOAT_TYPES.map(
+ (type) => `
+${type} _min(${type} x, ${type} y) {
+ return min(x, y);
+}`,
+ ).join('\n'),
+ `
+//! .name: Maximum
+//! .description: maximum of two values
+//! .category: math
+//! .id: max
+` +
+ GLSL_FLOAT_TYPES.map(
+ (type) => `
+${type} _max(${type} x, ${type} y) {
+ return max(x, y);
+}`,
+ ).join('\n'),
];
function auto_update_enabled() {
diff --git a/style.css b/style.css
index 8b8e643..6d21621 100644
--- a/style.css
+++ b/style.css
@@ -5,9 +5,7 @@
body {
font-family: sans-serif;
- margin: 0;
padding: 0;
- overflow: hidden;
}
body,
dialog {
@@ -254,3 +252,9 @@ input[type='number'] {
.no-wrap {
whitespace: no-wrap;
}
+.no-margin {
+ margin: 0;
+}
+.overflow-hidden {
+ overflow: hidden;
+}