-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathracing-sim.html
239 lines (213 loc) · 8.22 KB
/
racing-sim.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>jbaileystudio - Racing Sim</title>
<link rel="stylesheet" href="./style.css">
<link rel="icon" href="favicons/favicon-32x32.png" type="image/x-icon">
<!-- Tracking -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-219530537-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-219530537-1');
</script>
<!-- End Tracking -->
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}
.header {
text-align: left;
padding: 32px;
padding-left: 0px;
padding-top: 0px;
}
.row {
display: -ms-flexbox; /* IE 10 */
display: flex;
-ms-flex-wrap: wrap; /* IE 10 */
flex-wrap: wrap;
padding: 0 4px;
}
/* Create two equal columns that sits next to each other */
.column {
-ms-flex: 50%; /* IE 10 */
flex: 50%;
padding: 0 4px;
}
.column img {
margin-top: 8px;
margin-bottom: 8px;
vertical-align: middle;
}
/* Style the buttons */
.btn {
border: none;
outline: none;
padding: 10px 16px;
background-color: #f1f1f1;
cursor: pointer;
font-size: 18px;
}
.btn:hover {
background-color: #ddd;
}
.btn.active {
background-color: #666;
color: white;
}
</style>
<body>
<div style="background: #f7f7f7;">
<div class="header_div">
<a class="back_to_home" aria-label="J Bailey Studio Home" href="index.html" style="text-decoration: none; color: black">← Back Home</a>
<h1 style="padding-bottom: 30px;">Building a Racing Simulator</h1>
</div>
</div>
<main class="inner_main">
<!-- Header -->
<div class="header" id="myHeader">
<p>After participating in a season of vintage racing, my dad and I wanted to build a sim racing rig to get more seat time. My dad did most of the woodwork, all reclaimed and recycled wood, while I figured out the hardware intertwined with it.</p>
<p>Click on the buttons to change the grid view.</p>
<button class="btn" onclick="one()">1</button>
<button class="btn active" onclick="two()">2</button>
<button class="btn" onclick="four()">4</button>
</div>
<!-- Photo Grid -->
<div class="row">
<div class="column">
<img src="sim-photos/IMG_6329.JPG" alt="Elan shaped frame" style="width:100%"/>
<img src="sim-photos/IMG_1464.jpg" alt="Cutting the frame" style="width:100%"/>
<img src="sim-photos/IMG_6540.JPG" alt="Wheel base housing" style="width:100%"/>
<img src="sim-photos/IMG_6538.JPG" alt="Me assembling" style="width:100%"/>
<img src="sim-photos/IMG_1450.JPG" alt="Pedals and computer box" style="width:100%"/>
</div>
<div class="column">
<img src="sim-photos/IMG_1457.JPG" alt="Close up view of the pedals" style="width:100%"/>
<img src="sim-photos/IMG_6547.JPG" alt="Pedals mounted on wood" style="width:100%"/>
<img src="sim-photos/IMG_6548.jpg" alt="Wheelbase mounting to wood frame" style="width:100%"/>
<img src="sim-photos/sim-seat-1.jpg" alt="Wood seat side view" style="width:100%"/>
<img src="sim-photos/sim-seat-2.JPG" alt="Wood seat straight on view" style="width:100%"/>
</div>
<div class="column">
<img src="sim-photos/IMG_6549.JPG" alt="Steering wheel base clamped in" style="width:100%"/>
<img src="sim-photos/IMG_6550.JPG" alt="Wooden seat fixture completely assembled" style="width:100%"/>
<img src="sim-photos/IMG_6725.JPG" alt="Wheelbase and emergency stop closeup" style="width:100%"/>
<img src="sim-photos/IMG_6551.JPG" alt="Pedal view from behind" style="width:100%"/>
</div>
<div class="column">
<img src="sim-photos/IMG_6552.JPG" alt="Wheel and pedal view from front" style="width:100%"/>
<img src="sim-photos/IMG_1456.jpg" alt="Computer closeup" style="width:100%"/>
<img src="sim-photos/IMG_2254.jpg" alt="Dad assembling the final base fixtures" style="width:100%"/>
<img src="sim-photos/IMG_2262.jpg" alt="Completed sim racing rig set up" style="width:100%"/>
</div>
</div>
<script>
// Get the elements with class="column"
var elements = document.getElementsByClassName("column");
// Declare a loop variable
var i;
// Full-width images
function one() {
for (i = 0; i < elements.length; i++) {
elements[i].style.msFlex = "100%"; // IE10
elements[i].style.flex = "100%";
}
}
// Two images side by side
function two() {
for (i = 0; i < elements.length; i++) {
elements[i].style.msFlex = "50%"; // IE10
elements[i].style.flex = "50%";
}
}
// Four images side by side
function four() {
for (i = 0; i < elements.length; i++) {
elements[i].style.msFlex = "25%"; // IE10
elements[i].style.flex = "25%";
}
}
// Add active class to the current button (highlight it)
var header = document.getElementById("myHeader");
var btns = header.getElementsByClassName("btn");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function() {
var current = document.getElementsByClassName("active");
current[0].className = current[0].className.replace(" active", "");
this.className += " active";
});
}
</script>
</main>
<footer>
<p>
Interested in this project and want to learn more? <a href="mailto:[email protected]">Reach out to me</a>
</p>
</footer>
<button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
<script>
// Get the button
let mybutton = document.getElementById("myBtn");
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>
<!--Lightbox Carousel Script-->
<script>
function openModal() {
document.getElementById("myModal").style.display = "block";
}
function closeModal() {
document.getElementById("myModal").style.display = "none";
}
var slideIndex = 1;
showSlides(slideIndex);
function plusSlides(n) {
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
var i;
var slides = document.getElementsByClassName("mySlides");
var dots = document.getElementsByClassName("demo");
var captionText = document.getElementById("caption");
if (n > slides.length) {slideIndex = 1}
if (n < 1) {slideIndex = slides.length}
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
captionText.innerHTML = dots[slideIndex-1].alt;
}
</script>
</body>
</html>