Skip to content

Commit

Permalink
Added index page
Browse files Browse the repository at this point in the history
  • Loading branch information
robsdedude committed Feb 25, 2017
1 parent 1ec34e3 commit 39eeaf1
Show file tree
Hide file tree
Showing 48 changed files with 1,356 additions and 1,157 deletions.
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"port": 80
"port": 8080,
"useGamepadByDefault": false
}
8 changes: 8 additions & 0 deletions main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@ tp_hub = new touchpad_hub()

port = process.env.PORT || config.port

# draw routes
app.get '/', (req, res) ->
if config.useGamepadByDefault
res.redirect 'gamepad.html'
else
res.redirect 'index.html'

app.use(express.static(__dirname + '/public'));

# socket io
io.on 'connection', (socket) ->

socket.on 'disconnect', () ->
Expand Down
8 changes: 8 additions & 0 deletions main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "virtual-gamepads",
"version": "2.0.0",
"version": "1.2.0",
"description": "Virtual gamepads application",
"main": "main.js",
"author": "miroof",
Expand Down
63 changes: 63 additions & 0 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,69 @@ td {
text-align: center;
}

/********************\
|*** index styles ***|
\********************/
body {
transition: transform 0.3s ease-in, opacity 0.2s 0.1s ease-out;
-webkit-transition: -webkit-transform 0.3s ease-in, opacity 0.2s 0.1s ease-out;
-moz-transition: -moz-transform 0.3s ease-in, opacity 0.2s 0.1s ease-out;
}

body.slide-left {
transform: translateX(-100%);
-webkit-transform: translateX(-100%);
-moz-transform: translateX(-100%);
opacity: 0;
}

.control-selection:first-child {
margin-top: 3em;
}

.control-selection {
margin-top: 1em;
width: 300px;
margin-left: auto;
margin-right: auto;
border: solid #7c7c7c;
border-radius: 5px;
display: flex;
flex-direction: row;
align-items: center;
padding: .5em;
text-decoration: none;
}

.control-selection > img {
display: inline-flex;
height: 64px;
width: 64px;
}

.control-selection > span.text {
display: inline-flex;
color: #242424;
font-size: x-large;
flex: 1 0;
text-align: center;
margin-left: 10px;
}

.control-selection > span.right-arrow {
display: inline-flex;
border: solid #7c7c7c;
border-width: 0 5px 5px 0;
padding: 10px;
transform: scaleX(.5) rotate(-45deg);
-webkit-transform: scaleX(.5) rotate(-45deg);
-moz-transform: scaleX(.5) rotate(-45deg);
}

/**********************\
|*** gamepad styles ***|
\**********************/

#dirContainer {
position: absolute;
top: 0px;
Expand Down
Loading

0 comments on commit 39eeaf1

Please sign in to comment.