forked from ssorallen/turbo-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfish.erb
69 lines (62 loc) · 2.46 KB
/
fish.erb
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
<!DOCTYPE html>
<html>
<head>
<title>TurboReact :: Transition between static HTML pages; no server required</title>
<link rel="author" href="https://twitter.com/ssorallen">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" media="screen">
<link rel="stylesheet" href="/turbo-react.css" media="screen">
<script src="/lib/turbolinks.js"></script>
<script src="/dist/turbo-react.min.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h1>A fishy demonstration</h1>
<p class="lead">
Because only changes between pages are added when links are clicked,
class name changes on the fish allow the CSS transitions to work. <small>
(Try disabling JavaScript to see what each page looks like.)</small>
</p>
<ul class="nav nav-pills">
<% [{path: "/onefish", title: "One fish"},
{path: "/twofish", title: "Two fish"},
{path: "/redfish", title: "Red fish"},
{path: "/bluefish", title: "Blue fish"}].each do |info| %>
<li <% if request.path_info == info[:path] %>class="active"<% end %>>
<a href="<%= info[:path] %>">
<%= info[:title] %>
</a>
</li>
<% end %>
</ul>
<% if request.path_info == "/onefish" %>
<!-- Uncomment to test transitions between broken pages. -->
<!-- <a xlink:href="/"> -->
<% end %>
<% (1..2).each do |i| %>
<div class="fish <% if i <= (@fish_count || 1) %>fish-in<% end %> <%= @fish_class || '' %>">
<div class="fish-body">
<div class="eye">
<div class="pupil"></div>
</div>
</div>
<div class="fin"></div>
<div class="fin fin-bottom"></div>
</div>
<% end %>
<h3>The Code</h3>
<p>
This whole app is on
GitHub: <a href="https://github.com/ssorallen/turbo-react/">turbo-react</a>
</p>
<h3>Feedback</h3>
<p>Tweet at
me: <a href="https://twitter.com/ssorallen?rel=author">@ssorallen</a>
</p>
</div>
</div>
</div>
</body>
</html>