diff --git a/package.json b/package.json index 6c67683..edde2c6 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "Portfolio Site", "main": "src/index.jsx", "scripts": { - "start": "parcel index.html", - "build": "parcel build index.html" + "start": "rm -v dist/* && node postbuild.js && parcel index.html", + "build": "rm -rv dist && parcel build index.html && exec node postbuild.js" }, "author": "", "license": "BSD-2-Clause", @@ -13,17 +13,20 @@ "@babel/core": "^7.12.3", "@babel/plugin-transform-react-jsx": "^7.12.5", "cssnano": "^4.1.10", - "parcel-bundler": "^1.12.4" + "parcel-bundler": "^1.12.4", + "typescript": "^4.0.5" }, "dependencies": { "@material-ui/core": "^4.11.0", "@types/react": "^16.9.56", "fontsource-roboto": "^3.0.3", + "hls.js": "^0.14.16", "preact": "^10.5.5", "preact-async-route": "^2.2.1", "preact-router": "^3.2.1", "react": "^16.14.0", - "react-dom": "^16.14.0" + "react-dom": "^16.14.0", + "video.js": "^7.10.2" }, "skipLibCheck": true, "alias": { diff --git a/postbuild.js b/postbuild.js new file mode 100644 index 0000000..b31e3de --- /dev/null +++ b/postbuild.js @@ -0,0 +1,54 @@ +const Path = require("path"); +const fs = require("fs"); + +fs.copyFile("./static/video/index0.ts", "./dist/index0.ts", (err) => { + if (err) { + return console.error("Video segments were not copied! \n", err); + } else { + return console.error("Video segments successfully copied! \n"); + } +}); + +fs.copyFile("./static/video/index1.ts", "./dist/index1.ts", (err) => { + if (err) { + return console.error("Video segments were not copied! \n", err); + } else { + return console.error("Video segments successfully copied! \n"); + } +}); + +fs.copyFile("./static/video/index2.ts", "./dist/index2.ts", (err) => { + if (err) { + return console.error("Video segments were not copied! \n", err); + } else { + return console.error("Video segments successfully copied! \n"); + } +}); +fs.copyFile("./static/video/index3.ts", "./dist/index3.ts", (err) => { + if (err) { + return console.error("Video segments were not copied! \n", err); + } else { + return console.error("Video segments successfully copied! \n"); + } +}); +fs.copyFile("./static/video/index4.ts", "./dist/index4.ts", (err) => { + if (err) { + return console.error("Video segments were not copied! \n", err); + } else { + return console.error("Video segments successfully copied! \n"); + } +}); +fs.copyFile("./static/video/index5.ts", "./dist/index5.ts", (err) => { + if (err) { + return console.error("Video segments were not copied! \n", err); + } else { + return console.error("Video segments successfully copied! \n"); + } +}); +fs.copyFile("./static/video/index6.ts", "./dist/index6.ts", (err) => { + if (err) { + return console.error("Video segments were not copied! \n", err); + } else { + return console.error("Video segments successfully copied! \n"); + } +}); diff --git a/src/Greeting.jsx b/src/Greeting.jsx index 1285e12..ad041dd 100644 --- a/src/Greeting.jsx +++ b/src/Greeting.jsx @@ -8,28 +8,29 @@ import { Button, } from "@material-ui/core"; import CV from "../static/cv.pdf"; -import PortfolioVideo from "../static/video/Portfolio.mp4"; -import PortfolioTexture from "../static/images/diagmonds-light.png"; + +import VideoPlayer from "./VideoPlayer.jsx"; class Greeting extends Component { render() { return (