Skip to content

New Website #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
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
5 changes: 5 additions & 0 deletions particles.js.org-new/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"@babel/preset-env"
]
}
3 changes: 3 additions & 0 deletions particles.js.org-new/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
build
21 changes: 21 additions & 0 deletions particles.js.org-new/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Matteo Bruni

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions particles.js.org-new/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# tsParticles Website
26 changes: 26 additions & 0 deletions particles.js.org-new/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export default {
config: {
port: 9050
},
paths: {
root: "./",
src: {
base: "./src",
css: "./src/css",
js: "./src/js",
img: "./src/img"
},
dist: {
base: "./dist",
css: "./dist/css",
js: "./dist/js",
img: "./dist/img"
},
build: {
base: "./build",
css: "./build/css",
js: "./build/js",
img: "./build/img"
}
}
}
187 changes: 187 additions & 0 deletions particles.js.org-new/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
import gulp from "gulp";

import gulpSass from "gulp-sass";
import bourbon from "node-bourbon";
import concat from "gulp-concat";
import imagemin from "gulp-imagemin";
import sourcemaps from "gulp-sourcemaps";
import autoprefixer from "gulp-autoprefixer";
import panini from "panini";
import sassCompiler from "sass";
import del from "del";
import browserify from "browserify";
import babelify from "babelify";
import source from "vinyl-source-stream";
import logSymbols from "log-symbols";
import BrowserSync from "browser-sync";

import options from "./config.js";

const { src, dest, watch, series, parallel } = gulp;
const browserSync = BrowserSync.create();
const nodepath = "node_modules/";
const sass = gulpSass(sassCompiler);

//Note : Webp still not supported in major browsers including forefox
//const webp = require('gulp-webp'); //For converting images to WebP format
//const replace = require('gulp-replace'); //For Replacing img formats to webp in html

//Load Previews on Browser on dev
function livePreview(done) {
browserSync.init({
server: {
baseDir: options.paths.dist.base
},
port: options.config.port || 5000
});
done();
}

//Copy latest installed Bulma
function setupBulma() {
console.log("\n\t" + logSymbols.info, "Installing Bulma Files..\n");
return src([nodepath + 'bulma/*.sass', nodepath + 'bulma/**/*.sass'])
.pipe(dest('src/sass/'));
}

//Compile Scss code
function compileSCSS() {
console.log("\n\t" + logSymbols.info, "Compiling App SCSS..\n");
return src(['src/scss/main.scss'])
.pipe(sass({
outputStyle: 'compressed',
sourceComments: 'map',
sourceMap: 'scss',
includePaths: bourbon.includePaths
}).on('error', sass.logError))
.pipe(autoprefixer('last 2 versions'))
.pipe(dest('dist/css'))
.pipe(browserSync.stream());
}

//Compile HTML partials with Panini
function compileHTML() {
console.log("\n\t" + logSymbols.info, "Compiling HTML..\n");
panini.refresh();
return src('src/pages/**/*.html')
.pipe(panini({
root: 'src/pages/',
layouts: 'src/layouts/',
partials: 'src/partials/',
helpers: 'src/helpers/',
data: 'src/data/'
}))
.pipe(dest('dist'))
.pipe(browserSync.stream());
}

//Concat CSS Plugins
function concatCssPlugins() {
console.log("\n\t" + logSymbols.info, "Compiling Plugin styles..\n");
return src([
nodepath + 'simplebar/dist/simplebar.min.css',
nodepath + 'plyr/dist/plyr.css',
nodepath + 'codemirror/lib/codemirror.css',
nodepath + 'codemirror/theme/shadowfox.css',
'src/assets/vendor/css/*',
])
.pipe(sourcemaps.init())
.pipe(concat('app.css'))
.pipe(sourcemaps.write('./'))
.pipe(dest('dist/css'))
.pipe(browserSync.stream());
}

//Reset Panini Cache
function resetPages(done) {
console.log("\n\t" + logSymbols.info, "Clearing Panini Cache..\n");
panini.refresh();
done();
}

//Triggers Browser reload
function previewReload(done) {
console.log("\n\t" + logSymbols.info, "Reloading Browser Preview.\n");
browserSync.reload();
done();
}

//Development Tasks
function devHTML() {
return src(`${options.paths.src.base}/**/*.html`).pipe(dest(options.paths.dist.base));
}

//Optimize images
function devImages() {
return src(`${options.paths.src.img}/**/*`).pipe(dest(options.paths.dist.img));
}

// Let's write our task in a function to keep things clean
function javascriptBuild() {
// Start by calling browserify with our entry pointing to our main javascript file
return (
browserify({
entries: [`${options.paths.src.js}/main.js`],
// Pass babelify as a transform and set its preset to @babel/preset-env
transform: [babelify.configure({ presets: ["@babel/preset-env"] })]
})
// Bundle it all up!
.bundle()
// Source the bundle
.pipe(source("bundle.js"))
// Then write the resulting files to a folder
.pipe(dest(`dist/js`))
);
}

//Copy data files
function copyData() {
console.log("\n\t" + logSymbols.info, "Copying data files..\n");
return src([
'src/data/**/*',
])
.pipe(dest('dist/data'))
.pipe(browserSync.stream());
}

function watchFiles() {
//watch('src/**/*.html', compileHTML);
watch(`${options.paths.src.base}/**/*.html`, series(compileHTML, previewReload));
watch(['src/scss/**/*', 'src/scss/*'], compileSCSS);
watch(`${options.paths.src.js}/**/*.js`, series(javascriptBuild, previewReload));
watch(`${options.paths.src.img}/**/*`, series(devImages, previewReload));
console.log("\n\t" + logSymbols.info, "Watching for Changes..\n");
}

function devClean() {
console.log("\n\t" + logSymbols.info, "Cleaning dist folder for fresh start.\n");
return del([options.paths.dist.base]);
}

const buildTasks = [
devClean, // Clean Dist Folder
resetPages,
parallel(
copyData,
concatCssPlugins,
compileSCSS,
javascriptBuild,
devImages,
compileHTML
),
]

export const build = (done) => {
series(devClean, resetPages, parallel(...buildTasks, devImages))();
done();
};

export default (done) => {
series(
devClean,
resetPages,
parallel(...buildTasks),
parallel(livePreview, watchFiles)
)();
done();
};
79 changes: 79 additions & 0 deletions particles.js.org-new/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"name": "tsparticles-website2",
"version": "2.0.0",
"private": true,
"description": "tsParticles website",
"main": "gulpfile.js",
"dependencies": {
"@alpinejs/intersect": "^3.10.2",
"@alpinejs/persist": "^3.10.2",
"@ryangjchandler/fern": "^0.1.0",
"alpinejs": "^3.10.2",
"bulma": "^0.9.4",
"highlight.js": "^11.6.0",
"js-datepicker": "^5.18.0",
"notyf": "^3.10.0",
"codemirror": "^5.65.6",
"feather-icons": "^4.29.0",
"ionicons": "^6.0.2",
"plyr": "^3.7.2",
"postcss": "^8.4.14",
"simplebar": "^5.3.8"
},
"devDependencies": {
"@babel/cli": "^7.18.6",
"@babel/core": "^7.18.6",
"@babel/preset-env": "^7.18.6",
"@babel/register": "^7.18.6",
"autoprefixer": "^10.4.7",
"babelify": "^10.0.0",
"browser-sync": "^2.27.10",
"browserify": "^17.0.0",
"del": "^6.1.1",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^8.0.0",
"gulp-clean-css": "^4.3.0",
"gulp-concat": "^2.6.1",
"gulp-imagemin": "^8.0.0",
"gulp-postcss": "^9.0.1",
"gulp-purgecss": "^4.1.3",
"gulp-replace": "^1.1.3",
"gulp-sass": "^5.1.0",
"gulp-sourcemaps": "^3.0.0",
"gulp-uglify": "^3.0.2",
"gulp-webp": "^4.0.1",
"log-symbols": "^5.1.0",
"node-bourbon": "^4.2.8",
"panini": "^1.7.2",
"regenerator-runtime": "^0.13.9",
"sass": "^1.53.0",
"tslib": "^2.4.0",
"tsparticles-engine": "^2.3.2",
"tsparticles": "^2.3.2",
"vinyl-source-stream": "^2.0.0"
},
"scripts": {
"dev": "gulp",
"build": "gulp build",
"prod": "gulp prod"
},
"repository": {
"type": "git",
"url": "git+https://github.com/matteobruni/tsparticles"
},
"type": "module",
"node": "^12.20.0 || ^14.13.1 || >=16.0.0",
"keywords": [
"gulp",
"gulp4",
"bulma",
"bulmacss",
"sass"
],
"author": "Matteo Bruni <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/matteobruni/tsparticles/issues"
},
"homepage": "https://particles.js.org"
}
Binary file added particles.js.org-new/src/img/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions particles.js.org-new/src/img/icons/light-bulb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading