Skip to content
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

remove build step and uuid dependency #35

Open
wants to merge 2 commits into
base: master
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
1 change: 0 additions & 1 deletion dist/verly.bundle.js

This file was deleted.

7 changes: 0 additions & 7 deletions dist/verly.bundle.js.map

This file was deleted.

13 changes: 13 additions & 0 deletions docs/styles/iframe.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.bd__button {
padding: 10px 0;
text-align: right;
}
.bd__button > a{
font-weight: 100;
text-decoration: none;
color: #BDC3CB;
font-family: sans-serif;
}
.bd__button > a:hover {
color: #798897;
}
44 changes: 44 additions & 0 deletions docs/styles/reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* reset css */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
2 changes: 1 addition & 1 deletion examples/accessibility/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<body>
<canvas id="c"></canvas>
<script src="../../dist/verly.bundle.js"></script>
<script type="module" src="../../src/app.js"></script>

<script>
window.onload = function () {
Expand Down
2 changes: 1 addition & 1 deletion examples/behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<body>

<canvas id="c"></canvas>
<script src="../dist/verly.bundle.js"></script>
<script type="module" src="../src/app.js"></script>
<script>

window.onload = function () {
Expand Down
2 changes: 1 addition & 1 deletion examples/behavior2.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<body>

<canvas id="c"></canvas>
<script src="../dist/verly.bundle.js"></script>
<script type="module" src="../src/app.js"></script>

<script>
window.onload = function () {
Expand Down
2 changes: 1 addition & 1 deletion examples/dynamicCustomMesh.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<body>

<canvas id="c"></canvas>
<script src="../dist/verly.bundle.js"></script>
<script type="module" src="../src/app.js"></script>

<script>

Expand Down
2 changes: 1 addition & 1 deletion examples/fluidGyroscope.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<body>

<canvas id="c"></canvas>
<script src="../dist/verly.bundle.js"></script>
<script type="module" src="../src/app.js"></script>
<script>

window.onload = function () {
Expand Down
2 changes: 1 addition & 1 deletion examples/joinEntities.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<body>

<canvas id="c"></canvas>
<script src="../dist/verly.bundle.js"></script>
<script type="module" src="../src/app.js"></script>
<script>

window.onload = function () {
Expand Down
2 changes: 1 addition & 1 deletion examples/ragdoll.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<body>

<canvas id="c"></canvas>
<script src="../dist/verly.bundle.js"></script>
<script type="module" src="../src/app.js"></script>

<script>

Expand Down
10 changes: 5 additions & 5 deletions examples/rotatingEntity.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

<canvas id="c"></canvas>

<script src="../dist/verly.bundle.js"></script>
<script src="../src/Objects.js"></script>
<script>
<script type="module" src="../src/app.js"></script>
<script type="module">
import { Box } from "../src/Objects.js"

window.onload = function () {
let canvas = document.getElementById('c');
Expand All @@ -45,7 +45,7 @@
b1.setGravity(new Vector())
verly.addEntity(b1);

for (p of b1.points) {
for (const p of b1.points) {
let absSize = new Vector(b1.width / 2, b1.height / 2);
let boxcenter = new Vector(b1.x - absSize.x, b1.y - absSize.y);
let rot = radians(25);
Expand All @@ -57,7 +57,7 @@
b2.setGravity(new Vector())
verly.addEntity(b2);

for (p of b2.points) {
for (const p of b2.points) {
let absSize = new Vector(b2.width / 2, b2.height / 2);
let boxcenter = new Vector(b2.x - absSize.x, b2.y - absSize.y);
let rot = radians(-25);
Expand Down
2 changes: 1 addition & 1 deletion examples/shadedCloth.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<canvas id="c"></canvas>

<script src="../dist/verly.bundle.js"></script>
<script type="module" src="../src/app.js"></script>

<script>

Expand Down
3 changes: 3 additions & 0 deletions examples/ship/Ship.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ class Ship extends Point {
this.heading += this.rotation;
};
}

export default Ship

6 changes: 3 additions & 3 deletions examples/ship/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
gtag('js', new Date());
gtag('config', 'UA-119972196-1');
</script>

<script type="module" src="../../src/app.js"></script>
</head>

<body>
Expand All @@ -75,10 +77,8 @@
<span>hit Q to disconnect</span>
</div>

<script src="../../dist/verly.bundle.js"></script>
<script src="../typography/Text.js"></script>
<script src="./Ship.js"></script>
<script src="./index.js"></script>
<script type="module" src="./index.js"></script>
</body>

</html>
2 changes: 2 additions & 0 deletions examples/ship/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Ship from './Ship.js'


window.onload = function () {
let canvas = document.getElementById('c');
Expand Down
2 changes: 1 addition & 1 deletion examples/text/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<canvas id="c"></canvas>
</div>

<script src="../../dist/verly.bundle.js"></script>
<script type="module" src="../../src/app.js"></script>
<script src="./index.js"></script>
</body>

Expand Down
6 changes: 5 additions & 1 deletion examples/typography/Text.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

class Text {
constructor(alphabets, x, y, fontsize, verlyInstance) {
this.alphabets = alphabets.toUpperCase().split('');
Expand Down Expand Up @@ -39,4 +40,7 @@ class Text {

return this; // return for chaining
}
}
}


export default Text;
59 changes: 56 additions & 3 deletions examples/typography/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,68 @@
/* outline: 1px solid black; */
}
</style>

<script type="module" src="../../src/app.js"></script>
</head>

<body>

<canvas id="c"></canvas>

<script src="../../dist/verly.bundle.js"></script>
<script src="./Text.js"></script>
<script src="./index.js"></script>
<script type="module">
import Text from '/examples/typography/Text.js';


/**
* Verlet Typography
* @author <hazru.anurag@gmail.com>
*/

window.onload = function () {
let canvas = document.getElementById('c');
let ctx = canvas.getContext('2d');
let width = clamp(window.innerWidth, 1200, Infinity);
let height = window.innerHeight;
canvas.width = width;
canvas.height = height;
let verly = new Verly(50, canvas, ctx);

// URL = undefined;

let urlText = 'HAPPY';
let urlText2 = 'HOLI';
// check support
if ('URL' in window && URL !== undefined) {
let url = new URL(window.location.href);
let query_string = url.search;
let search_params = new URLSearchParams(query_string);
urlText = search_params.get('text') || 'HAPPY';
urlText2 = search_params.get('text2') || 'HOLI';
}

let word = new Text(urlText, 50, 100, 25, verly);
let word2 = new Text(urlText2, 700, 100, 25, verly);

// let A = new TypoGraphy(offsetX, center, 20, 'A');

verly.addEntity(word.entity);
verly.addEntity(word2.entity);

function animate() {
ctx.clearRect(0, 0, width, height);

verly.update();
verly.render();
verly.interact();
// word.entity.renderPointsIndex()
// verly.renderPointIndex();
// word.entity.renderPointIndex();

requestAnimationFrame(animate);
}
animate();
}
</script>
</body>

</html>
49 changes: 0 additions & 49 deletions examples/typography/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion experiments/additional_features/angleContraints.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<body>

<canvas id="c"></canvas>
<script src="../../dist/verly.bundle.js"></script>
<script type="module" src="../../src/app.js"></script>


<script>
Expand Down
2 changes: 1 addition & 1 deletion experiments/additional_features/pointAndStickSetters.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<body>

<canvas id="c"></canvas>
<script src="../../dist/verly.bundle.js"></script>
<script type="module" src="../../src/app.js"></script>


<script>
Expand Down
2 changes: 1 addition & 1 deletion experiments/api_flexibility/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<canvas id="c"></canvas>

<script src="../../dist/verly.bundle.js"></script>
<script type="module" src="../../src/app.js"></script>

<script src="./index.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion experiments/multiple_instance/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<body>


<script src="../../dist/verly.bundle.js"></script>
<script type="module" src="../../src/app.js"></script>

<script src="./index.js"></script>
</body>
Expand Down
3 changes: 3 additions & 0 deletions experiments/web_components/Component.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import Verly from '../../src/Verly.js';


class VerlyCanvas extends HTMLCanvasElement {
constructor() {
super();
Expand Down
Loading