-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.haml
139 lines (139 loc) · 4.8 KB
/
index.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
!!! 5
%html{prefix:"og: http://ogp.me/ns#"}
%head
%meta{charset: "utf-8"}
%meta{property: "og:title", content:"Fajitas, the WebGL fractal renderer"}
%meta{property: "og:type", content:"website"}
%meta{property: "og:url", content:"https://titouanc.github.io/fajitas/"}
%meta{property: "og:image", content:"https://raw.githubusercontent.com/titouanc/fajitas/master/screenshots/screenshot2.png"}
%meta{property: "og:description", content:"Fajitas let you explore fractals in your web browser. Equation and color editor included !"}
%meta{property: "og:determiner", content:"the"}
%link{rel:"stylesheet", href:"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css", integrity:"sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7", crossorigin:"anonymous"}
%title iTitou's WebGL Fractal renderer
:sass
$barcolor: rgba(0, 0, 0, 0.7)
html, body
padding: 0px
margin: 0px
height: 100%
.navbar-fixed-top
background-color: $barcolor
.footer
position: absolute
bottom: 0
width: 100%
height: 20px
background-color: $barcolor
p
margin-bottom: 5px
font-size: 15px
color: grey
#canvas
cursor: move
width: 100%
height: 100%
#header
width: 100%
height: 50px
#formula
width: 400px
.hidden-template
display: none
th
text-align: right
padding-right: 1em
%body
%nav.navbar.navbar-inverse.navbar-fixed-top
.container-fluid
/ Left
.navbar-header
%button.navbar-toggle.collapsed{type:"button", 'data-toggle'=>"collapse", 'data-target'=>'#navbar', 'aria-expanded'=>false, 'aria-controls'=>'navbar'}
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.navbar-brand{href:""} Fajitas, the WebGL Fractal renderer
/ Right
.collapse.navbar-collapse
%ul.nav.navbar-nav.navbar-right
%li.dropdown
%a.dropdown-toggle{href:"", title:"Controls...", 'data-toggle'=>'dropdown'}
%i.glyphicon.glyphicon-cog
%ul.dropdown-menu
%li.dropdown-header Colors
%li
%a
%input#color0{type:"color", value:"#8c1010"}
Color 1
%a
%input#color1{type:"color", value:"#ffc000"}
Color 2
%li.dropdown-header
Iterations
%span#iterations-display
%li
%input#iterations{type: "range", value: 0, min: 1, max: 1000}
%li
%input#save{type: "button", value: "Save"}
%form.navbar-form.navbar-right
.input-group
%span#formula-head.input-group-addon
Z
%sub n+1
:plain
=
%input#formula.form-control{type:"text", value:"C + Zn^2", autocomplete:"off"}
%canvas#canvas
%script{type:"text/javascript", src:"twgl-full.min.js"}
%script{type:"text/javascript", src:"app.js"}
%script{type:"text/javascript", src:"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js", integrity:"sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS", crossorigin:"anonymous"}
%footer.footer
.container
%p
Fajitas, the WebGL fractal renderer by
%a{target: "_blank", href: "https://twitter.com/TitouOnRails"} iTitou
%i.glyphicon.glyphicon-menu-right
Code on
%a{target: "_blank", href: "https://github.com/titouanc/fajitas"} Github
/ Templates for dynamic content
#error-tooltip.hidden-template
.popover{role:"tooltip"}
.arrow
%h3.popover-title
%code.popover-content
#help-tooltip.hidden-template
%h4 This is the recurrence formula
%ul
%li
%code C
is the initial point
%li
%code Zn
is the actual value of iteration
%li
%code
Z
%sub n+1
is the next value
%h4 Cool fractals
%table
- {Mandelbrot: 'C + Zn^2', BurningShip: 'C + |Zn|^2'}.each do |n, f|
%tr
%th
%a.label.label-primary{onClick:"$('#formula').val('#{f}').change()"}= n
%td
%code= f
%hr
%h4 What's this ?
%p
Each point you see has a coordinate in the complexe plane.
On each of them, repeat the following operation:
%code
Z
%sub n+1
:plain
=
formula(Zn)
%p
If the value becomes too large, or the operation has been repeated enough,
stop and assign a color based on the number of times the operation was
repeated.