-
Notifications
You must be signed in to change notification settings - Fork 0
/
work.html
189 lines (179 loc) · 7.45 KB
/
work.html
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Christopher Robison's Sample Work</title>
<link rel="canonical" href="https://cdr2.com/crblog/work.html" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lexend:wght@100;200;300;400;500;600;700;800;900&family=Titillium+Web:wght@200;300;400;600;700;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/fontawesome-free-6.4.0-web/css/all.min.css">
<link rel="stylesheet" href="assets/css/adminlte.css">
<style>
ul#list {
font-size: 22px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: flex-start;
}
ul#list li {
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
margin: 0.5rem;
padding: 1rem;
text-align: center;
transition: all 50ms linear;
transform: scale(1);
border: 2px solid #000;
}
ul#list li:hover {
transform: scale(1.05);
}
.fun-desc {
font-size: 0.8em;
font-weight: 300;
}
.fun-link {
color: #000;
font-weight: 700;
font-size: 1.1rem;
}
.fun-link:hover {
text-decoration: underline;
}
.screenshot {
margin-bottom: 1rem;
}
a {
color: #006;
text-decoration: underline;
text-transform: uppercase;
}
a:hover {
text-decoration: underline;
color: #00c;
}
</style>
</head>
<body class="hold-transition iframe-mode sanserif">
<!-- Site wrapper -->
<div class="wrapper">
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Work Sample</li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content sanserif" style="flex-direction:column;">
<div class="blog sanserif">
<h1>Christopher Robison Work Sample:</h1>
<h2>The Bouncing Button Game</h2>
<hr>
<div style="text-align:center;">
<img src="assets/img/bouncingbutton.png" style="margin:0 auto;display:inline-block;position:relative;"><br>
<div style="text-align:center;color:#666;">Bouncing Button Game - Level 4</div>
</div>
<hr>
<p>
This is an example of work that I have done. Since much of my previous work is proprietary and unable to share, I am featuring a game project I completed for a JavaScript contest: Bouncing Button. Not all code ages well but I did this way back in 2013 and the codebase holds up. Sure, there are things I would do differently now such as ES5/6 enhancements and move away from defining classes via prototypes (yuck!) but the architecture and separation of concerns is on point. There are no external dependencies for this game. You <em>do</em> need to click something on the page before sound will start working but that is a limitation of the web browser. So play the game, check out the code, read through the code documentation (yep, there are docs) and remember that this was written alone, with zero dependencies.
</p>
</div>
<div class="sanserif">
<hr>
<h2>Bouncing Button</h2>
<ul id="list">
<li><a onclick="return app.loadUrl('https://bouncingbutton.com', 'Button Game', event)" href="https://bouncingbutton.com" target="_blank"><img src="/crblog/assets/img/work-puzzle.png" class="screenshot"><br>The Game</a></li>
<li><a onclick="return app.loadUrl('https://bouncingbutton.com/doc/', 'Button Docs', event)" href="https://bouncingbutton.com/doc/" target="_blank"><img src="/crblog/assets/img/work-docs.png" class="screenshot"><br>The Documentation</a></li>
<li><a href="https://github.com/chrisrobison/buttongame/blob/main/README.md" target="_blank"><img src="/crblog/assets/img/work-code.png" class="screenshot"><br>The Code</a></li>
</ul>
<hr>
</div>
<div class="blog">
<p>The code is all located within the <code>./js/</code> directory and is broken down into 3 main groups: AP, BB, CP which stand for <q>Audio Plugin</q>, <q>Bouncing Button</q> and <q>Canvas Plugin</q>, respectively. AP & CP are support utility classes for audio and canvas functionality while BB contains the main game logic and classes. All the game logic resides in the BB classes.</p>
<p>I was on the fence on whether I should breakdown the project any further or just let you, dear reader, examine the code yourself as the project stands up well on its own. I am opting for the later, although I may still expand on this sometime in the near future.
</p>
<hr>
</div>
<div class="float-right d-none d-sm-block" style="text-align:right;width:100%;padding: 1rem;">
<strong>Copyright © 2024 <a style="text-transform:none;" href="https://cdr2.com">Christopher Robison</a>.</strong> All rights reserved.
</div>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
</footer>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<!-- jQuery -->
<script src="assets/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="assets/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="assets/js/adminlte.min.js"></script>
<script>
(function() {
const $ = str => document.querySelector(str);
const $$ = str => document.querySelectorAll(str);
let app = {
init: function() {
if (parent!==self && parent.fixIframeHeight) parent.fixIframeHeight();
},
makeList: function(data) {
let out = "";
for (const item of data) {
// loadTab: function(url="home.html", title="New Tab", name="newtab", autoshow=true, evt) {
let tabname = item.title.replace(/\W/g, '');
out += `<li>
<a href="${item.link}" class="fun-link" onclick="return parent.app.loadTab('${item.link}', '${item.title}', '${tabname}', true, event)" target="_blank">
<img src="${item.screenshot}" class="screenshot"><br>
<div class="fun-title">${item.title}</div>
</a>
<div class="fun-desc">${item.desc}</div>
</li>`;
}
return out;
},
data: {
},
state: {
},
loadUrl(url, title, e) {
if (parent!== window && parent.app && parent.app.loadTab) {
return parent.app.loadTab(url, title, title.replace(/\W/g, '').toLowerCase(), true, e);
} else if (parent!==window && parent.loadTab) {
return parent.loadTab(url, title, title.replace(/\W/g, '').toLowerCase(), true, e);
} else {
location.href = url;
}
}
};
window.app = app;
app.init();
})();
</script>
</body>
</html>