diff --git a/.gitignore b/.gitignore index b512c09..76add87 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules \ No newline at end of file +node_modules +dist \ No newline at end of file diff --git a/components/slider/ts/slider.ts b/components/slider/ts/slider.ts index e2981e4..9801093 100644 --- a/components/slider/ts/slider.ts +++ b/components/slider/ts/slider.ts @@ -62,7 +62,7 @@ function sliderGoToIndex ( index: number ) { currentSlideIndex = index; setTimeout( () => { okToMove = true; - }, 750 ); + }, 500 ); }, 1000 ); } else if ( index < 0 ) { sliderGoToIndex( sliderElements.length - 1 ); diff --git a/site/build.js b/site/build.js new file mode 100644 index 0000000..b926ae0 --- /dev/null +++ b/site/build.js @@ -0,0 +1,79 @@ +const fs = require( 'fs' ); +const navMenu = '' + fs.readFileSync( './src/nav.html' ); +const footer = '' + fs.readFileSync( './src/footer.html' ); + +/** + * Recursively find all HTML files in a directory + * @param {string} dir The directory to search. Either absolute or relative path + * @param {string} extension The file extension to look for + * @returns {string[]} returns a list of html files with their full path + */ +const treeWalker = ( dir, extension ) => { + const ls = fs.readdirSync( dir ); + const fileList = []; + for ( let file in ls ) { + if ( !ls[ file ].includes( '.' ) ) { + const newFiles = treeWalker( dir + '/' + ls[ file ], extension ); + for ( let file in newFiles ) { + fileList.push( newFiles[ file ] ); + } + } else if ( ls[ file ].includes( extension ) ) { + fileList.push( dir + '/' + ls[ file ] ); + } + } + + return fileList; +} + + +const addNavAndFooterToFile = ( file ) => { + const f = '' + fs.readFileSync( file ); + const navIndex = f.indexOf( '