Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

[submission] Vanilla JavaScript #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
792 changes: 792 additions & 0 deletions submissions/sdtsui/build/app.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions submissions/sdtsui/build/app.js.map

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions submissions/sdtsui/build/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
body {
font-family: Lucida Console, Monaco5, monospace;
height: 100vh;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#1b3061+0,192b55+100 */
background: #1b3061; /* Old browsers */
background: -moz-linear-gradient(top, #1b3061 0%, #192b55 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1b3061), color-stop(100%,#192b55)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #1b3061 0%,#192b55 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #1b3061 0%,#192b55 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #1b3061 0%,#192b55 100%); /* IE10+ */
background: linear-gradient(to bottom, #1b3061 0%,#192b55 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1b3061', endColorstr='#192b55',GradientType=0 ); /* IE6-9 */
}

.css-root {
margin: 36px auto 0;
max-width: 800px;
min-width: 640px;
border-radius: 2px;
border: 3px solid #35769A;
box-shadow: 0px 0px 10px 1px rgba(53,118,154,0.5), inset 0px 0px 10px 1px rgba(53,118,154,0.5);
padding: 5px;
}

.css-planet-monitor {
margin-top: 0;
border: 5px solid #87AFE7;
border-radius: 2px;
box-shadow: 0px 0px 10px 1px rgba(135,175,231,0.5), inset 0px 0px 10px 1px rgba(135,175,231,0.5);
padding: 16px;
background-color: #2F5093;
color: #EDE66A;
text-shadow: 0px 0px 10px rgba(237, 230, 106, 0.6);
}

.css-scrollable-list {
display: flex
}

.css-slots {
flex: 1 80%;
padding: 0;
list-style-type: none;
margin: 0 7px 0 0;
}

.css-slot {
padding: 16px;
border: 5px solid hsla(167, 82%, 68%, 1);
border-radius: 2px;
box-shadow: 0px 0px 10px 1px rgba(105, 240, 210, 0.45), inset 0px 0px 10px 1px rgba(105, 240, 210, 0.45);
color: #69F0D2;
font-size: 18px;
height: 1.7em;
}

.css-slot h3, .css-slot h4, .css-slot h5, .css-slot h6 {
margin: 0;
}

.css-slot + .css-slot {
margin-top: 7px;
}

.css-scroll-buttons {
flex: 1 20%;
display: flex;
flex-direction: column;
}

.css-scroll-buttons button {
flex: 1;
border: 5px solid #69F0D2;
border-radius: 2px;
box-shadow: 0px 0px 10px 1px #69F0D2, inset 0px 0px 10px 1px #69F0D2;
background: #39697A;
}

.css-button-down {
margin-top: 7px;
}

.css-button-up::after {
content: '\21D1';
display: block;
color: #69F0D2;
font-size: 30px;
text-shadow: 0px 0px 10px #69F0D2;
}

.css-button-down::after {
content: '\21D3';
display: block;
color: #69F0D2;
font-size: 30px;
text-shadow: 0px 0px 10px #69F0D2;
}

.css-button-disabled {
opacity: 0.5;
}

39 changes: 39 additions & 0 deletions submissions/sdtsui/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');

function compile(watch) {
var bundler = watchify(browserify('./src/app.js', { debug: true }).transform(babel));

function rebundle() {
bundler.bundle()
.on('error', function(err) { console.error(err); this.emit('end'); })
.pipe(source('app.js'))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./build'));
}

if (watch) {
bundler.on('update', function() {
console.log('-> bundling...');
rebundle();
});
}

rebundle();
}

function watch() {
return compile(true);
};

gulp.task('build', function() { return compile(); });
gulp.task('watch', function() { return watch(); });

gulp.task('default', ['watch']);
17 changes: 17 additions & 0 deletions submissions/sdtsui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Vanilla JS Solution for the Flux Challenge"/>
<title>Flux Challenge</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/superagent/1.2.0/superagent.min.js"></script>
</head>
<body>
<div class="app-container">
</div>
</body>
<link rel="stylesheet" href="./build/styles.css" type="text/css">
<script src="./build/app.js"></script>

</html>
27 changes: 27 additions & 0 deletions submissions/sdtsui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "--",
"version": "1.0.0",
"description": "test",
"main": "index.js",
"scripts": {
"watch": "watchify ./src/app.js -o ./src/bundle.js -v",
"build": "babel /.src/app.js --out-file ./src/js2015script.js; echo 'Transpiled.';",
"browserify": "browserify ./src/js2015script.js -o ./src/bundle.js;",
"start": "npm run watch"
},
"author": "",
"license": "ISC",
"dependencies": {
"superagent": "^1.2.0"
},
"devDependencies": {
"babelify": "^6.1.3",
"browserify": "^11.0.1",
"gulp": "^3.9.0",
"gulp-sourcemaps": "^1.5.2",
"nodemon": "^1.4.0",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.3.1"
}
}
31 changes: 31 additions & 0 deletions submissions/sdtsui/readme_next_steps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
X Build process: ::

X test if the rendering logic works
X test if the fetching logic works

X handle movement: rerendering only
X handle movement: cancelling requests
// dashboard calls cancelAllPending on sithList...
X sithList invokes on all. How could composition work???
X handle movement: retriggering fetching
// OPT1: have a mediator in dashboard that listens for a
// OPT2: the shift function has side efects, but we can also get it to return a value...keep the logic in there. This is messy though.
X offbutton logic.
// High level:
XALL OFF: on match events.
XOne off on edge events.
X(Both, if would have been active) X-> on ">1 sith loaded.css-slots"
__________________________________________________________
Refctor work into `spike`!
__________________________________________________________

TEST LOGIC:
XMovement
XRendering
XCancelling:



X reXhook socket
- last: handle planetMatches from Dashboard
- Display, style buttons, ui freezing
Loading