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
extrajs: <script src="/static/js/HermiteTest/HermiteTest.js"></script>
---
<section>
<pre>
<div id="content"></div> <div id="content"></div>
</code> </pre>
# </section>
</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> ---
layout: withjs
title: Bouncing cube
extrajs: <script src="/static/js/bouncing/BouncingMain.js"></script>
---
<section>
<h2>Bouncing cube</h2> <h2>Bouncing cube</h2>
<p> <p>
Click on the cube to make it jump ! Click on the cube to make it jump !
</p> </p>
<div id="container"></div> <div id="container"></div>
# </section>
</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,20 +1,24 @@
<section> ---
layout: main
title: Index
---
<section>
<h2>Index</h2> <h2>Index</h2>
<ul> <ul>
<li><a href="/bouncing/">A bouncing cube that jumps when you click on it</a></li> <li><a href="/bouncing/">A bouncing cube that jumps when you click on it</a></li>
<li> <li>
<p> <p>
<a href="/multisphere/">Sphere with multi-resolution</a> <a href="/multisphere/}">Sphere with multi-resolution</a>
</p> </p>
<p> <p>
Lots of obj files loaded and displayed. When you click Lots of obj files loaded and displayed. When you click
somewhere, the current obj is hidden and the next one, with somewhere, the current obj is hidden and the next one, with a
a better resolution is shown. better resolution is shown.
</p> </p>
</li> </li>
<li> <li>
<p> <p>
<a href="/scene/">A proto of the real thing</a> <a href="/prototype/">A proto of the real thing</a>
</p> </p>
<p> <p>
You can move the camera with the arrow keys and move the You can move the camera with the arrow keys and move the
@ -39,5 +43,5 @@
</p> </p>
</li> </li>
</ul> </ul>
# </section>
</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
extrajs: <script src="/static/js/multisphere/MultiSphere.js"></script>
---
<h2>Multiresolution sphere</h2>
<p>
This is the first test of multi-resolution. In fact, it's not This is the first test of multi-resolution. In fact, it's not
really one multi-resolution sphere but many spheres with really one multi-resolution sphere but many spheres with
different resolutions. You can change resolution by clicking on different resolutions. You can change resolution by clicking on
the canvas. the canvas.
</p> </p>
<div id="container"></div> <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/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,4 +1,9 @@
<section> ---
title: Prototype
layout: withjs
extrajs: <script src="/static/js/prototype/main.js"></script>
---
<section>
<h2>3D Interface</h2> <h2>3D Interface</h2>
<p> <p>
This is the prototype of a 3D interface. You can move the This is the prototype of a 3D interface. You can move the
@ -22,6 +27,6 @@
<label for="collisions">Collisions</label> <label for="collisions">Collisions</label>
<input type="checkbox" id="showarrows" style="margin-bottom:10px" checked> <input type="checkbox" id="showarrows" style="margin-bottom:10px" checked>
<label for="showarrows">Show arrows</label> <label for="showarrows">Show arrows</label>
<div id="container"></div> <div id="container"> </div>
# </section>
</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