X Tutup
Skip to content

Commit 33ef850

Browse files
committed
Merge pull request algorithm-visualizer#123 from parkjs814/master
Master
2 parents d5bd13a + 160cfff commit 33ef850

File tree

425 files changed

+50033
-1164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

425 files changed

+50033
-1164
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
presets: ['es2015']
3+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
22
.DS_Store
33
node_modules
4+
_*

branding/opencollective/logo.psd

13 KB
Binary file not shown.

css/stylesheet.css

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,7 @@ section {
295295
}
296296

297297
.files_bar > .wrapper.shadow-left.shadow-right {
298-
box-shadow: inset 16px 0 16px -16px rgba(0, 0, 0, .6),
299-
inset -16px 0 16px -16px rgba(0, 0, 0, .6);
298+
box-shadow: inset 16px 0 16px -16px rgba(0, 0, 0, .6), inset -16px 0 16px -16px rgba(0, 0, 0, .6);
300299
}
301300

302301
.explanation_container {
@@ -432,3 +431,57 @@ pre {
432431
.mtbl-col.notified {
433432
background: #f00;
434433
}
434+
435+
#loading-slider {
436+
position: absolute;
437+
width: 100%;
438+
height: 2px;
439+
}
440+
441+
#loading-slider.loaded {
442+
visibility: hidden;
443+
}
444+
445+
.line {
446+
position: absolute;
447+
background: #4a8df8;
448+
width: 100%;
449+
left: 0;
450+
right: 0;
451+
top: 0;
452+
height: 3px;
453+
}
454+
455+
.break {
456+
position: absolute;
457+
background: #222;
458+
width: 6px;
459+
height: 2px;
460+
}
461+
462+
.dot1 {
463+
animation: loading 2s infinite;
464+
}
465+
466+
.dot2 {
467+
animation: loading 2s 0.5s infinite;
468+
}
469+
470+
.dot3 {
471+
animation: loading 2s 1s infinite;
472+
}
473+
474+
@keyframes loading {
475+
from {
476+
left: 0;
477+
}
478+
to {
479+
left: 100%;
480+
}
481+
}
482+
483+
input[type=number]::-webkit-inner-spin-button,
484+
input[type=number]::-webkit-outer-spin-button {
485+
-webkit-appearance: none;
486+
margin: 0;
487+
}

gulpfile.babel.js

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
'use strict';
2+
3+
import path from 'path';
4+
import gulp from 'gulp';
5+
import uglify from 'gulp-uglify';
6+
import cleanCSS from 'gulp-clean-css';
7+
import autoprefixer from 'gulp-autoprefixer';
8+
import concat from 'gulp-concat';
9+
import header from 'gulp-header';
10+
import babel from 'gulp-babel';
11+
import gutil from 'gulp-util';
12+
import sourcemaps from 'gulp-sourcemaps';
13+
import connect from 'gulp-connect';
14+
import browserify from 'browserify';
15+
import babelify from 'babelify';
16+
import source from 'vinyl-source-stream';
17+
import buffer from 'vinyl-buffer';
18+
import pkg from './package.json';
19+
20+
const appName = 'algorithm_visualizer';
21+
const appEntryPoint = './js/index.js';
22+
23+
const outputPaths = {
24+
javascript: './public',
25+
css: './public',
26+
sourceMaps: './'
27+
};
28+
29+
const banner = [
30+
'/**',
31+
' * <%= pkg.name %> - <%= pkg.description %>',
32+
' * @version v<%= pkg.version %>',
33+
' * @author <%= pkg.author %>',
34+
' * @link <%= pkg.homepage %>',
35+
' * @license <%= pkg.license %>',
36+
' */',
37+
''
38+
].join('\n');
39+
40+
// build directories
41+
42+
const cssDir = path.join(__dirname, 'css', '**', '*.css');
43+
const jsDir = path.join(__dirname, 'js', '**', '*.js');
44+
45+
// CSS
46+
47+
gulp.task('minify-css', () => {
48+
gutil.log('\n\nBuild CSS Paths: \n', cssDir, '\n\n');
49+
50+
return gulp.src(cssDir)
51+
.pipe(autoprefixer())
52+
.pipe(cleanCSS({
53+
compatibility: 'ie8'
54+
}))
55+
.pipe(concat(`${appName}.min.css`))
56+
.pipe(header(banner, {
57+
pkg
58+
}))
59+
.pipe(gulp.dest(outputPaths.css))
60+
.pipe(connect.reload());
61+
});
62+
63+
gulp.task('build-css', () => {
64+
gutil.log('\n\nBuild CSS Paths: \n', cssDir, '\n\n');
65+
66+
return gulp.src(cssDir)
67+
.pipe(autoprefixer())
68+
.pipe(concat(`${appName}.css`))
69+
.pipe(header(banner, {
70+
pkg
71+
}))
72+
.pipe(gulp.dest(outputPaths.css))
73+
.pipe(connect.reload());
74+
});
75+
76+
// JS
77+
78+
gulp.task('minify-js', () => {
79+
80+
gutil.log('\n\nBuild JS Paths: \n', jsDir, '\n\n');
81+
82+
return browserify({
83+
entries: './js/index.js',
84+
debug: true
85+
})
86+
.transform('babelify', {
87+
presets: ['es2015']
88+
})
89+
.bundle()
90+
.pipe(source(`${appName}.min.js`))
91+
.pipe(header(banner, {
92+
pkg
93+
}))
94+
.pipe(buffer())
95+
.pipe(sourcemaps.init())
96+
.pipe(uglify())
97+
.pipe(sourcemaps.write(outputPaths.sourceMaps))
98+
.pipe(gulp.dest(outputPaths.javascript))
99+
.pipe(connect.reload());
100+
101+
});
102+
103+
gulp.task('build-js', () => {
104+
105+
gutil.log('\n\nBuild JS Paths: \n', jsDir, '\n\n');
106+
107+
return browserify({
108+
entries: './js/index.js',
109+
debug: true
110+
})
111+
.transform('babelify', {
112+
presets: ['es2015']
113+
})
114+
.bundle()
115+
.pipe(source(`${appName}.js`))
116+
.pipe(header(banner, {
117+
pkg
118+
}))
119+
.pipe(buffer())
120+
.pipe(sourcemaps.init())
121+
.pipe(sourcemaps.write(outputPaths.sourceMaps))
122+
.pipe(gulp.dest(outputPaths.javascript))
123+
.pipe(connect.reload());
124+
});
125+
126+
// Build
127+
128+
gulp.task('compile-css', ['build-css', 'minify-css']);
129+
gulp.task('compile-js', ['build-js', 'minify-js']);
130+
gulp.task('build', ['compile-css', 'compile-js']);
131+
132+
// Server
133+
134+
gulp.task('connect', function() {
135+
136+
connect.server({
137+
livereload: true
138+
});
139+
});
140+
141+
// Watch
142+
143+
gulp.task('watch', ['build'], function() {
144+
gulp.watch(jsDir, ['compile-js']);
145+
gulp.watch(cssDir, ['compile-css']);
146+
});
147+
148+
// Default
149+
150+
gulp.task('default', ['connect', 'watch']);

0 commit comments

Comments
 (0)
X Tutup