From python CGI to jekyll stuff

This commit is contained in:
Thomas FORGIONE 2015-04-23 17:49:59 +02:00
parent 36e4e5b916
commit 445219b013
135 changed files with 194 additions and 5112 deletions

1
CNAME Normal file
View File

@ -0,0 +1 @@
3dinterface.no-ip.org

View File

@ -1,7 +1,11 @@
<section> ---
<h2>Hermite test</h2> layout: withjs
<code> title: Hermite Test
<div id="content"></div> extrajs: <script src="/static/js/HermiteTest/HermiteTest.js"></script>
</code> ---
# <section>
</section> <pre>
<div id="content"></div>
</pre>
</section>

View File

@ -1,28 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from webtools import Web
def main():
print('Content-type: text/html')
print()
page = Web.Element(Web.ROOT_DIR + 'templates/page.html')
head = Web.Element(Web.ROOT_DIR + 'templates/head.html')
body = Web.Element(Web.ROOT_DIR + 'templates/body.html')
jsIncludes = Web.Element(Web.ROOT_DIR + 'templates/jsIncludes.html')
mainJs = Web.Element()
mainJs.open_string = ' <script src="js/HermiteTest.js"></script>'
content = Web.Element('index.html')
page.add_child(head)
page.add_child(body)
body.add_child(content)
body.add_child(jsIncludes)
jsIncludes.add_child(mainJs)
page.print()
if __name__ == '__main__':
main()

View File

@ -1,3 +0,0 @@
# 3D Interface
Various 3d interfaces based on Three.js

View File

@ -1,6 +1,14 @@
<!doctype html>
<html>
<head>
<title>3DUI - {{ page.title }}</title>
<meta charset='utf-8' />
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic" />
<link rel="stylesheet" href="/static/css/style.css" />
</head>
<body> <body>
<header> <header>
<h1 id="title">Welcome ! <img src='/img/python-powered.svg' alt='Python powered' width=80/></h1> <h1 id="title">Welcome !</h1>
</header> </header>
<nav> <nav>
<ul> <ul>
@ -11,5 +19,8 @@
<li><a href="/stream/">Streaming simulator</a></li> <li><a href="/stream/">Streaming simulator</a></li>
</ul> </ul>
</nav> </nav>
# {{ content }}
{{ page.extrajs }}
</body> </body>
</html>

23
_layouts/withjs.html Normal file
View File

@ -0,0 +1,23 @@
---
layout: main
---
{{ content }}
<script src="/static/js/three.js"></script>
<script src="/static/js/Tools.js"></script>
<script src="/static/js/three/stats.min.js"></script>
<script src="/static/js/three/DDSLoader.js"></script>
<script src="/static/js/three/MTLLoader.js"></script>
<script src="/static/js/three/OBJLoader.js"></script>
<script src="/static/js/three/OBJMTLLoader.js"></script>
<script src="/static/js/three/OrbitControls.js"></script>
<script src="/static/js/Cube.js"></script>
<script src="/static/js/ProgressiveSphere.js"></script>
<script src="/static/js/Camera.js"></script>
<script src="/static/js/FixedCamera.js"></script>
<script src="/static/js/BouncingCube.js"></script>
<script src="/static/js/BufferGeometryToGeometry.js"></script>
<script src="/static/js/PointerCamera.js"></script>
<script src="/static/js/CameraContainer.js"></script>
<script src="/static/js/Hermite.js"></script>
<script>static_path="/static/"</script>

View File

@ -1,8 +1,13 @@
<section> ---
<h2>Bouncing cube</h2> layout: withjs
<p> title: Bouncing cube
Click on the cube to make it jump ! extrajs: <script src="/static/js/bouncing/BouncingMain.js"></script>
</p> ---
<div id="container"></div> <section>
# <h2>Bouncing cube</h2>
</section> <p>
Click on the cube to make it jump !
</p>
<div id="container"></div>
</section>

View File

@ -1,28 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from webtools import Web
def main():
print('Content-type: text/html')
print()
page = Web.Element(Web.ROOT_DIR + 'templates/page.html')
head = Web.Element(Web.ROOT_DIR + 'templates/head.html')
body = Web.Element(Web.ROOT_DIR + 'templates/body.html')
jsIncludes = Web.Element(Web.ROOT_DIR + 'templates/jsIncludes.html')
mainJs = Web.Element()
mainJs.open_string = ' <script src="js/BouncingMain.js"></script>'
content = Web.Element('index.html')
page.add_child(head)
page.add_child(body)
body.add_child(content)
body.add_child(jsIncludes)
jsIncludes.add_child(mainJs)
page.print()
if __name__ == '__main__':
main()

View File

@ -1,10 +0,0 @@
<section>
<h2>Error 403</h2>
<p>
You're not supposed to be here :o
</p>
<p>
Please go back to the <a href="/">index</a> or wherever you want...
</p>
#
</section>

View File

@ -1,23 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from webtools import Web
def main():
print('Content-type: text/html')
print()
page = Web.Element(Web.ROOT_DIR + 'templates/page.html')
head = Web.Element(Web.ROOT_DIR + 'templates/head.html')
body = Web.Element(Web.ROOT_DIR + 'templates/body.html')
content = Web.Element('index.html')
page.add_child(head)
page.add_child(body)
body.add_child(content)
page.print()
if __name__ == '__main__':
main()

View File

@ -1,10 +0,0 @@
<section>
<h2>Error 404</h2>
<p>
The page you requested was not found... this is annoying :s
</p>
<p>
You can go back to the <a href="/">index</a> or wherever you want...
</p>
#
</section>

View File

@ -1,23 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from webtools import Web
def main():
print('Content-type: text/html')
print()
page = Web.Element(Web.ROOT_DIR + 'templates/page.html')
head = Web.Element(Web.ROOT_DIR + 'templates/head.html')
body = Web.Element(Web.ROOT_DIR + 'templates/body.html')
content = Web.Element('index.html')
page.add_child(head)
page.add_child(body)
body.add_child(content)
page.print()
if __name__ == '__main__':
main()

View File

@ -1,10 +0,0 @@
<section>
<h2>Error 500</h2>
<p>
Wow, you crashed my website... :'(
</p>
<p>
You can go back to the <a href="/">index</a> or wherever you want... (if it works...)
</p>
#
</section>

View File

@ -1,23 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from webtools import Web
def main():
print('Content-type: text/html')
print()
page = Web.Element(Web.ROOT_DIR + 'templates/page.html')
head = Web.Element(Web.ROOT_DIR + 'templates/head.html')
body = Web.Element(Web.ROOT_DIR + 'templates/body.html')
content = Web.Element('index.html')
page.add_child(head)
page.add_child(body)
body.add_child(content)
page.print()
if __name__ == '__main__':
main()

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 172 KiB

View File

@ -1,43 +1,47 @@
<section> ---
<h2>Index</h2> layout: main
<ul> title: Index
<li><a href="/bouncing/">A bouncing cube that jumps when you click on it</a></li> ---
<li> <section>
<p> <h2>Index</h2>
<a href="/multisphere/">Sphere with multi-resolution</a> <ul>
</p> <li><a href="/bouncing/">A bouncing cube that jumps when you click on it</a></li>
<p> <li>
Lots of obj files loaded and displayed. When you click <p>
somewhere, the current obj is hidden and the next one, with <a href="/multisphere/}">Sphere with multi-resolution</a>
a better resolution is shown. </p>
</p> <p>
</li> Lots of obj files loaded and displayed. When you click
<li> somewhere, the current obj is hidden and the next one, with a
<p> better resolution is shown.
<a href="/scene/">A proto of the real thing</a> </p>
</p> </li>
<p> <li>
You can move the camera with the arrow keys and move the <p>
angle of the camera with 2, 4, 6 and 8 (the arrows of the <a href="/prototype/">A proto of the real thing</a>
numpad), or you can do a drag-and-drop like (click on the </p>
mouse to grap the scene, and move the mouse to rotate the <p>
camera). You can also select a camera by clicking on the You can move the camera with the arrow keys and move the
red part of it, and get back to the free camera by clicking angle of the camera with 2, 4, 6 and 8 (the arrows of the
again. You can also select a camera by simply clicking on numpad), or you can do a drag-and-drop like (click on the
the object you want to see. The program will choose the mouse to grap the scene, and move the mouse to rotate the
camera that you want, and move to it progressively. camera). You can also select a camera by clicking on the
</p> red part of it, and get back to the free camera by clicking
</li> again. You can also select a camera by simply clicking on
<li> the object you want to see. The program will choose the
<p> camera that you want, and move to it progressively.
<a href="/stream/">Streaming simulation</a> </p>
</p> </li>
<p> <li>
A mesh of a sphere is fully loaded, and displayed <p>
progressively. This test is here to prove that we can <a href="/stream/">Streaming simulation</a>
dynamically add vertices and faces to a mesh. </p>
</p> <p>
</li> A mesh of a sphere is fully loaded, and displayed
</ul> progressively. This test is here to prove that we can
# dynamically add vertices and faces to a mesh.
</section> </p>
</li>
</ul>
</section>

View File

@ -1,9 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from webtools import Web
Web.render('index.html')
print('<a href="/priv">download</a>')

View File

@ -1,11 +1,13 @@
<section> ---
<h2>Multiresolution sphere</h2> layout: withjs
<p> title: Multi-sphere
This is the first test of multi-resolution. In fact, it's not extrajs: <script src="/static/js/multisphere/MultiSphere.js"></script>
really one multi-resolution sphere but many spheres with ---
different resolutions. You can change resolution by clicking on <h2>Multiresolution sphere</h2>
the canvas. <p>
</p> This is the first test of multi-resolution. In fact, it's not
<div id="container"></div> really one multi-resolution sphere but many spheres with
# different resolutions. You can change resolution by clicking on
</section> the canvas.
</p>
<div id="container"></div>

View File

@ -1,28 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from webtools import Web
def main():
print('Content-type: text/html')
print()
page = Web.Element(Web.ROOT_DIR + 'templates/page.html')
head = Web.Element(Web.ROOT_DIR + 'templates/head.html')
body = Web.Element(Web.ROOT_DIR + 'templates/body.html')
jsIncludes = Web.Element(Web.ROOT_DIR + 'templates/jsIncludes.html')
mainJs = Web.Element()
mainJs.open_string = ' <script src="js/MultiSphere.js"></script>'
content = Web.Element('index.html')
page.add_child(head)
page.add_child(body)
body.add_child(content)
body.add_child(jsIncludes)
jsIncludes.add_child(mainJs)
page.print()
if __name__ == '__main__':
main()

View File

@ -1,27 +1,32 @@
<section> ---
<h2>3D Interface</h2> title: Prototype
<p> layout: withjs
This is the prototype of a 3D interface. You can move the extrajs: <script src="/static/js/prototype/main.js"></script>
camera with the arrow keys of your keyboard, and change the ---
angle of the camera by dragging and dropping the scene around <section>
it (you can also use your numpad, 2 to look lower, 8 to look <h2>3D Interface</h2>
higher, 4 to look on the left and 6 to look on the right, but <p>
if you're more comfortable with non-numpad keys, you can also This is the prototype of a 3D interface. You can move the
use i for up, j for left, k for down, and l for right). camera with the arrow keys of your keyboard, and change the
</p> angle of the camera by dragging and dropping the scene around
<p> it (you can also use your numpad, 2 to look lower, 8 to look
Recommended views are displayed with a transparent red arrow. higher, 4 to look on the left and 6 to look on the right, but
They disappear when you come closer to them, and you can if you're more comfortable with non-numpad keys, you can also
automatically move to them by clicking on them. You can reset use i for up, j for left, k for down, and l for right).
the camera at anytime by clicking on the reset button. </p>
</p> <p>
<button id="reset" style="margin-bottom:10px">Reset camera</button> Recommended views are displayed with a transparent red arrow.
<input type="checkbox" id="fullarrow" style="margin-bottom:10px"> They disappear when you come closer to them, and you can
<label for="fullarrow">Full arrow</label> automatically move to them by clicking on them. You can reset
<input type="checkbox" id="collisions" style="margin-bottom:10px" checked> the camera at anytime by clicking on the reset button.
<label for="collisions">Collisions</label> </p>
<input type="checkbox" id="showarrows" style="margin-bottom:10px" checked> <button id="reset" style="margin-bottom:10px">Reset camera</button>
<label for="showarrows">Show arrows</label> <input type="checkbox" id="fullarrow" style="margin-bottom:10px">
<div id="container"></div> <label for="fullarrow">Full arrow</label>
# <input type="checkbox" id="collisions" style="margin-bottom:10px" checked>
</section> <label for="collisions">Collisions</label>
<input type="checkbox" id="showarrows" style="margin-bottom:10px" checked>
<label for="showarrows">Show arrows</label>
<div id="container"> </div>
</section>

View File

@ -1,33 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from webtools import Web
def main():
print('Content-type: text/html')
print()
page = Web.Element(Web.ROOT_DIR + 'templates/page.html')
head = Web.Element(Web.ROOT_DIR + 'templates/head.html')
body = Web.Element(Web.ROOT_DIR + 'templates/body.html')
jsIncludes = Web.Element(Web.ROOT_DIR + 'templates/jsIncludes.html')
mainJs = Web.Element()
mainJs.open_string = ' <script src="js/main.js"></script>'
content = Web.Element('index.html')
staticPath = Web.Element()
staticPath.open_string = ' <script>static_path = \'/\';</script>'
page.add_child(head)
page.add_child(body)
body.add_child(content)
body.add_child(jsIncludes)
jsIncludes.add_child(staticPath)
jsIncludes.add_child(mainJs)
page.print()
if __name__ == '__main__':
main()

View File

@ -1,49 +0,0 @@
#!/usr/bin/python3
import random
N = 4;
def rand_vector():
print('new THREE.Vector3(', end='')
print(random.uniform(-500,500), end='')
print(',', end='')
print(random.uniform(-500,500), end='')
print(',', end='')
print(random.uniform(0,500), end='')
print(')', end='')
def rand_color():
chars = [ str(x) for x in range(10)] + [chr(x) for x in range(ord('a'), ord('f') + 1)]
print('0x', end='')
for i in range(6):
print(chars[random.randint(0, len(chars)-1)],end='');
def gen_positions():
print('var positions = [')
for i in range(N):
print(' ', end='')
rand_vector()
print(',')
print(' ', end='')
gen_vector()
print('\n];')
def gen_colors():
print('var colors = [')
for i in range(N):
print(' ', end='')
rand_color()
print(',')
print(' ', end='')
rand_color()
print('\n];')
def main():
gen_colors()
if __name__ == '__main__':
main()

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Some files were not shown because too many files have changed in this diff Show More