├── .editorconfig ├── .eslintrc.json ├── .firebaserc ├── .gitignore ├── .nx └── cache │ └── 18.3.3-nx.win32-x64-msvc.node ├── .prettierrc ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── angular.json ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.json ├── firebase.json ├── img ├── blog.png ├── home.png ├── projects.png └── skills.png ├── karma.conf.js ├── ngsw-config.json ├── package-lock.json ├── package.json ├── src ├── app │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.ts │ ├── app.config.ts │ ├── app.routes.ts │ ├── core │ │ ├── footer │ │ │ ├── footer.component.html │ │ │ ├── footer.component.scss │ │ │ └── footer.component.ts │ │ ├── nav │ │ │ ├── nav.module.ts │ │ │ └── top-navbar │ │ │ │ ├── top-navbar.component.html │ │ │ │ ├── top-navbar.component.scss │ │ │ │ └── top-navbar.component.ts │ │ └── services │ │ │ ├── breakpoint.service.ts │ │ │ ├── dark-mode.service.ts │ │ │ └── firestore-data.service.ts │ ├── modules │ │ ├── contact │ │ │ ├── contact.component.html │ │ │ ├── contact.component.scss │ │ │ ├── contact.component.ts │ │ │ ├── contact.routes.ts │ │ │ ├── models │ │ │ │ └── contact.model.ts │ │ │ └── services │ │ │ │ ├── email-contact.service.ts │ │ │ │ └── form-control.service.ts │ │ ├── home │ │ │ ├── area.model.ts │ │ │ ├── home.component.html │ │ │ ├── home.component.scss │ │ │ └── home.component.ts │ │ ├── page-not-found │ │ │ ├── page-not-found.component.html │ │ │ ├── page-not-found.component.scss │ │ │ ├── page-not-found.component.ts │ │ │ └── page-not-found.routes.ts │ │ ├── posts │ │ │ ├── models │ │ │ │ └── unsplash.ts │ │ │ ├── post-list │ │ │ │ ├── post-detail │ │ │ │ │ ├── post-detail.component.html │ │ │ │ │ ├── post-detail.component.scss │ │ │ │ │ └── post-detail.component.ts │ │ │ │ ├── post-list.component.html │ │ │ │ ├── post-list.component.scss │ │ │ │ └── post-list.component.ts │ │ │ ├── post-services │ │ │ │ └── image.service.ts │ │ │ ├── post.model.ts │ │ │ └── posts.routes.ts │ │ ├── projects │ │ │ ├── project.model.ts │ │ │ ├── projects.component.html │ │ │ ├── projects.component.scss │ │ │ ├── projects.component.ts │ │ │ └── projects.routes.ts │ │ ├── skills │ │ │ ├── skill.model.ts │ │ │ ├── skills.component.html │ │ │ ├── skills.component.scss │ │ │ ├── skills.component.ts │ │ │ └── skills.routes.ts │ │ └── web-tech │ │ │ ├── data-item.model.ts │ │ │ ├── package-convert.pipe.ts │ │ │ ├── web-tech.component.html │ │ │ ├── web-tech.component.scss │ │ │ ├── web-tech.component.ts │ │ │ └── web-tech.routes.ts │ └── shared │ │ ├── components │ │ ├── postgres │ │ │ └── postgres.component.ts │ │ ├── svg-angular │ │ │ └── svg-angular.component.ts │ │ ├── svg-back-white │ │ │ ├── svg-back-white.component.ts │ │ │ └── svg-back-white.module.ts │ │ ├── svg-back │ │ │ └── svg-back.component.ts │ │ ├── svg-calender │ │ │ └── svg-calender.component.ts │ │ ├── svg-camera │ │ │ └── svg-camera.component.ts │ │ ├── svg-close │ │ │ └── svg-close.component.ts │ │ ├── svg-code │ │ │ └── svg-code.component.ts │ │ ├── svg-create │ │ │ └── svg-create.component.ts │ │ ├── svg-dark │ │ │ └── svg-dark.component.ts │ │ ├── svg-download │ │ │ └── svg-download.component.ts │ │ ├── svg-folder │ │ │ └── svg-folder.component.ts │ │ ├── svg-github │ │ │ ├── svg-github.component.ts │ │ │ └── svg-github.module.ts │ │ ├── svg-linkedin │ │ │ ├── svg-linkedin.component.ts │ │ │ └── svg-linkedin.module.ts │ │ ├── svg-menu │ │ │ └── svg-menu.component.ts │ │ ├── svg-timer │ │ │ └── svg-timer.component.ts │ │ ├── svg.component-accent.scss │ │ ├── svg.component.scss │ │ └── svg.topmenu.scss │ │ ├── pipes │ │ ├── date-convert.pipe.ts │ │ └── read-time.pipe.ts │ │ └── shared.module.ts ├── assets │ ├── .gitkeep │ ├── icons │ │ ├── apple_touch_icon.png │ │ ├── icon-128x128.png │ │ ├── icon-144x144.png │ │ ├── icon-152x152.png │ │ ├── icon-192x192.png │ │ ├── icon-384x384.png │ │ ├── icon-512x512.png │ │ ├── icon-72x72.png │ │ ├── icon-96x96.png │ │ └── tensorflow.png │ ├── images │ │ ├── laptop-desk.jpg │ │ └── thanks.jpg │ └── svgs │ │ ├── angular.svg │ │ ├── apollo.svg │ │ ├── approved-profile.svg │ │ ├── arcgis.svg │ │ ├── arrow_back.svg │ │ ├── base.svg │ │ ├── bitcoin.svg │ │ ├── blog.svg │ │ ├── bootstrap.svg │ │ ├── calender.svg │ │ ├── camera.svg │ │ ├── capacitor.svg │ │ ├── close.svg │ │ ├── code.svg │ │ ├── covid.svg │ │ ├── create.svg │ │ ├── cron.svg │ │ ├── css.svg │ │ ├── dark.svg │ │ ├── database.svg │ │ ├── download.svg │ │ ├── ejs.svg │ │ ├── email.svg │ │ ├── eng.svg │ │ ├── eslint.svg │ │ ├── esri.svg │ │ ├── expressjs.svg │ │ ├── firebase.svg │ │ ├── folder_open.svg │ │ ├── france.svg │ │ ├── full.svg │ │ ├── github.svg │ │ ├── github1.svg │ │ ├── google-cloud.svg │ │ ├── graphql.svg │ │ ├── heroku.svg │ │ ├── html.svg │ │ ├── iec.svg │ │ ├── ionic.svg │ │ ├── js.svg │ │ ├── koajs.svg │ │ ├── linkedin.svg │ │ ├── material.svg │ │ ├── materialui.svg │ │ ├── meanstack.svg │ │ ├── menu.svg │ │ ├── mongodb.svg │ │ ├── mongoose.svg │ │ ├── news.svg │ │ ├── next.svg │ │ ├── nodejs.svg │ │ ├── pie_chart.svg │ │ ├── postgresql.svg │ │ ├── profile-blue.svg │ │ ├── programming.svg │ │ ├── pwa.svg │ │ ├── python.svg │ │ ├── ratp.svg │ │ ├── react.svg │ │ ├── rss.svg │ │ ├── rxjs.svg │ │ ├── sequelize.svg │ │ ├── stencil.svg │ │ ├── svelte.svg │ │ ├── tailwind.svg │ │ ├── tensor.svg │ │ ├── timer.svg │ │ ├── typescript.svg │ │ ├── unsplash.svg │ │ └── vue.svg ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── manifest.webmanifest ├── polyfills.ts ├── robots.txt ├── sitemap.xml ├── styles.scss └── test.ts ├── tsconfig.app.json ├── tsconfig.json └── tsconfig.spec.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "ignorePatterns": [ 4 | "src/test.ts", "src/main.ts", "projects/**/*" 5 | ], 6 | "overrides": [ 7 | { 8 | "files": [ 9 | "*.ts" 10 | ], 11 | "extends": [ 12 | "eslint:recommended", 13 | "plugin:@typescript-eslint/recommended", 14 | "plugin:@angular-eslint/recommended", 15 | "plugin:@angular-eslint/template/process-inline-templates" 16 | ], 17 | "rules": { 18 | "@angular-eslint/directive-selector": [ 19 | "error", 20 | { 21 | "type": "attribute", 22 | "prefix": "app", 23 | "style": "camelCase" 24 | } 25 | ], 26 | "@angular-eslint/component-selector": [ 27 | "error", 28 | { 29 | "type": "element", 30 | "prefix": "app", 31 | "style": "kebab-case" 32 | } 33 | ] 34 | } 35 | }, 36 | { 37 | "files": [ 38 | "*.html" 39 | ], 40 | "extends": [ 41 | "plugin:@angular-eslint/template/recommended", 42 | "plugin:@angular-eslint/template/accessibility" 43 | ], 44 | "rules": { 45 | "no-undefined": "error", 46 | "no-var": "error", 47 | "prefer-const": "error", 48 | "func-names": "error", 49 | "id-length": "error", 50 | "newline-before-return": "error", 51 | "space-before-blocks": "error", 52 | "no-alert": "error" 53 | } 54 | } 55 | ] 56 | } 57 | -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "angular-blog-14cef" 4 | }, 5 | "targets": { 6 | "angular-blog-14cef": { 7 | "hosting": { 8 | "angular-material-portfolio": [ 9 | "angular-blog-14cef" 10 | ] 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | speed-measure-plugin*.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .angular 21 | .firebase/ 22 | .classpath 23 | .c9/ 24 | *.launch 25 | .settings/ 26 | *.sublime-workspace 27 | 28 | # IDE - VSCode 29 | .vscode/* 30 | !.vscode/settings.json 31 | !.vscode/tasks.json 32 | !.vscode/launch.json 33 | !.vscode/extensions.json 34 | .history/* 35 | 36 | # misc 37 | /.angular/cache 38 | /.sass-cache 39 | /connect.lock 40 | /coverage 41 | /libpeerconnection.log 42 | npm-debug.log 43 | yarn-error.log 44 | testem.log 45 | /typings 46 | 47 | # System Files 48 | .DS_Store 49 | Thumbs.db 50 | -------------------------------------------------------------------------------- /.nx/cache/18.3.3-nx.win32-x64-msvc.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/.nx/cache/18.3.3-nx.win32-x64-msvc.node -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 2, 3 | "useTabs": true, 4 | "singleQuote": false, 5 | "semi": true, 6 | "bracketSpacing": true, 7 | "arrowParens": "avoid", 8 | "trailingComma": "es5", 9 | "bracketSameLine": true, 10 | "printWidth": 80, 11 | "endOfLine":"auto" 12 | } 13 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[html]": { 3 | "editor.defaultFormatter": "esbenp.prettier-vscode", 4 | "editor.codeActionsOnSave": { 5 | "source.fixAll.eslint": "explicit" 6 | }, 7 | "editor.formatOnSave": false 8 | }, 9 | "[typescript]": { 10 | "editor.defaultFormatter": "esbenp.prettier-vscode", 11 | "editor.codeActionsOnSave": { 12 | "source.fixAll.eslint": "explicit" 13 | }, 14 | "editor.formatOnSave": false 15 | }, 16 | "typescript.tsdk": "node_modules\\typescript\\lib", 17 | "[html][typescript]": { 18 | "editor.codeActionsOnSave": { 19 | "source.fixAll.eslint": "explicit" 20 | } 21 | }, 22 | } 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Andrew Bateman 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "angular-material-portfolio": { 7 | "projectType": "application", 8 | "schematics": { 9 | "@schematics/angular:component": { 10 | "style": "scss" 11 | } 12 | }, 13 | "root": "", 14 | "sourceRoot": "src", 15 | "prefix": "app", 16 | "architect": { 17 | "build": { 18 | "builder": "@angular-devkit/build-angular:application", 19 | "options": { 20 | "allowedCommonJsDependencies": [ 21 | "firebase/app", 22 | "@firebase/firestore", 23 | "@firebase/component", 24 | "@firebase/util", 25 | "@firebase/app", 26 | "dayjs", 27 | "idb" 28 | ], 29 | "outputPath": "dist/angular-material-portfolio", 30 | "index": "src/index.html", 31 | "browser": "src/main.ts", 32 | "polyfills": [ 33 | "zone.js" 34 | ], 35 | "tsConfig": "tsconfig.app.json", 36 | "inlineStyleLanguage": "scss", 37 | "assets": [ 38 | "src/favicon.ico", 39 | "src/assets", 40 | "src/manifest.webmanifest", 41 | "src/sitemap.xml", 42 | "src/robots.txt" 43 | ], 44 | "styles": [ 45 | "src/styles.scss" 46 | ], 47 | "scripts": [] 48 | }, 49 | "configurations": { 50 | "production": { 51 | "fileReplacements": [ 52 | { 53 | "replace": "src/environments/environment.ts", 54 | "with": "src/environments/environment.prod.ts" 55 | } 56 | ], 57 | "optimization": { 58 | "styles": { 59 | "minify": true, 60 | "inlineCritical": true 61 | } 62 | }, 63 | "extractLicenses": false, 64 | "budgets": [ 65 | { 66 | "type": "initial", 67 | "maximumWarning": "500kb", 68 | "maximumError": "2mb" 69 | }, 70 | { 71 | "type": "anyComponentStyle", 72 | "maximumWarning": "6kb", 73 | "maximumError": "4mb" 74 | } 75 | ], 76 | "outputHashing": "all", 77 | "serviceWorker":"ngsw-config.json" 78 | }, 79 | "development": { 80 | "optimization": false, 81 | "extractLicenses": false, 82 | "sourceMap": true 83 | } 84 | } 85 | }, 86 | "serve": { 87 | "builder": "@angular-devkit/build-angular:dev-server", 88 | "options": { 89 | "buildTarget": "angular-material-portfolio:build" 90 | }, 91 | "configurations": { 92 | "production": { 93 | "buildTarget": "angular-material-portfolio:build:production" 94 | }, 95 | "development": { 96 | "buildTarget": "angular-material-portfolio:build:development" 97 | } 98 | }, 99 | "defaultConfiguration": "development" 100 | }, 101 | "extract-i18n": { 102 | "builder": "@angular-devkit/build-angular:extract-i18n", 103 | "options": { 104 | "buildTarget": "angular-material-portfolio:build" 105 | } 106 | }, 107 | "test": { 108 | "builder": "@angular-devkit/build-angular:karma", 109 | "options": { 110 | "main": "src/test.ts", 111 | "polyfills": [ 112 | "zone.js" 113 | ], 114 | "tsConfig": "tsconfig.spec.json", 115 | "karmaConfig": "karma.conf.js", 116 | "assets": [ 117 | "src/favicon.ico", 118 | "src/assets", 119 | "src/manifest.webmanifest" 120 | ], 121 | "styles": [ 122 | "src/styles.scss" 123 | ], 124 | "scripts": [] 125 | } 126 | }, 127 | "e2e": { 128 | "builder": "@angular-devkit/build-angular:protractor", 129 | "options": { 130 | "protractorConfig": "e2e/protractor.conf.js", 131 | "devServerTarget": "angular-material-portfolio:serve" 132 | }, 133 | "configurations": { 134 | "production": { 135 | "devServerTarget": "angular-material-portfolio:serve:production" 136 | } 137 | } 138 | }, 139 | "deploy": { 140 | "builder": "@angular/fire:deploy", 141 | "options": {} 142 | }, 143 | "lint": { 144 | "builder": "@angular-eslint/builder:lint", 145 | "options": { 146 | "lintFilePatterns": [ 147 | "src/**/*.ts", 148 | "src/**/*.html" 149 | ] 150 | } 151 | } 152 | } 153 | } 154 | }, 155 | "cli": { 156 | "analytics": false, 157 | "schematicCollections": [ 158 | "@angular-eslint/schematics" 159 | ] 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | // @ts-check 3 | // Protractor configuration file, see link for more information 4 | // https://github.com/angular/protractor/blob/master/lib/config.ts 5 | 6 | const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter') 7 | 8 | /** 9 | * @type { import("protractor").Config } 10 | */ 11 | exports.config = { 12 | allScriptsTimeout: 11000, 13 | specs: ['./src/**/*.e2e-spec.ts'], 14 | capabilities: { 15 | browserName: 'chrome' 16 | }, 17 | directConnect: true, 18 | baseUrl: 'http://localhost:4200/', 19 | framework: 'jasmine', 20 | jasmineNodeOpts: { 21 | showColors: true, 22 | defaultTimeoutInterval: 30000, 23 | // eslint-disable-next-line @typescript-eslint/no-empty-function 24 | print: function () {} 25 | }, 26 | onPrepare () { 27 | require('ts-node').register({ 28 | project: require('path').join(__dirname, './tsconfig.json') 29 | }) 30 | jasmine.getEnv().addReporter( 31 | new SpecReporter({ 32 | spec: { 33 | displayStacktrace: StacktraceOption.PRETTY 34 | } 35 | }) 36 | ) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from "./app.po"; 2 | import { browser, logging } from "protractor"; 3 | 4 | describe("workspace-project App", () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it("should display welcome message", () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual( 14 | "angular-material-portfolio app is running!" 15 | ); 16 | }); 17 | 18 | afterEach(async () => { 19 | // Assert that there are no errors emitted from the browser 20 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 21 | expect(logs).not.toContain( 22 | jasmine.objectContaining({ 23 | level: logging.Level.SEVERE, 24 | } as logging.Entry) 25 | ); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-explicit-any */ 2 | import { browser, by, element } from "protractor"; 3 | 4 | export class AppPage { 5 | async navigateTo() { 6 | return await (browser.get(browser.baseUrl) as Promise); 7 | } 8 | 9 | async getTitleText() { 10 | return await (element( 11 | by.css("app-root .content span") 12 | ).getText() as Promise); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es2018", 7 | "types": ["jasmine", "jasminewd2", "node"] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": { 3 | "public": "dist/angular-material-portfolio/browser", 4 | "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], 5 | "rewrites": [ 6 | { 7 | "source": "**", 8 | "destination": "/index.html" 9 | } 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /img/blog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/img/blog.png -------------------------------------------------------------------------------- /img/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/img/home.png -------------------------------------------------------------------------------- /img/projects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/img/projects.png -------------------------------------------------------------------------------- /img/skills.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/img/skills.png -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: "", 7 | frameworks: ["jasmine", "@angular-devkit/build-angular"], 8 | plugins: [ 9 | require("karma-jasmine"), 10 | require("karma-chrome-launcher"), 11 | require("karma-jasmine-html-reporter"), 12 | require("karma-coverage-istanbul-reporter"), 13 | require("@angular-devkit/build-angular/plugins/karma"), 14 | ], 15 | client: { 16 | clearContext: false, // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | // eslint-disable-next-line @typescript-eslint/no-var-requires 20 | dir: require("path").join( 21 | __dirname, 22 | "./coverage/angular-material-portfolio" 23 | ), 24 | reports: ["html", "lcovonly", "text-summary"], 25 | fixWebpackSourcePaths: true, 26 | }, 27 | reporters: ["progress", "kjhtml"], 28 | port: 9876, 29 | colors: true, 30 | logLevel: config.LOG_INFO, 31 | autoWatch: true, 32 | browsers: ["Chrome"], 33 | singleRun: false, 34 | restartOnFileChange: true, 35 | }); 36 | }; 37 | -------------------------------------------------------------------------------- /ngsw-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/service-worker/config/schema.json", 3 | "index": "/index.html", 4 | "assetGroups": [ 5 | { 6 | "name": "app", 7 | "installMode": "prefetch", 8 | "resources": { 9 | "files": [ 10 | "/favicon.ico", 11 | "/index.html", 12 | "/manifest.webmanifest", 13 | "/*.css", 14 | "/*.js" 15 | ] 16 | } 17 | }, 18 | { 19 | "name": "assets", 20 | "installMode": "lazy", 21 | "updateMode": "prefetch", 22 | "resources": { 23 | "files": [ 24 | "**/assets/**", 25 | "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)" 26 | ] 27 | } 28 | } 29 | ], 30 | "dataGroups": [] 31 | } 32 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-material-portfolio", 3 | "version": "1.0.0", 4 | "type": "commonjs", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve", 8 | "build": "ng build --configuration production --source-map=false", 9 | "server": "http-server -p 8080 dist/angular-material-portfolio/browser", 10 | "test": "ng test", 11 | "lint": "ng lint --fix", 12 | "format": "prettier --write --config .prettierrc \"src/**/*.{js,ts,html,scss,json}", 13 | "e2e": "ng e2e", 14 | "explore": "source-map-explorer dist/**/*.js" 15 | }, 16 | "private": true, 17 | "dependencies": { 18 | "@angular/animations": "^18.0.1", 19 | "@angular/cdk": "^18.0.1", 20 | "@angular/common": "^18.0.1", 21 | "@angular/compiler": "^18.0.1", 22 | "@angular/core": "^18.0.1", 23 | "@angular/fire": "^18.0.1", 24 | "@angular/forms": "^18.0.1", 25 | "@angular/material": "^18.0.1", 26 | "@angular/platform-browser": "^18.0.1", 27 | "@angular/platform-browser-dynamic": "^18.0.1", 28 | "@angular/platform-server": "^18.0.1", 29 | "@angular/pwa": "^18.0.2", 30 | "@angular/router": "^18.0.1", 31 | "@angular/service-worker": "^18.0.1", 32 | "dayjs": "^1.11.11", 33 | "express": "^4.19.2", 34 | "firebase": "^10.12.2", 35 | "ngx-picture": "^3.0.0", 36 | "rxjs": "^7.8.1", 37 | "tslib": "^2.6.2", 38 | "zone.js": "~0.14.6" 39 | }, 40 | "devDependencies": { 41 | "@angular-devkit/architect": "^0.1800.2", 42 | "@angular-devkit/build-angular": "^18.0.2", 43 | "@angular-eslint/builder": "18.0.1", 44 | "@angular-eslint/eslint-plugin": "18.0.1", 45 | "@angular-eslint/eslint-plugin-template": "18.0.1", 46 | "@angular-eslint/schematics": "18.0.1", 47 | "@angular-eslint/template-parser": "18.0.1", 48 | "@angular/cli": "^18.0.2", 49 | "@angular/compiler-cli": "^18.0.1", 50 | "@angular/language-service": "^18.0.1", 51 | "@types/compression": "^1.7.5", 52 | "@types/express": "^4.17.21", 53 | "@types/istanbul-lib-coverage": "^2.0.6", 54 | "@types/jasmine": "~5.1.4", 55 | "@types/jasminewd2": "~2.0.13", 56 | "@types/node": "^20.12.14", 57 | "@typescript-eslint/eslint-plugin": "7.11.0", 58 | "@typescript-eslint/parser": "7.11.0", 59 | "brotli-webpack-plugin": "^1.1.0", 60 | "codelyzer": "^0.0.28", 61 | "eslint": "^9.3.0", 62 | "eslint-config-prettier": "^9.1.0", 63 | "eslint-config-standard-with-typescript": "^43.0.0", 64 | "eslint-plugin-import": "^2.29.1", 65 | "eslint-plugin-prettier": "^5.1.3", 66 | "eslint-plugin-promise": "^6.2.0", 67 | "firebase-tools": "^13.10.2", 68 | "fuzzy": "^0.1.3", 69 | "inquirer": "^9.2.23", 70 | "inquirer-autocomplete-prompt": "^3.0.1", 71 | "jasmine-core": "~5.1.2", 72 | "jasmine-spec-reporter": "~7.0.0", 73 | "karma": "~6.4.3", 74 | "karma-chrome-launcher": "~3.2.0", 75 | "karma-coverage-istanbul-reporter": "~3.0.3", 76 | "karma-jasmine": "~5.1.0", 77 | "karma-jasmine-html-reporter": "^2.1.0", 78 | "prettier": "^3.2.5", 79 | "prettier-eslint": "^16.3.0", 80 | "protractor": "^3.3.0", 81 | "source-map-explorer": "^2.5.3", 82 | "ts-loader": "^9.5.1", 83 | "ts-node": "~10.9.2", 84 | "typescript": "^5.4.5" 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 | 5 |
6 | 7 | 110 | 111 | 112 | 113 | 114 |
115 | 116 |
117 | -------------------------------------------------------------------------------- /src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | /* for sidenav to take a whole page */ 2 | .root-container { 3 | min-height: calc(100vh); 4 | 5 | .container { 6 | padding-bottom: 50px; 7 | 8 | mat-sidenav-container { 9 | height: 100vh; 10 | 11 | .sidenav-drawer { 12 | overflow: hidden; 13 | position: relative; 14 | width: 60px; 15 | max-width: 60px !important; 16 | .sidenav-list { 17 | background-color: #455a64 !important; 18 | height: 100%; 19 | position: fixed; 20 | min-height: 100vh; 21 | } 22 | 23 | .sidenav-image { 24 | margin: 16px 26px !important; 25 | background-color: white !important; 26 | width: 40px; 27 | height: 40px; 28 | } 29 | 30 | .sidenav-divider { 31 | border-top-color: white; 32 | color: rgb(173, 211, 255) !important; 33 | margin: 8px 0; 34 | } 35 | 36 | .side-link { 37 | color: #fff; 38 | } 39 | 40 | .sidenav-item { 41 | padding: 8px 16px; 42 | } 43 | 44 | .side-link-social { 45 | color: #fff !important; 46 | text-decoration: underline; 47 | text-decoration-color: #fff; 48 | padding: 8px 16px; 49 | } 50 | 51 | .side-link-active { 52 | color: rgb(173, 211, 255); 53 | font-weight: bold; 54 | } 55 | 56 | .sidenav-bar-social { 57 | margin: 0 auto; 58 | padding: 0 auto; 59 | text-align: center; 60 | } 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * The main application component. 3 | * 4 | * Initializes Angular metadata like change detection strategy, template, and styles. 5 | * Imports and declares child components. 6 | * Implements logic for theme switching between light and dark modes. 7 | * Handles SEO metadata in ngOnInit. 8 | */ 9 | import { 10 | Component, 11 | HostBinding, 12 | OnInit, 13 | ChangeDetectionStrategy, 14 | } from "@angular/core"; 15 | import { NgClass } from "@angular/common"; 16 | import { Meta } from "@angular/platform-browser"; 17 | import { FooterComponent } from "./core/footer/footer.component"; 18 | import { RouterOutlet } from "@angular/router"; 19 | import { RouterLinkActive, RouterLink } from "@angular/router"; 20 | import { MatDividerModule } from "@angular/material/divider"; 21 | import { MatListModule } from "@angular/material/list"; 22 | import { MatSidenavModule } from "@angular/material/sidenav"; 23 | import { TopNavbarComponent } from "./core/nav/top-navbar/top-navbar.component"; 24 | 25 | import { SvgCloseComponent } from "./shared/components/svg-close/svg-close.component"; 26 | import { SvgLinkedinModule } from "./shared/components/svg-linkedin/svg-linkedin.module"; 27 | import { SvgGithubModule } from "./shared/components/svg-github/svg-github.module"; 28 | 29 | @Component({ 30 | selector: "app-root", 31 | changeDetection: ChangeDetectionStrategy.OnPush, 32 | templateUrl: "./app.component.html", 33 | styleUrls: ["./app.component.scss"], 34 | standalone: true, 35 | imports: [ 36 | MatListModule, 37 | MatDividerModule, 38 | RouterLinkActive, 39 | RouterLink, 40 | TopNavbarComponent, 41 | NgClass, 42 | MatSidenavModule, 43 | RouterOutlet, 44 | FooterComponent, 45 | SvgLinkedinModule, 46 | SvgCloseComponent, 47 | SvgGithubModule, 48 | ], 49 | }) 50 | export class AppComponent implements OnInit { 51 | private isDark = false; 52 | 53 | @HostBinding("class") 54 | get themeMode(): string | boolean { 55 | return this.isDark ? "dark-theme" : "light-theme"; 56 | } 57 | 58 | constructor(private readonly metaTagService: Meta) {} 59 | 60 | ngOnInit(): void { 61 | this.metaTagService.addTags([ 62 | { 63 | name: "keywords", 64 | content: "Angular SEO Integration, posts, contact, projects, portfolio", 65 | }, 66 | { name: "robots", content: "index" }, 67 | { name: "author", content: "Andrew Bateman" }, 68 | { name: "viewport", content: "width=device-width, initial-scale=1" }, 69 | { name: "date", content: "2020-06-08", scheme: "YYYY-MM-DD" }, 70 | { charset: "UTF-8" }, 71 | ]); 72 | } 73 | 74 | switchMode(isDarkMode: boolean): void { 75 | this.isDark = isDarkMode; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { 2 | ApplicationConfig, 3 | importProvidersFrom, 4 | isDevMode, 5 | } from "@angular/core"; 6 | import { provideRouter } from "@angular/router"; 7 | 8 | import { routes } from "./app.routes"; 9 | import { provideServiceWorker } from "@angular/service-worker"; 10 | import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; 11 | 12 | export const appConfig: ApplicationConfig = { 13 | providers: [ 14 | provideRouter(routes), 15 | provideServiceWorker("ngsw-worker.js", { 16 | enabled: !isDevMode(), 17 | registrationStrategy: "registerWhenStable:30000", 18 | }), 19 | importProvidersFrom([BrowserAnimationsModule]), 20 | ], 21 | }; 22 | -------------------------------------------------------------------------------- /src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import type { Route } from "@angular/router"; 2 | import { HomeComponent } from "./modules/home/home.component"; 3 | 4 | export const routes: Route[] = [ 5 | { 6 | path: "", 7 | redirectTo: "/home", 8 | pathMatch: "full", 9 | }, 10 | { 11 | path: "home", 12 | component: HomeComponent, 13 | }, 14 | { 15 | path: "projects", 16 | loadChildren: () => 17 | import("./modules/projects/projects.routes").then( 18 | mod => mod.PROJECTS_ROUTES 19 | ), 20 | }, 21 | { 22 | path: "skills", 23 | loadChildren: () => 24 | import("./modules/skills/skills.routes").then(mod => mod.SKILLS_ROUTES), 25 | }, 26 | { 27 | path: "posts", 28 | loadChildren: () => 29 | import("./modules/posts/posts.routes").then(mod => mod.POSTS_ROUTES), 30 | }, 31 | { 32 | path: "contact", 33 | loadChildren: () => 34 | import("./modules/contact/contact.routes").then( 35 | mod => mod.CONTACT_ROUTES 36 | ), 37 | }, 38 | { 39 | path: "web-tech", 40 | loadChildren: () => 41 | import("./modules/web-tech/web-tech.routes").then( 42 | mod => mod.WEBTECH_ROUTES 43 | ), 44 | }, 45 | { 46 | path: "**", 47 | loadChildren: () => 48 | import("./modules/page-not-found/page-not-found.routes").then( 49 | mod => mod.NOTFOUND_ROUTES 50 | ), 51 | }, 52 | ]; 53 | -------------------------------------------------------------------------------- /src/app/core/footer/footer.component.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | -------------------------------------------------------------------------------- /src/app/core/footer/footer.component.scss: -------------------------------------------------------------------------------- 1 | .footer { 2 | position: absolute; 3 | bottom: 0; 4 | left: 0; 5 | right: 0; 6 | line-height: 25px; 7 | padding-left: 16px; 8 | padding-right: 16px; 9 | padding-top: 8px; 10 | 11 | p { 12 | margin: 8px 0; 13 | font-weight: 300; 14 | font-size: medium; 15 | 16 | .footer-contrast-text { 17 | color: #add3ff; 18 | } 19 | } 20 | 21 | .general-link { 22 | color: white; 23 | padding: 0 16px; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/app/core/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Footer component displays the footer content like copyright info. 3 | * Implements OnInit to get the current year on initialization. 4 | */ 5 | import { Component, type OnInit } from "@angular/core"; 6 | import { RouterLink } from "@angular/router"; 7 | import { MatToolbarModule } from "@angular/material/toolbar"; 8 | import { DatePipe } from "@angular/common"; 9 | 10 | @Component({ 11 | selector: "app-footer", 12 | templateUrl: "./footer.component.html", 13 | styleUrls: ["./footer.component.scss"], 14 | standalone: true, 15 | imports: [MatToolbarModule, RouterLink], 16 | providers: [DatePipe], 17 | }) 18 | export class FooterComponent implements OnInit { 19 | currentYear!: string; 20 | 21 | constructor(private datePipe: DatePipe) {} 22 | 23 | ngOnInit(): void { 24 | this.currentYear = this.getCurrentYear(); 25 | } 26 | 27 | getCurrentYear(): string { 28 | return this.datePipe.transform(new Date(), "yyyy")!; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/app/core/nav/nav.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { TopNavbarComponent } from "./top-navbar/top-navbar.component"; 3 | 4 | import { SvgDarkComponent } from "../../shared/components/svg-dark/svg-dark.component"; 5 | import { SvgMenuComponent } from "../../shared/components/svg-menu/svg-menu.component"; 6 | import { SvgDownloadComponent } from "../../shared/components/svg-download/svg-download.component"; 7 | import { SvgCloseComponent } from "../../shared/components/svg-close/svg-close.component"; 8 | import { SvgCreateComponent } from "../../shared/components/svg-create/svg-create.component"; 9 | 10 | import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; 11 | import { routes } from "../../app.routes"; 12 | 13 | import { SharedModule } from "../../shared/shared.module"; 14 | import { SvgGithubModule } from "src/app/shared/components/svg-github/svg-github.module"; 15 | import { MatListModule } from "@angular/material/list"; 16 | import { MatSidenavModule } from "@angular/material/sidenav"; 17 | import { MatToolbarModule } from "@angular/material/toolbar"; 18 | import { MatButtonModule } from "@angular/material/button"; 19 | import { MatSlideToggleModule } from "@angular/material/slide-toggle"; 20 | import { provideRouter, withComponentInputBinding } from "@angular/router"; 21 | import { SvgLinkedinModule } from "src/app/shared/components/svg-linkedin/svg-linkedin.module"; 22 | 23 | @NgModule({ 24 | imports: [ 25 | SvgGithubModule, 26 | SvgLinkedinModule, 27 | BrowserAnimationsModule, 28 | SharedModule, 29 | MatListModule, 30 | MatToolbarModule, 31 | MatSidenavModule, 32 | MatButtonModule, 33 | MatSlideToggleModule, 34 | TopNavbarComponent, 35 | SvgDarkComponent, 36 | SvgMenuComponent, 37 | SvgDownloadComponent, 38 | SvgCloseComponent, 39 | SvgCreateComponent, 40 | ], 41 | exports: [TopNavbarComponent, SvgDarkComponent], 42 | providers: [provideRouter(routes, withComponentInputBinding())], 43 | }) 44 | export class NavModule {} 45 | -------------------------------------------------------------------------------- /src/app/core/nav/top-navbar/top-navbar.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @if ( 5 | this.breakpointService.breakpointColumnNr$ && 6 | (this.breakpointService.breakpointColumnNr$ | async) === 1 7 | ) { 8 | 15 | } 16 | 17 | Home 28 | 29 | 37 | 38 | 39 | 40 | @if ( 41 | this.breakpointService.breakpointColumnNr$ && 42 | (this.breakpointService.breakpointColumnNr$ | async) !== 1 43 | ) { 44 |
45 | Projects 55 | Skills 65 | Contact 75 | Posts 85 | 93 | 101 |
102 | } 103 |
104 |
105 | -------------------------------------------------------------------------------- /src/app/core/nav/top-navbar/top-navbar.component.scss: -------------------------------------------------------------------------------- 1 | .top-nav-toolbar { 2 | padding: 4px 0; 3 | position: relative; 4 | 5 | .top-nav-link { 6 | color: white !important; 7 | text-decoration: none; 8 | } 9 | 10 | .top-link-social { 11 | margin-top: 8px !important; 12 | padding: 0 16px 0 4px; 13 | color: #eaecf5; 14 | font-size: 14px !important; 15 | text-decoration: underline; 16 | text-decoration-color: #fff; 17 | } 18 | 19 | .top-link-active { 20 | color: rgb(173, 211, 255) !important; 21 | } 22 | 23 | .top-nav-rhs { 24 | margin-left: auto; 25 | margin-right: 0; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/app/core/nav/top-navbar/top-navbar.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Top navigation bar component. 3 | * 4 | * Declares Angular component with selector 'app-top-navbar'. 5 | * 6 | * Imports Angular modules and components needed. 7 | * 8 | * Exports component class TopNavbarComponent implementing OnInit. 9 | * 10 | * Contains properties to inject BreakpointService and DarkModeService. 11 | * 12 | * Handles toggling dark mode on/off and emitting event. 13 | * 14 | * Handles side navigation open/close and emitting event. 15 | * 16 | * Initializes by setting up dark mode from service. 17 | */ 18 | import { 19 | Component, 20 | Output, 21 | EventEmitter, 22 | inject, 23 | type OnInit, 24 | } from "@angular/core"; 25 | import { 26 | type MatSlideToggleChange, 27 | MatSlideToggleModule, 28 | } from "@angular/material/slide-toggle"; 29 | 30 | import { BreakpointService } from "../../services/breakpoint.service"; 31 | import { DarkModeService } from "../../services/dark-mode.service"; 32 | import { SvgDarkComponent } from "../../../shared/components/svg-dark/svg-dark.component"; 33 | import { RouterLinkActive, RouterLink } from "@angular/router"; 34 | import { MatButtonModule } from "@angular/material/button"; 35 | import { SvgMenuComponent } from "../../../shared/components/svg-menu/svg-menu.component"; 36 | import { AsyncPipe } from "@angular/common"; 37 | import { MatToolbarModule } from "@angular/material/toolbar"; 38 | import { SvgGithubModule } from "src/app/shared/components/svg-github/svg-github.module"; 39 | import { SvgLinkedinModule } from "src/app/shared/components/svg-linkedin/svg-linkedin.module"; 40 | 41 | @Component({ 42 | selector: "app-top-navbar", 43 | templateUrl: "./top-navbar.component.html", 44 | styleUrls: ["./top-navbar.component.scss"], 45 | standalone: true, 46 | imports: [ 47 | MatToolbarModule, 48 | SvgMenuComponent, 49 | SvgGithubModule, 50 | SvgLinkedinModule, 51 | MatButtonModule, 52 | RouterLinkActive, 53 | RouterLink, 54 | MatSlideToggleModule, 55 | SvgDarkComponent, 56 | AsyncPipe, 57 | ], 58 | }) 59 | export class TopNavbarComponent implements OnInit { 60 | breakpointService = inject(BreakpointService); 61 | darkModeService = inject(DarkModeService); 62 | 63 | isDarkMode = false; 64 | 65 | @Output() readonly darkModeSwitched = new EventEmitter(); 66 | @Output() public sidenavToggle: EventEmitter = 67 | new EventEmitter(); 68 | 69 | ngOnInit(): void { 70 | this.darkModeService.initDarkMode(); 71 | } 72 | 73 | toggleSidenav = (): void => { 74 | this.sidenavToggle.emit(); 75 | }; 76 | 77 | // user can toggle dark mode so checked is true or false 78 | // save this value in local storage and emit so app scss can be changed 79 | onDarkModeSwitched({ checked }: MatSlideToggleChange): void { 80 | localStorage.setItem("darkMode", JSON.stringify(checked)); 81 | this.darkModeSwitched.emit(checked); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/app/core/services/breakpoint.service.ts: -------------------------------------------------------------------------------- 1 | import { BreakpointObserver, Breakpoints } from "@angular/cdk/layout"; 2 | import { Injectable, inject } from "@angular/core"; 3 | import { map, shareReplay } from "rxjs/operators"; 4 | 5 | /** 6 | * numberGridColumns enum provides a mapping of screen size breakpoints to number of grid columns. 7 | */ 8 | enum BreakpointSize { 9 | XSmall = 1, 10 | Small = 2, 11 | Medium = 3, 12 | Large = 4, 13 | } 14 | 15 | @Injectable({ 16 | providedIn: "root", 17 | }) 18 | /** 19 | * BreakpointService provides information about current viewport size breakpoints. 20 | * It uses Angular CDK BreakpointObserver to get breakpoint state, and maps it to 21 | * a number of grid columns to use for grid layouts. 22 | */ 23 | export class BreakpointService { 24 | breakpointObserver = inject(BreakpointObserver); 25 | 26 | // return number of grid columns based on user screen size breakpoint, default 4 27 | breakpointColumnNr$ = this.breakpointObserver 28 | .observe([Breakpoints.XSmall, Breakpoints.Small, Breakpoints.Medium]) 29 | .pipe( 30 | map(state => 31 | state.breakpoints[Breakpoints.XSmall] 32 | ? BreakpointSize.XSmall 33 | : state.breakpoints[Breakpoints.Small] 34 | ? BreakpointSize.Small 35 | : state.breakpoints[Breakpoints.Medium] 36 | ? BreakpointSize.Medium 37 | : BreakpointSize.Large 38 | ), 39 | shareReplay(1) 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /src/app/core/services/dark-mode.service.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * DarkModeService handles toggling dark mode on and off. 3 | * 4 | * It uses localStorage to persist the dark mode setting. 5 | * The isDarkModeEnabled property tracks whether dark mode is on. 6 | * 7 | * The initDarkMode method initializes the dark mode setting from localStorage. 8 | * 9 | * The toggleDarkMode method updates localStorage and emits an event 10 | * to notify components when dark mode changes. 11 | * 12 | * The darkModeSwitched EventEmitter allows components to subscribe to 13 | * dark mode change events. 14 | */ 15 | import { Injectable, Output, EventEmitter } from "@angular/core"; 16 | 17 | @Injectable({ 18 | providedIn: "root", 19 | }) 20 | export class DarkModeService { 21 | isDarkModeEnabled = false; 22 | DARK_MODE_KEY = "darkMode"; 23 | 24 | @Output() readonly darkModeSwitched = new EventEmitter(); 25 | 26 | initDarkMode = () => { 27 | const localMode = localStorage.getItem(this.DARK_MODE_KEY); 28 | 29 | // If dark mode not defined in local storage then default to dark mode false 30 | // If dark mode is defined in local storage then parse value to define dark mode 31 | this.isDarkModeEnabled = localMode == null ? false : JSON.parse(localMode); 32 | }; 33 | 34 | toggleDarkMode(checked: boolean): void { 35 | localStorage.setItem(this.DARK_MODE_KEY, JSON.stringify(checked)); 36 | this.darkModeSwitched.emit(checked); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/app/core/services/firestore-data.service.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-explicit-any */ 2 | /** 3 | * FirestoreDataService provides methods to fetch data from Firestore 4 | * and transform the results into sorted Observables. 5 | * 6 | * The getData method fetches a collection from Firestore, converts it to 7 | * an Observable array, sorts the items, and shares the Observable to prevent 8 | * duplicate requests. 9 | * 10 | * The sort methods sort by id if available, otherwise by published date. 11 | */ 12 | import { Injectable, inject } from "@angular/core"; 13 | import { Firestore, collection, collectionData } from "@angular/fire/firestore"; 14 | import { Observable, map, shareReplay } from "rxjs"; 15 | 16 | interface Item { 17 | id?: number; 18 | title: string; 19 | subtitle: string; 20 | content: string; 21 | svgPath: string; 22 | published?: { minutes: number; seconds: number }; 23 | } 24 | 25 | @Injectable({ 26 | providedIn: "root", 27 | }) 28 | export class FirestoreDataService { 29 | data$: Observable = new Observable(); 30 | firestore: Firestore = inject(Firestore); 31 | id = 0; 32 | 33 | // get array collection from Firestore const {second} = 34 | // If collection items had an id then sort data by id (number or string) 35 | // Otherwise sort items by published date (only applies to posts) 36 | // use shareReplay to avoid repeated http calls for unchanged data 37 | getData(collectionName: string): Observable { 38 | const data = collection(this.firestore, collectionName); 39 | const unsortedData$ = collectionData(data) as Observable; 40 | const sortItems = (items: Item[]) => { 41 | return items[0].id 42 | ? items.sort(this.sortById) 43 | : items.sort(this.sortByDate); 44 | }; 45 | return unsortedData$.pipe(map(sortItems), shareReplay(1)); 46 | } 47 | 48 | sortById(a: Item, b: Item) { 49 | return a.id && b.id ? (a.id < b.id ? -1 : 1) : 1; 50 | } 51 | 52 | sortByDate(a: Item, b: Item) { 53 | return a.published && b.published 54 | ? a.published.seconds > b.published.seconds 55 | ? -1 56 | : 1 57 | : 1; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/app/modules/contact/contact.component.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 |
9 |

Send a Message

10 |
11 |
16 | 17 | 18 | 23 | @if (formControlService.contactForm.get("name")?.hasError) { 24 | 25 | Your name must be 4-100 characters long 26 | 27 | } 28 | 29 | 30 | 31 | 32 | 37 | 38 | @if (formControlService.contactForm.get("email")?.hasError) { 39 | There is an error in your email format 42 | } 43 | 44 | 45 | 46 | 47 | 55 | @if (formControlService.contactForm.get("message")?.hasError) { 56 | 57 | Your message must be 4-400 characters long 58 | 59 | } 60 | 61 | 62 |
63 | 71 |
72 |
73 |
74 |
75 | -------------------------------------------------------------------------------- /src/app/modules/contact/contact.component.scss: -------------------------------------------------------------------------------- 1 | .section { 2 | margin-top: 30px; 3 | 4 | .container { 5 | display: flex; 6 | flex-direction: column; 7 | max-width: 700px; 8 | margin-top: 30px; 9 | margin: auto; 10 | border: 3px solid #455a64; 11 | padding: 16px; 12 | 13 | .contact-heading { 14 | margin: auto; 15 | color: #455a64; 16 | } 17 | 18 | .contact-form { 19 | margin-top: 16px; 20 | display: flex; 21 | flex-direction: column; 22 | gap: 16px; 23 | overflow: hidden; 24 | } 25 | 26 | .send-button { 27 | margin: auto; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/app/modules/contact/contact.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Contact component class for Angular application. 3 | * 4 | * Handles contact form submission and communication with contact email service. 5 | * Sets page title and meta tags. 6 | * Displays success/error snackbar messages on form submission. 7 | */ 8 | import { 9 | Component, 10 | OnInit, 11 | inject, 12 | ChangeDetectionStrategy, 13 | } from "@angular/core"; 14 | import { FormGroupDirective } from "@angular/forms"; 15 | import { Meta, Title } from "@angular/platform-browser"; 16 | import { FormsModule, ReactiveFormsModule } from "@angular/forms"; 17 | import { 18 | MatSnackBar, 19 | MAT_SNACK_BAR_DEFAULT_OPTIONS, 20 | } from "@angular/material/snack-bar"; 21 | 22 | import { ContactModel } from "./models/contact.model"; 23 | import { EmailContactService } from "./services/email-contact.service"; 24 | import { MatButtonModule } from "@angular/material/button"; 25 | import { TextFieldModule } from "@angular/cdk/text-field"; 26 | import { MatInputModule } from "@angular/material/input"; 27 | import { MatFormFieldModule } from "@angular/material/form-field"; 28 | import { tap } from "rxjs/operators"; 29 | import { of, catchError } from "rxjs"; 30 | 31 | import { FormControlService } from "./services/form-control.service"; 32 | 33 | @Component({ 34 | selector: "app-contact", 35 | changeDetection: ChangeDetectionStrategy.OnPush, 36 | templateUrl: "./contact.component.html", 37 | styleUrls: ["./contact.component.scss"], 38 | standalone: true, 39 | imports: [ 40 | FormsModule, 41 | ReactiveFormsModule, 42 | MatFormFieldModule, 43 | MatInputModule, 44 | TextFieldModule, 45 | MatButtonModule, 46 | ], 47 | providers: [ 48 | MatSnackBar, 49 | FormControlService, 50 | { 51 | provide: MAT_SNACK_BAR_DEFAULT_OPTIONS, 52 | useValue: { 53 | duration: 3000, 54 | verticalPosition: "center", 55 | horizontalPosition: "center", 56 | panelClass: ["snackbar-common"], 57 | }, 58 | }, 59 | ], 60 | }) 61 | export class ContactComponent implements OnInit { 62 | formControlService = inject(FormControlService); 63 | 64 | title = "Contact Page"; 65 | 66 | constructor( 67 | private readonly emailService: EmailContactService, 68 | private readonly matSnackBar: MatSnackBar, 69 | private readonly titleService: Title, 70 | private readonly metaTagService: Meta 71 | ) { 72 | this.formControlService.initContactForm(); 73 | } 74 | 75 | ngOnInit(): void { 76 | this.titleService.setTitle(this.title); 77 | this.metaTagService.updateTag({ 78 | name: "contact", 79 | content: "angular-blog-14cef.web.app", 80 | }); 81 | } 82 | 83 | submitHandler(formDirective: FormGroupDirective): void { 84 | const formValue: ContactModel = this.formControlService.contactForm.value; 85 | 86 | try { 87 | this.emailService 88 | .sendEmail(formValue) 89 | .pipe( 90 | tap(() => { 91 | this.matSnackBar.open(this.formControlService.success, "OK", { 92 | panelClass: ["green-snackbar"], 93 | }); 94 | formDirective.resetForm(); 95 | this.formControlService.resetForm(); 96 | }), 97 | catchError(() => { 98 | this.matSnackBar.open(this.formControlService.failure, "Error", { 99 | panelClass: ["red-snackbar"], 100 | }); 101 | return of(null); 102 | }) 103 | ) 104 | .subscribe(); 105 | } catch (error) { 106 | this.matSnackBar.open(this.formControlService.failure, "Error" + error, { 107 | panelClass: ["red-snackbar"], 108 | }); 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/app/modules/contact/contact.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from "@angular/router"; 2 | import { ContactComponent } from "./contact.component"; 3 | 4 | export const CONTACT_ROUTES: Route[] = [ 5 | { 6 | path: "", 7 | component: ContactComponent, 8 | }, 9 | ]; 10 | -------------------------------------------------------------------------------- /src/app/modules/contact/models/contact.model.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * ContactModel defines the shape of the contact form data model. 3 | * It contains the user's name, email and message fields. 4 | */ 5 | export interface ContactModel { 6 | name: string; 7 | email: string; 8 | message: string; 9 | } 10 | -------------------------------------------------------------------------------- /src/app/modules/contact/services/email-contact.service.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * EmailContactService handles contacting the API for sending emails. 3 | * 4 | * It injects HttpClient and sets up the URL and headers for the Formspree API. 5 | * 6 | * The main methods are: 7 | * 8 | * sendEmail - Sends the email by calling makeRequest 9 | * makeRequest - Makes the HTTP request to the Formspree API 10 | */ 11 | import { ContactModel } from "./../models/contact.model"; 12 | import { Injectable, inject } from "@angular/core"; 13 | import { catchError } from "rxjs/operators"; 14 | import { throwError } from "rxjs"; 15 | import { HttpClient, HttpHeaders } from "@angular/common/http"; 16 | import { environment } from "../../../../environments/environment"; 17 | 18 | @Injectable({ 19 | providedIn: "root", 20 | }) 21 | export class EmailContactService { 22 | http = inject(HttpClient); 23 | 24 | formspreeUrl = environment.formspree.FORMSPREE_URL; 25 | 26 | jsonHeader = new HttpHeaders({ "Content-Type": "application/json" }); 27 | 28 | sendEmail(form: Partial) { 29 | return this.makeRequest(form); 30 | } 31 | 32 | makeRequest(form: Partial) { 33 | return this.http 34 | .post( 35 | this.formspreeUrl, 36 | { name: form.name, replyto: form.email, message: form.message }, 37 | { headers: this.jsonHeader } 38 | ) 39 | .pipe( 40 | catchError(err => { 41 | // Handle error 42 | return throwError(() => err); 43 | }) 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/app/modules/contact/services/form-control.service.ts: -------------------------------------------------------------------------------- 1 | import { inject } from "@angular/core"; 2 | import { FormBuilder, FormGroup, Validators } from "@angular/forms"; 3 | 4 | // @Injectable({ 5 | // providedIn: "root", 6 | // }) 7 | 8 | const SUCCESS_MESSAGE = "Message sent"; 9 | const FAILURE_MESSAGE = "Message not sent"; 10 | 11 | export class FormControlService { 12 | private formBuilder = inject(FormBuilder); 13 | contactForm: FormGroup; 14 | 15 | // Form state 16 | success = SUCCESS_MESSAGE; 17 | failure = FAILURE_MESSAGE; 18 | loading = false; 19 | 20 | initContactForm() { 21 | this.loading = true; 22 | this.contactForm = this.formBuilder.nonNullable.group({ 23 | name: [ 24 | "", 25 | [ 26 | Validators.required, 27 | Validators.minLength(4), 28 | Validators.maxLength(100), 29 | ], 30 | ], 31 | email: ["", [Validators.required, Validators.email]], 32 | message: [ 33 | "", 34 | [ 35 | Validators.required, 36 | Validators.minLength(4), 37 | Validators.maxLength(400), 38 | ], 39 | ], 40 | }); 41 | } 42 | 43 | resetForm() { 44 | this.loading = false; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/app/modules/home/area.model.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Area model class. 3 | * Defines the data model for an area section on the page. 4 | * Contains id, title, subtitle, svgPath and content fields. 5 | */ 6 | export class Area { 7 | id: number; 8 | title: string; 9 | subtitle: string; 10 | svgPath: string; 11 | content: string; 12 | } 13 | -------------------------------------------------------------------------------- /src/app/modules/home/home.component.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 |
9 |
10 | @for (area of areas$ | async; track trackAreaById) { 11 |
12 | 13 | 14 | icon of {{ area.title }} 19 | {{ area.title }} 20 | {{ area.subtitle }} 21 | 22 | 23 | {{ area.content }} 24 | 25 | 26 |
27 | } @empty { 28 |
Loading...
29 | } 30 |
31 |
32 | -------------------------------------------------------------------------------- /src/app/modules/home/home.component.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | padding: 4px; 3 | 4 | .home-card { 5 | margin-bottom: 4px; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/app/modules/home/home.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * HomeComponent handles the main home page functionality. 3 | * 4 | * It imports Angular dependencies for the component, metadata, observables, etc. 5 | * 6 | * The component loads areas data from Firestore and sets the page title and meta tags. 7 | * 8 | * It has methods to set the page metadata and track areas by ID. 9 | */ 10 | import { FirestoreDataService } from "./../../core/services/firestore-data.service"; 11 | import { 12 | Component, 13 | type OnInit, 14 | ChangeDetectionStrategy, 15 | inject, 16 | } from "@angular/core"; 17 | import { Meta, Title } from "@angular/platform-browser"; 18 | import { Observable } from "rxjs"; 19 | 20 | import { type Area } from "./area.model"; 21 | import { MatCardModule } from "@angular/material/card"; 22 | import { AsyncPipe } from "@angular/common"; 23 | 24 | @Component({ 25 | selector: "app-home", 26 | changeDetection: ChangeDetectionStrategy.OnPush, 27 | templateUrl: "./home.component.html", 28 | styleUrls: ["./home.component.scss"], 29 | standalone: true, 30 | imports: [MatCardModule, AsyncPipe], 31 | }) 32 | export class HomeComponent implements OnInit { 33 | firestoreDataService = inject(FirestoreDataService); 34 | titleService = inject(Title); 35 | metaTagService = inject(Meta); 36 | 37 | title = "Home"; 38 | areas$: Observable; 39 | 40 | ngOnInit(): void { 41 | const areasCollection = "areas"; 42 | this.areas$ = this.firestoreDataService.getData(areasCollection); 43 | 44 | this.setPageMetadata(); 45 | } 46 | 47 | setPageMetadata() { 48 | this.titleService.setTitle(this.title); 49 | this.metaTagService.updateTag({ 50 | name: "home", 51 | content: "andrewbateman.org", 52 | }); 53 | } 54 | 55 | trackAreaById(index: number, area: Area): number { 56 | return area?.id; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/app/modules/page-not-found/page-not-found.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 404: page not found 5 | 6 | 7 | Go Home 14 | 15 | 16 | 17 |
18 | -------------------------------------------------------------------------------- /src/app/modules/page-not-found/page-not-found.component.scss: -------------------------------------------------------------------------------- 1 | .main-div { 2 | height: 90vh; 3 | display: flex; 4 | justify-content: center; 5 | align-items: center; 6 | 7 | .notFound-card { 8 | text-align: center; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/app/modules/page-not-found/page-not-found.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * PageNotFoundComponent displays a simple page when a route is not found. 3 | * 4 | * It imports Angular Material components for styling the card and button. 5 | * 6 | * The component is standalone and uses OnPush change detection. 7 | * 8 | * The template displays a card with a message and a button to navigate back. 9 | */ 10 | import { Component, ChangeDetectionStrategy } from "@angular/core"; 11 | import { RouterLink } from "@angular/router"; 12 | import { MatButtonModule } from "@angular/material/button"; 13 | import { MatCardModule } from "@angular/material/card"; 14 | 15 | @Component({ 16 | selector: "app-page-not-found", 17 | changeDetection: ChangeDetectionStrategy.OnPush, 18 | templateUrl: "./page-not-found.component.html", 19 | styleUrls: ["./page-not-found.component.scss"], 20 | standalone: true, 21 | imports: [MatCardModule, MatButtonModule, RouterLink], 22 | }) 23 | export class PageNotFoundComponent {} 24 | -------------------------------------------------------------------------------- /src/app/modules/page-not-found/page-not-found.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from "@angular/router"; 2 | import { PageNotFoundComponent } from "./page-not-found.component"; 3 | 4 | export const NOTFOUND_ROUTES: Route[] = [ 5 | { 6 | path: "", 7 | component: PageNotFoundComponent, 8 | }, 9 | ]; 10 | -------------------------------------------------------------------------------- /src/app/modules/posts/models/unsplash.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-explicit-any */ 2 | export interface IUnsplashResponse { 3 | id: string; 4 | created_at: string; 5 | updated_at: string; 6 | promoted_at: string; 7 | width: number; 8 | height: number; 9 | color: string; 10 | blur_hash: string; 11 | description: string; 12 | alt_description: string; 13 | urls: { 14 | raw: string; 15 | full: string; 16 | regular: string; 17 | small: string; 18 | thumb: string; 19 | }; 20 | links: { 21 | self: string; 22 | html: string; 23 | download: string; 24 | download_location: string; 25 | }; 26 | categories: any[]; 27 | likes: number; 28 | liked_by_user: boolean; 29 | current_user_collections: Array<{ 30 | id: number; 31 | title: string; 32 | published_at: string; 33 | last_collected_at: string; 34 | updated_at: string; 35 | cover_photo: any; 36 | user: any; 37 | }>; 38 | sponsorship: any; 39 | user: { 40 | id: string; 41 | updated_at: string; 42 | username: string; 43 | name: string; 44 | first_name: string; 45 | last_name: string; 46 | twitter_username: string | null; 47 | portfolio_url: string; 48 | bio: string; 49 | location: string; 50 | links: { 51 | self: string; 52 | html: string; 53 | photos: string; 54 | likes: string; 55 | portfolio: string; 56 | following: string; 57 | followers: string; 58 | }; 59 | profile_image: { 60 | small: string; 61 | medium: string; 62 | large: string; 63 | }; 64 | instagram_username: string; 65 | total_collections: number; 66 | total_likes: number; 67 | total_photos: number; 68 | accepted_tos: boolean; 69 | }; 70 | exif: { 71 | make: string; 72 | model: string; 73 | exposure_time: string; 74 | aperture: string; 75 | focal_length: string; 76 | iso: number; 77 | }; 78 | location: { 79 | title: string; 80 | name: string; 81 | city: string | null; 82 | country: string; 83 | position: { 84 | latitude: number; 85 | longitude: number; 86 | }; 87 | }; 88 | views: number; 89 | downloads: number; 90 | } 91 | -------------------------------------------------------------------------------- /src/app/modules/posts/post-list/post-detail/post-detail.component.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 |
8 | 9 | @if (imageData$ | async; as imageData) { 10 | 16 | 17 |

18 | Unsplash 21 | image: 22 | @if (imageData.description) { 23 | "{{ imageData.description }}" 24 | } 25 | by {{ imageData.user.name }} 26 |

27 | } 28 | 29 | @if (postDetails) { 30 | 31 |

{{ postDetails!.title }}

32 |

33 | {{ postDetails!.subtitle }}: 34 | {{ postDetails!.content }} 35 |

36 |
37 | } 38 | 45 |
46 |
47 | -------------------------------------------------------------------------------- /src/app/modules/posts/post-list/post-detail/post-detail.component.scss: -------------------------------------------------------------------------------- 1 | .post-detail-container { 2 | margin: 16px auto auto; 3 | max-width: 700px; 4 | 5 | // Card styling 6 | .post-card { 7 | max-width: 700px; 8 | 9 | .card-image { 10 | position: relative; 11 | width: 100% !important; 12 | margin: 0 auto; 13 | } 14 | 15 | .image-text { 16 | margin: 0 16px; 17 | white-space: pre-wrap; 18 | font-style: italic; 19 | } 20 | 21 | .card-title { 22 | margin: 16px 0 4px; 23 | font-size: 18px; 24 | text-decoration: underline; 25 | text-decoration-color: #68a1e2; 26 | text-decoration-thickness: 2px; 27 | } 28 | 29 | .card-subtitle { 30 | font-size: 14px; 31 | font-weight: 700; 32 | } 33 | 34 | .card-content { 35 | white-space: pre-wrap; 36 | margin: 0 0 8px; 37 | } 38 | .post-footer { 39 | padding: 0 16px; 40 | 41 | .small-text { 42 | font-size: 14px !important; 43 | 44 | button { 45 | background-color: #455a64; 46 | } 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/app/modules/posts/post-list/post-detail/post-detail.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | ChangeDetectionStrategy, 4 | OnInit, 5 | inject, 6 | CUSTOM_ELEMENTS_SCHEMA, 7 | } from "@angular/core"; 8 | import { Router, ActivatedRoute } from "@angular/router"; 9 | import { Location, AsyncPipe } from "@angular/common"; 10 | 11 | import { Post } from "../../post.model"; 12 | import { Observable, catchError, throwError } from "rxjs"; 13 | import { IUnsplashResponse } from "../../models/unsplash"; 14 | import { ImageService } from "../../post-services/image.service"; 15 | import { MatCardModule } from "@angular/material/card"; 16 | import { NgxPictureModule } from "ngx-picture"; 17 | 18 | @Component({ 19 | selector: "app-post-detail", 20 | changeDetection: ChangeDetectionStrategy.OnPush, 21 | templateUrl: "./post-detail.component.html", 22 | styleUrls: ["./post-detail.component.scss"], 23 | standalone: true, 24 | imports: [MatCardModule, AsyncPipe, NgxPictureModule], 25 | schemas: [CUSTOM_ELEMENTS_SCHEMA], 26 | }) 27 | export class PostDetailComponent implements OnInit { 28 | activatedRoute = inject(ActivatedRoute); 29 | router = inject(Router); 30 | location = inject(Location); 31 | imageService = inject(ImageService); 32 | postDetails: Post | undefined | null; 33 | imageData$ = new Observable(); 34 | 35 | constructor() { 36 | this.activatedRoute.queryParams.subscribe(() => { 37 | const state = this.getRouteData(); 38 | this.postDetails = state !== null ? state?.post : null; 39 | }); 40 | } 41 | 42 | ngOnInit(): void { 43 | this.getPhoto(this.postDetails!.image); 44 | } 45 | 46 | getRouteData() { 47 | return this.router?.getCurrentNavigation()?.extras?.state; 48 | } 49 | 50 | onNavigateBackToPosts(): void { 51 | this.location.back(); 52 | } 53 | 54 | getPhoto(subject: string): void { 55 | this.imageData$ = this.imageService.getRandomImage(subject).pipe( 56 | catchError(error => { 57 | // handle error 58 | return throwError(() => new Error(error)); 59 | }) 60 | ); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/app/modules/posts/post-list/post-list.component.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 14 | @for (tab of tabs; track tabIndex) { 15 | 16 |
19 | @for (post of posts$ | async; track trackPostById) { 20 | 21 | @if (post.category === tab) { 22 | 23 | 27 | 28 |

{{ post.title }}

29 |

30 | {{ post.subtitle }}: 31 | {{ 32 | post.content | slice: 0 : 158 - post.subtitle.length 33 | }}... 34 |

35 |
36 | 37 | 38 | 39 | {{ post.published.seconds * 1000 | dateConvert }} 40 | 41 | {{ post.content | readTime }} minutes 42 | 43 | 44 |
45 |
46 | } 47 |
48 | } @empty { 49 |
Loading...
50 | } 51 |
52 |
53 | } @empty { 54 |
Loading...
55 | } 56 |
57 | -------------------------------------------------------------------------------- /src/app/modules/posts/post-list/post-list.component.scss: -------------------------------------------------------------------------------- 1 | .responsive-grid { 2 | display: grid; 3 | grid-template-columns: repeat(var(--columns), 1fr); 4 | gap: 4px; 5 | 6 | .posts-footer { 7 | padding: 0 16px; 8 | 9 | .card-footer-rhs { 10 | margin-left: 16px !important; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/app/modules/posts/post-list/post-list.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | type OnInit, 4 | ChangeDetectionStrategy, 5 | inject, 6 | type AfterViewInit, 7 | } from "@angular/core"; 8 | import { Meta, Title } from "@angular/platform-browser"; 9 | import { Router, type NavigationExtras } from "@angular/router"; 10 | 11 | import { type Post } from "../post.model"; 12 | import { type Observable } from "rxjs"; 13 | import { BreakpointService } from "../../../core/services/breakpoint.service"; 14 | import { FirestoreDataService } from "../../../core/services/firestore-data.service"; 15 | import { type MatTabChangeEvent, MatTabsModule } from "@angular/material/tabs"; 16 | import { ReadTimePipe } from "../../../shared/pipes/read-time.pipe"; 17 | import { DateConvertPipe } from "../../../shared/pipes/date-convert.pipe"; 18 | import { SvgTimerComponent } from "../../../shared/components/svg-timer/svg-timer.component"; 19 | import { SvgCalenderComponent } from "../../../shared/components/svg-calender/svg-calender.component"; 20 | import { MatCardModule } from "@angular/material/card"; 21 | import { AsyncPipe, SlicePipe } from "@angular/common"; 22 | 23 | @Component({ 24 | selector: "app-post-list", 25 | changeDetection: ChangeDetectionStrategy.OnPush, 26 | templateUrl: "./post-list.component.html", 27 | styleUrls: ["./post-list.component.scss"], 28 | standalone: true, 29 | imports: [ 30 | MatTabsModule, 31 | MatCardModule, 32 | SvgCalenderComponent, 33 | SvgTimerComponent, 34 | DateConvertPipe, 35 | ReadTimePipe, 36 | AsyncPipe, 37 | SlicePipe, 38 | ], 39 | }) 40 | export class PostListComponent implements OnInit, AfterViewInit { 41 | firestoreDataService = inject(FirestoreDataService); 42 | titleService = inject(Title); 43 | metaTagService = inject(Meta); 44 | breakpointService = inject(BreakpointService); 45 | router = inject(Router); 46 | 47 | title = "Technical Posts"; 48 | tabs = ["Dev", "IT", "Eng", "Env"]; 49 | tabIndex = 0; 50 | posts$: Observable; 51 | BreakpointColumnNr$ = this.breakpointService.breakpointColumnNr$; 52 | 53 | ngOnInit(): void { 54 | window.scrollTo(0, 0); 55 | this.titleService.setTitle(this.title); 56 | this.metaTagService.updateTag({ 57 | name: "posts", 58 | content: "andrewbateman.org", 59 | }); 60 | this.posts$ = this.firestoreDataService.getData("posts"); 61 | } 62 | 63 | // When user returns to tab grid from viewing a post in PostDetailComponent 64 | // the previous tab label string will be retrieved from local storage 65 | // Tab label converted to numeric tab key from tabs array 66 | ngAfterViewInit(): void { 67 | const tabLabel = localStorage.getItem("tab") || ""; 68 | if (tabLabel) { 69 | this.tabIndex = this.getKeyFromValue(tabLabel); 70 | } 71 | } 72 | 73 | getKeyFromValue = (value: string): number => { 74 | const arrayKey = Object.keys(this.tabs).find( 75 | key => this.tabs[+key] === value 76 | ); 77 | return arrayKey ? +arrayKey : 0; 78 | }; 79 | 80 | trackPostById(index: number, post: Post): number { 81 | return post?.id; 82 | } 83 | 84 | // store current tab in local storage 85 | tabSelected(tabChangeEvent: MatTabChangeEvent): void { 86 | const currentTabLabel = tabChangeEvent.tab.textLabel; 87 | localStorage.setItem("tab", currentTabLabel); 88 | } 89 | 90 | onGoToPostDetail(post: Post): void { 91 | const navigationExtras: NavigationExtras = { 92 | state: { 93 | post, 94 | }, 95 | }; 96 | this.router.navigate(["posts/detail"], navigationExtras); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/app/modules/posts/post-services/image.service.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * ImageService handles fetching random images from Unsplash API. 3 | * 4 | * getRandomImage() takes a search query and returns an observable 5 | * with the API response containing a random image matching the query. 6 | * 7 | * It constructs the API request with the provided API key and parameters, 8 | * and returns the HTTP GET request observable. 9 | */ 10 | import { Injectable, inject } from "@angular/core"; 11 | import { HttpClient, HttpHeaders } from "@angular/common/http"; 12 | import { environment } from "../../../../environments/environment"; 13 | import { Observable } from "rxjs"; 14 | import { IUnsplashResponse } from "../models/unsplash"; 15 | 16 | @Injectable({ 17 | providedIn: "root", 18 | }) 19 | export class ImageService { 20 | http = inject(HttpClient); 21 | 22 | getRandomImage(subject: string): Observable { 23 | const url = `${environment.unsplash.API_URL}/photos/random`; 24 | const params = { 25 | query: subject, 26 | orientation: "landscape", 27 | }; 28 | 29 | const headers = new HttpHeaders({ 30 | Authorization: `Client-ID ${environment.unsplash.UNSPLASH_API_KEY}`, 31 | "Content-Type": "application/json", 32 | }); 33 | 34 | return this.http.get(url, { params, headers }); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/app/modules/posts/post.model.ts: -------------------------------------------------------------------------------- 1 | export class Post { 2 | id = 0; 3 | category: "IT" | "Dev" | "Eng" | "Env"; 4 | title = ""; 5 | subtitle = ""; 6 | content = ""; 7 | image = ""; 8 | published: { 9 | nanoseconds: number; 10 | seconds: number; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /src/app/modules/posts/posts.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from "@angular/router"; 2 | import { PostDetailComponent } from "./post-list/post-detail/post-detail.component"; 3 | import { PostListComponent } from "./post-list/post-list.component"; 4 | 5 | export const POSTS_ROUTES: Route[] = [ 6 | { 7 | path: "", 8 | component: PostListComponent, 9 | }, 10 | { 11 | path: "detail", 12 | component: PostDetailComponent, 13 | }, 14 | ]; 15 | -------------------------------------------------------------------------------- /src/app/modules/projects/project.model.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Project model class. 3 | */ 4 | export class Project { 5 | area = ""; 6 | title = ""; 7 | id = ""; 8 | svgs: [string] = [""]; 9 | content = ""; 10 | github = ""; 11 | } 12 | -------------------------------------------------------------------------------- /src/app/modules/projects/projects.component.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | @for (area of areas; track tabTrackByFn) { 9 | 10 |
13 | @for (project of projects$ | async; track trackProjectById) { 14 | 15 | @if (project.area === area) { 16 | 17 | 20 | 21 | @for (svg of project.svgs; track svg) { 22 |

23 | icon of {{ svg }} 27 |

28 | } 29 | 30 |

31 | {{ project.title }}: 34 | {{ project.content | slice: 0 : 240 }}... 35 | View on Github 42 | 43 |

44 |
45 |
46 |
47 | } 48 |
49 | } @empty { 50 |
Loading...
51 | } 52 |
53 |
54 | } @empty { 55 |
Loading...
56 | } 57 |
58 | -------------------------------------------------------------------------------- /src/app/modules/projects/projects.component.scss: -------------------------------------------------------------------------------- 1 | .responsive-grid { 2 | display: grid; 3 | grid-template-columns: repeat(var(--columns), 1fr); 4 | gap: 4px; 5 | padding: 4px; 6 | } 7 | 8 | // project tab styling 9 | .project-tab { 10 | color: white !important; 11 | 12 | .project-tab active { 13 | background-color: blue !important; 14 | } 15 | } 16 | 17 | // card styling 18 | .project-card { 19 | height: 100%; 20 | display: flex; 21 | flex-direction: column; 22 | padding: 0; 23 | 24 | .project-card-icons { 25 | margin-top: 0; 26 | display: inline; 27 | list-style-type: none; 28 | padding-right: 4px; 29 | } 30 | 31 | .project-card-svg { 32 | width: 30px; 33 | height: 30px; 34 | margin-right: 4px; 35 | } 36 | 37 | .project-card-title { 38 | font-size: 18px; 39 | text-decoration: underline; 40 | text-decoration-color: #68a1e2; 41 | text-decoration-thickness: 2px; 42 | } 43 | 44 | .project-card-content { 45 | flex-grow: 1; 46 | overflow: auto; 47 | white-space: pre-wrap; 48 | } 49 | 50 | .project-card-link { 51 | color: #0468db; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/app/modules/projects/projects.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | OnInit, 4 | ChangeDetectionStrategy, 5 | ViewEncapsulation, 6 | inject, 7 | } from "@angular/core"; 8 | import { Observable } from "rxjs"; 9 | 10 | import { Meta, Title } from "@angular/platform-browser"; 11 | 12 | import { Project } from "./project.model"; 13 | import { BreakpointService } from "../../core/services/breakpoint.service"; 14 | import { FirestoreDataService } from "./../../core/services/firestore-data.service"; 15 | import { MatCardModule } from "@angular/material/card"; 16 | import { AsyncPipe, SlicePipe } from "@angular/common"; 17 | import { MatTabsModule } from "@angular/material/tabs"; 18 | 19 | @Component({ 20 | selector: "app-projects", 21 | changeDetection: ChangeDetectionStrategy.OnPush, 22 | encapsulation: ViewEncapsulation.None, 23 | templateUrl: "./projects.component.html", 24 | styleUrls: ["./projects.component.scss"], 25 | standalone: true, 26 | imports: [MatTabsModule, MatCardModule, AsyncPipe, SlicePipe], 27 | }) 28 | export class ProjectsComponent implements OnInit { 29 | breakpointService = inject(BreakpointService); 30 | firestoreDataService = inject(FirestoreDataService); 31 | titleService = inject(Title); 32 | metaTagService = inject(Meta); 33 | 34 | BreakpointColumnNr$ = this.breakpointService.breakpointColumnNr$; 35 | 36 | // @Input() darkModeSwitched: Boolean = false; 37 | 38 | title = "Projects"; 39 | areas = ["Javascript", "Full-Stack", "Node"]; 40 | projects$: Observable; 41 | project: Project | undefined; 42 | 43 | ngOnInit(): void { 44 | this.titleService.setTitle(this.title); 45 | this.metaTagService.updateTag({ 46 | name: "projects", 47 | content: "andrewbateman.org", 48 | }); 49 | this.projects$ = this.firestoreDataService.getData("projects"); 50 | } 51 | 52 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 53 | tabTrackByFn(index: number, item: any): number { 54 | return item?.tabId; 55 | } 56 | 57 | trackProjectById(index: number, project: Project): number { 58 | return +project?.id; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/app/modules/projects/projects.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from "@angular/router"; 2 | import { ProjectsComponent } from "./projects.component"; 3 | 4 | export const PROJECTS_ROUTES: Route[] = [ 5 | { 6 | path: "", 7 | component: ProjectsComponent, 8 | }, 9 | ]; 10 | -------------------------------------------------------------------------------- /src/app/modules/skills/skill.model.ts: -------------------------------------------------------------------------------- 1 | export class Skill { 2 | id = 0; 3 | area = ""; 4 | content = ""; 5 | } 6 | -------------------------------------------------------------------------------- /src/app/modules/skills/skills.component.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | @for (skill of skills$ | async; track trackSkillById) { 8 | 9 | 10 | 11 |

12 | {{ skill.area }} 13 |

14 |

{{ skill.content }}

15 |
16 |
17 |
18 | } @empty { 19 |
Loading...
20 | } 21 |
22 | -------------------------------------------------------------------------------- /src/app/modules/skills/skills.component.scss: -------------------------------------------------------------------------------- 1 | .responsive-grid { 2 | display: grid; 3 | grid-template-columns: repeat(var(--columns), 1fr); 4 | gap: 4px; 5 | padding: 4px; 6 | 7 | .skill-card { 8 | height: 100%; 9 | display: flex; 10 | flex-direction: column; 11 | 12 | .skill-area { 13 | overflow-wrap: normal; 14 | font-size: 18px; 15 | text-decoration: underline; 16 | text-decoration-color: #68a1e2; 17 | text-decoration-thickness: 2px; 18 | } 19 | 20 | .skill-content { 21 | min-height: 80px; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/app/modules/skills/skills.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | ChangeDetectionStrategy, 4 | inject, 5 | OnInit, 6 | } from "@angular/core"; 7 | import { Meta, Title } from "@angular/platform-browser"; 8 | import { type Observable } from "rxjs"; 9 | 10 | import { BreakpointService } from "../../core/services/breakpoint.service"; 11 | import { FirestoreDataService } from "./../../core/services/firestore-data.service"; 12 | import { type Skill } from "./skill.model"; 13 | import { MatCardModule } from "@angular/material/card"; 14 | import { NgFor, AsyncPipe } from "@angular/common"; 15 | 16 | @Component({ 17 | selector: "app-skills", 18 | changeDetection: ChangeDetectionStrategy.OnPush, 19 | templateUrl: "./skills.component.html", 20 | styleUrls: ["./skills.component.scss"], 21 | standalone: true, 22 | imports: [NgFor, MatCardModule, AsyncPipe], 23 | }) 24 | export class SkillsComponent implements OnInit { 25 | breakpointService = inject(BreakpointService); 26 | firestoreDataService = inject(FirestoreDataService); 27 | titleService = inject(Title); 28 | metaTagService = inject(Meta); 29 | 30 | BreakpointColumnNr$ = this.breakpointService.breakpointColumnNr$; 31 | 32 | title = "List of skills"; 33 | skills$: Observable; 34 | 35 | ngOnInit(): void { 36 | this.titleService.setTitle(this.title); 37 | this.metaTagService.updateTag({ 38 | name: "skills", 39 | content: "andrewbateman.org", 40 | }); 41 | this.skills$ = this.firestoreDataService.getData("skills"); 42 | } 43 | 44 | trackSkillById(index: number, skill: Skill): number { 45 | return skill?.id; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/app/modules/skills/skills.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from "@angular/router"; 2 | import { SkillsComponent } from "./skills.component"; 3 | 4 | export const SKILLS_ROUTES: Route[] = [ 5 | { 6 | path: "", 7 | component: SkillsComponent, 8 | }, 9 | ]; 10 | -------------------------------------------------------------------------------- /src/app/modules/web-tech/data-item.model.ts: -------------------------------------------------------------------------------- 1 | export class DataItem { 2 | readonly icon = ""; 3 | readonly id = 0; 4 | readonly link = ""; 5 | readonly name = ""; 6 | readonly package = ""; 7 | } 8 | -------------------------------------------------------------------------------- /src/app/modules/web-tech/package-convert.pipe.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * PackageConvertPipe is a Pipe that transforms a package name 3 | * into its version by looking it up in the packageMap. 4 | * 5 | * The packageMap is a Map that contains package names mapped to their 6 | * versions loaded dynamically using require(). 7 | * 8 | * The pipe is marked as standalone so it can be used outside of 9 | * Angular modules. 10 | */ 11 | /* eslint-disable @typescript-eslint/no-explicit-any */ 12 | import { Pipe, PipeTransform } from "@angular/core"; 13 | declare const require: (moduleName: string) => any; 14 | 15 | const packageMap = new Map([ 16 | ["@angular/core/package.json", require("@angular/core/package.json").version], 17 | [ 18 | "@angular/material/package.json", 19 | require("@angular/material/package.json").version, 20 | ], 21 | ["rxjs/package.json", require("rxjs/package.json").version], 22 | ["typescript/package.json", require("typescript/package.json").version], 23 | ["firebase/package.json", require("firebase/package.json").version], 24 | [ 25 | "@angular/service-worker/package.json", 26 | require("@angular/service-worker/package.json").version, 27 | ], 28 | ["express/package.json", require("express/package.json").version], 29 | ["eslint/package.json", require("eslint/package.json").version], 30 | ]); 31 | 32 | @Pipe({ 33 | name: "packageConvert", 34 | standalone: true, 35 | }) 36 | export class PackageConvertPipe implements PipeTransform { 37 | transform(value: string): string { 38 | return packageMap.get(value) || "latest"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/app/modules/web-tech/web-tech.component.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | @for (item of techDataItems$ | async; track trackByFn) { 8 | 9 | 10 | 11 |

12 | icon of {{ item.name }} 16 | {{ item.name }} 17 | v{{ item.package | packageConvert }} 24 |

25 |
26 |
27 |
28 | } @empty { 29 |
Loading...
30 | } 31 |
32 | -------------------------------------------------------------------------------- /src/app/modules/web-tech/web-tech.component.scss: -------------------------------------------------------------------------------- 1 | .responsive-grid { 2 | display: grid; 3 | grid-template-columns: repeat(var(--columns), 1fr); 4 | gap: 4px; 5 | padding: 8px; 6 | 7 | .container { 8 | padding: 8px; 9 | } 10 | 11 | .tech-card-content { 12 | margin: 0; 13 | 14 | .tech-icon { 15 | width: 30px; 16 | height: 30px; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/app/modules/web-tech/web-tech.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * WebTechComponent displays information about the technologies used to build the website. 3 | * 4 | * It imports RxJS Observables and components from Angular framework. 5 | * 6 | * The component class fetches data from a Firestore database service, transforms it with pipes, 7 | * and renders it with Angular template bindings. 8 | * 9 | * It implements OnInit to initialize on component load. 10 | * 11 | * The template uses Angular Material card components to display the data. 12 | */ 13 | import { Observable } from "rxjs"; 14 | import { DataItem } from "./data-item.model"; 15 | import { 16 | Component, 17 | type OnInit, 18 | ChangeDetectionStrategy, 19 | inject, 20 | } from "@angular/core"; 21 | import { Title } from "@angular/platform-browser"; 22 | import { BreakpointService } from "../../core/services/breakpoint.service"; 23 | import { FirestoreDataService } from "../../core/services/firestore-data.service"; 24 | import { PackageConvertPipe } from "./package-convert.pipe"; 25 | import { MatCardModule } from "@angular/material/card"; 26 | import { AsyncPipe } from "@angular/common"; 27 | 28 | @Component({ 29 | selector: "app-web-tech", 30 | changeDetection: ChangeDetectionStrategy.OnPush, 31 | templateUrl: "./web-tech.component.html", 32 | styleUrls: ["./web-tech.component.scss"], 33 | standalone: true, 34 | imports: [MatCardModule, AsyncPipe, PackageConvertPipe], 35 | }) 36 | export class WebTechComponent implements OnInit { 37 | breakpointService = inject(BreakpointService); 38 | 39 | techDataItems$: Observable; 40 | BreakpointColumnNr$ = this.breakpointService.breakpointColumnNr$; 41 | 42 | constructor( 43 | private readonly firestoreDataService: FirestoreDataService, 44 | private readonly title: Title 45 | ) { 46 | this.title.setTitle("Website Build Info"); 47 | } 48 | 49 | ngOnInit(): void { 50 | this.init(); 51 | } 52 | 53 | init() { 54 | this.title.setTitle("Website Build Info"); 55 | this.techDataItems$ = this.firestoreDataService.getData("tech"); 56 | } 57 | 58 | trackByFn(index: number, item: DataItem) { 59 | return item.id; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/app/modules/web-tech/web-tech.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from "@angular/router"; 2 | import { WebTechComponent } from "./web-tech.component"; 3 | 4 | export const WEBTECH_ROUTES: Route[] = [ 5 | { 6 | path: "", 7 | component: WebTechComponent, 8 | }, 9 | ]; 10 | -------------------------------------------------------------------------------- /src/app/shared/components/postgres/postgres.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-postgres", 5 | templateUrl: "../../../../../src/assets/svgs/postgresql.svg", 6 | styleUrls: ["../svg.component.scss"], 7 | }) 8 | export class PostgresComponent {} 9 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-angular/svg-angular.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-angular", 5 | templateUrl: "../../../../../src/assets/svgs/angular.svg", 6 | styleUrls: ["../svg.component.scss"], 7 | }) 8 | export class SvgAngularComponent {} 9 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-back-white/svg-back-white.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-back-white", 5 | templateUrl: "../../../../../src/assets/svgs/arrow_back.svg", 6 | styleUrls: ["../svg.component.scss"], 7 | }) 8 | export class SvgBackWhiteComponent {} 9 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-back-white/svg-back-white.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { SvgBackWhiteComponent } from "../svg-back-white/svg-back-white.component"; 3 | 4 | @NgModule({ 5 | declarations: [SvgBackWhiteComponent], 6 | exports: [SvgBackWhiteComponent], 7 | }) 8 | export class SvgBackWhiteModule {} 9 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-back/svg-back.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-back", 5 | templateUrl: "../../../../../src/assets/svgs/arrow_back.svg", 6 | styleUrls: ["../svg.component-accent.scss"], 7 | standalone: true, 8 | }) 9 | export class SvgBackComponent {} 10 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-calender/svg-calender.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-calender", 5 | templateUrl: "../../../../../src/assets/svgs/calender.svg", 6 | styleUrls: ["../svg.component-accent.scss"], 7 | standalone: true, 8 | }) 9 | export class SvgCalenderComponent {} 10 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-camera/svg-camera.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-camera", 5 | templateUrl: "../../../../../src/assets/svgs/camera.svg", 6 | styleUrls: ["../svg.component-accent.scss"], 7 | standalone: true, 8 | }) 9 | export class SvgCameraComponent {} 10 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-close/svg-close.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-close", 5 | templateUrl: "../../../../../src/assets/svgs/close.svg", 6 | styleUrls: ["../svg.component.scss"], 7 | standalone: true, 8 | }) 9 | export class SvgCloseComponent {} 10 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-code/svg-code.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-code", 5 | templateUrl: "../../../../../src/assets/svgs/code.svg", 6 | styleUrls: ["../svg.component.scss"], 7 | }) 8 | export class SvgCodeComponent {} 9 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-create/svg-create.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-create", 5 | templateUrl: "../../../../../src/assets/svgs/create.svg", 6 | styleUrls: ["../svg.component-accent.scss"], 7 | standalone: true, 8 | }) 9 | export class SvgCreateComponent {} 10 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-dark/svg-dark.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-dark", 5 | templateUrl: "../../../../../src/assets/svgs/dark.svg", 6 | styleUrls: ["../svg.component.scss"], 7 | standalone: true, 8 | }) 9 | export class SvgDarkComponent {} 10 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-download/svg-download.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-download", 5 | templateUrl: "../../../../../src/assets/svgs/download.svg", 6 | styleUrls: ["../svg.component.scss"], 7 | standalone: true, 8 | }) 9 | export class SvgDownloadComponent {} 10 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-folder/svg-folder.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-folder", 5 | templateUrl: "../../../../../src/assets/svgs/folder_open.svg", 6 | styleUrls: ["../svg.component-accent.scss"], 7 | standalone: true, 8 | }) 9 | export class SvgFolderComponent {} 10 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-github/svg-github.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-github", 5 | templateUrl: "../../../../../src/assets/svgs/github.svg", 6 | styleUrls: ["../svg.topmenu.scss"], 7 | standalone: false, 8 | }) 9 | export class SvgGithubComponent {} 10 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-github/svg-github.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { SvgGithubComponent } from "../svg-github/svg-github.component"; 3 | 4 | @NgModule({ declarations: [SvgGithubComponent], exports: [SvgGithubComponent] }) 5 | export class SvgGithubModule {} 6 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-linkedin/svg-linkedin.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-linkedin", 5 | templateUrl: "../../../../../src/assets/svgs/linkedin.svg", 6 | styleUrls: ["../svg.topmenu.scss"], 7 | standalone: false, 8 | }) 9 | export class SvgLinkedinComponent {} 10 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-linkedin/svg-linkedin.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { SvgLinkedinComponent } from "../svg-linkedin/svg-linkedin.component"; 3 | 4 | @NgModule({ 5 | declarations: [SvgLinkedinComponent], 6 | exports: [SvgLinkedinComponent], 7 | }) 8 | export class SvgLinkedinModule {} 9 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-menu/svg-menu.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-menu", 5 | templateUrl: "../../../../../src/assets/svgs/menu.svg", 6 | styleUrls: ["../svg.component.scss"], 7 | standalone: true, 8 | }) 9 | export class SvgMenuComponent {} 10 | -------------------------------------------------------------------------------- /src/app/shared/components/svg-timer/svg-timer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app-svg-timer", 5 | templateUrl: "../../../../../src/assets/svgs/timer.svg", 6 | styleUrls: ["../svg.component-accent.scss"], 7 | standalone: true, 8 | }) 9 | export class SvgTimerComponent {} 10 | -------------------------------------------------------------------------------- /src/app/shared/components/svg.component-accent.scss: -------------------------------------------------------------------------------- 1 | svg { 2 | height: 20px; 3 | width: 20px; 4 | fill: #68a1e2; 5 | background: inherit; 6 | background-color: inherit; 7 | padding: 0 4px 0 0; 8 | } 9 | 10 | img { 11 | width: inherit; 12 | height: inherit; 13 | } 14 | -------------------------------------------------------------------------------- /src/app/shared/components/svg.component.scss: -------------------------------------------------------------------------------- 1 | svg { 2 | width: 28px; 3 | height: 28px; 4 | fill: white; 5 | background: inherit; 6 | background-color: inherit; 7 | padding: 0 4px 0 0; 8 | } 9 | 10 | img { 11 | width: inherit; 12 | height: inherit; 13 | } 14 | -------------------------------------------------------------------------------- /src/app/shared/components/svg.topmenu.scss: -------------------------------------------------------------------------------- 1 | svg { 2 | width: 24px; 3 | height: 24px; 4 | fill: white; 5 | background: inherit; 6 | background-color: inherit; 7 | padding: 8px 4px 0 0; 8 | } 9 | 10 | img { 11 | width: inherit; 12 | height: inherit; 13 | } 14 | -------------------------------------------------------------------------------- /src/app/shared/pipes/date-convert.pipe.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * DateConvertPipe is a pipe that converts a timestamp to a relative time string (e.g. "5 minutes ago"). 3 | * It imports the dayjs library to handle the date manipulation. 4 | * The transform() method accepts a timestamp as a number or Date, converts it using dayjs().fromNow(), 5 | * and returns the relative time string. If no timestamp is passed in, it returns an empty string. 6 | */ 7 | import { Pipe, PipeTransform } from "@angular/core"; 8 | import dayjs from "dayjs"; 9 | import relativeTime from "dayjs/plugin/relativeTime"; 10 | 11 | dayjs.extend(relativeTime); 12 | 13 | @Pipe({ 14 | name: "dateConvert", 15 | standalone: true, 16 | }) 17 | export class DateConvertPipe implements PipeTransform { 18 | /** 19 | * Converts a timestamp to a relative time string (e.g. "5 minutes ago") 20 | */ 21 | transform(timestamp: number | Date): string { 22 | return timestamp ? dayjs(timestamp).fromNow() : ""; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/app/shared/pipes/read-time.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, type PipeTransform } from "@angular/core"; 2 | 3 | @Pipe({ 4 | name: "readTime", 5 | standalone: true, 6 | }) 7 | export class ReadTimePipe implements PipeTransform { 8 | transform(value: string): number { 9 | const wordsPerMinute = 200; 10 | const noOfWords = value.split(" ").length; 11 | const minutes = noOfWords / wordsPerMinute; 12 | return Math.ceil(minutes); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, type ModuleWithProviders } from "@angular/core"; 2 | import { CommonModule } from "@angular/common"; 3 | import { MatTabsModule } from "@angular/material/tabs"; 4 | import { RouterModule } from "@angular/router"; 5 | 6 | @NgModule({ 7 | exports: [CommonModule, MatTabsModule, RouterModule], 8 | declarations: [], 9 | }) 10 | export class SharedModule { 11 | static forRoot(): ModuleWithProviders { 12 | return { 13 | ngModule: SharedModule, 14 | providers: [], 15 | }; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/assets/icons/apple_touch_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/icons/apple_touch_icon.png -------------------------------------------------------------------------------- /src/assets/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/icons/icon-128x128.png -------------------------------------------------------------------------------- /src/assets/icons/icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/icons/icon-144x144.png -------------------------------------------------------------------------------- /src/assets/icons/icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/icons/icon-152x152.png -------------------------------------------------------------------------------- /src/assets/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/icons/icon-192x192.png -------------------------------------------------------------------------------- /src/assets/icons/icon-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/icons/icon-384x384.png -------------------------------------------------------------------------------- /src/assets/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/icons/icon-512x512.png -------------------------------------------------------------------------------- /src/assets/icons/icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/icons/icon-72x72.png -------------------------------------------------------------------------------- /src/assets/icons/icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/icons/icon-96x96.png -------------------------------------------------------------------------------- /src/assets/icons/tensorflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/icons/tensorflow.png -------------------------------------------------------------------------------- /src/assets/images/laptop-desk.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/images/laptop-desk.jpg -------------------------------------------------------------------------------- /src/assets/images/thanks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/assets/images/thanks.jpg -------------------------------------------------------------------------------- /src/assets/svgs/angular.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/assets/svgs/apollo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/approved-profile.svg: -------------------------------------------------------------------------------- 1 | approved-profile -------------------------------------------------------------------------------- /src/assets/svgs/arrow_back.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/base.svg: -------------------------------------------------------------------------------- 1 | 45 | 46 | -------------------------------------------------------------------------------- /src/assets/svgs/bitcoin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/blog.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/bootstrap.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/calender.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/camera.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/capacitor.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/assets/svgs/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/assets/svgs/code.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/covid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/create.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/cron.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 13 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/assets/svgs/css.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/assets/svgs/dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/database.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/assets/svgs/download.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/ejs.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/email.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/eng.svg: -------------------------------------------------------------------------------- 1 | 4 | 5 | Created by potrace 1.15, written by Peter Selinger 2001-2017 6 | 7 | 9 | 65 | 68 | 71 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/assets/svgs/eslint.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/assets/svgs/expressjs.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/assets/svgs/firebase.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/folder_open.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/france.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/full.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/assets/svgs/github.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/assets/svgs/github1.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/assets/svgs/google-cloud.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/assets/svgs/graphql.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/heroku.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/html.svg: -------------------------------------------------------------------------------- 1 | 2 | HTML5 Logo Badge 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/assets/svgs/iec.svg: -------------------------------------------------------------------------------- 1 | 48 | 49 | -------------------------------------------------------------------------------- /src/assets/svgs/ionic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/assets/svgs/js.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/svgs/koajs.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/linkedin.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 8 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/assets/svgs/material.svg: -------------------------------------------------------------------------------- 1 | material -------------------------------------------------------------------------------- /src/assets/svgs/materialui.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/meanstack.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | -------------------------------------------------------------------------------- /src/assets/svgs/menu.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/mongodb.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/mongoose.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/news.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/assets/svgs/next.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/assets/svgs/nodejs.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/pie_chart.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/assets/svgs/programming.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/pwa.svg: -------------------------------------------------------------------------------- 1 | pwa -------------------------------------------------------------------------------- /src/assets/svgs/python.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/ratp.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/assets/svgs/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/rss.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/assets/svgs/rxjs.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/sequelize.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/assets/svgs/stencil.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/svelte.svg: -------------------------------------------------------------------------------- 1 | file_type_svelte -------------------------------------------------------------------------------- /src/assets/svgs/tailwind.svg: -------------------------------------------------------------------------------- 1 | file_type_tailwind 2 | -------------------------------------------------------------------------------- /src/assets/svgs/tensor.svg: -------------------------------------------------------------------------------- 1 | 54 | 55 | -------------------------------------------------------------------------------- /src/assets/svgs/timer.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/typescript.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/unsplash.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/svgs/vue.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | firebase: { 4 | "access credentials here" 5 | }, 6 | unsplash: { 7 | API_URL: "https://api.unsplash.com", 8 | UNSPLASH_API_KEY: "access credentials here", 9 | }, 10 | formspree: { 11 | FORMSPREE_URL: "access credentials here" 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: false, 3 | firebase: { 4 | "access credentials here" 5 | }, 6 | unsplash: { 7 | API_URL: "https://api.unsplash.com", 8 | UNSPLASH_API_KEY: "Paccess credentials here", 9 | }, 10 | formspree: { 11 | FORMSPREE_URL: "access credentials here" 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewJBateman/angular-material-portfolio/145370497d6e12ed4d200195bcd193986cccb11a/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Andrew Bateman 6 | 7 | 8 | 9 | 10 | 12 | 16 | 19 | 20 | 21 | 22 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode, importProvidersFrom } from "@angular/core"; 2 | import { provideAnimations } from "@angular/platform-browser/animations"; 3 | import { environment } from "./environments/environment"; 4 | import { bootstrapApplication } from "@angular/platform-browser"; 5 | import { AppComponent } from "./app/app.component"; 6 | import { provideFirestore, getFirestore } from "@angular/fire/firestore"; 7 | import { provideFirebaseApp, initializeApp } from "@angular/fire/app"; 8 | import { MatToolbarModule } from "@angular/material/toolbar"; 9 | import { MatSlideToggleModule } from "@angular/material/slide-toggle"; 10 | import { MatSidenavModule } from "@angular/material/sidenav"; 11 | import { MatDividerModule } from "@angular/material/divider"; 12 | import { SharedModule } from "./app/shared/shared.module"; 13 | import { NavModule } from "./app/core/nav/nav.module"; 14 | import { 15 | withInterceptorsFromDi, 16 | provideHttpClient, 17 | } from "@angular/common/http"; 18 | import { NgxPictureModule, CLOUDINARY_CONFIG } from "ngx-picture"; 19 | 20 | if (environment.production) { 21 | enableProdMode(); 22 | } 23 | 24 | document.addEventListener("DOMContentLoaded", () => { 25 | bootstrapApplication(AppComponent, { 26 | providers: [ 27 | importProvidersFrom( 28 | NgxPictureModule.forRoot(CLOUDINARY_CONFIG), 29 | NavModule, 30 | SharedModule, 31 | MatDividerModule, 32 | MatSidenavModule, 33 | MatSlideToggleModule, 34 | MatToolbarModule 35 | ), 36 | provideFirebaseApp(() => initializeApp(environment.firebase)), 37 | provideFirestore(() => getFirestore()), 38 | provideHttpClient(withInterceptorsFromDi()), 39 | provideAnimations(), 40 | ], 41 | }).catch(err => { 42 | console.error(err); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /src/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-material-portfolio", 3 | "short_name": "angular-material-portfolio", 4 | "theme_color": "#1976d2", 5 | "background_color": "#fafafa", 6 | "display": "standalone", 7 | "scope": "./", 8 | "start_url": "./", 9 | "icons": [ 10 | { 11 | "src": "assets/icons/icon-72x72.png", 12 | "sizes": "72x72", 13 | "type": "image/png", 14 | "purpose": "maskable any" 15 | }, 16 | { 17 | "src": "assets/icons/icon-96x96.png", 18 | "sizes": "96x96", 19 | "type": "image/png", 20 | "purpose": "maskable any" 21 | }, 22 | { 23 | "src": "assets/icons/icon-128x128.png", 24 | "sizes": "128x128", 25 | "type": "image/png", 26 | "purpose": "maskable any" 27 | }, 28 | { 29 | "src": "assets/icons/icon-152x152.png", 30 | "sizes": "152x152", 31 | "type": "image/png", 32 | "purpose": "maskable any" 33 | }, 34 | { 35 | "src": "assets/icons/icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image/png", 38 | "purpose": "maskable any" 39 | }, 40 | { 41 | "src": "assets/icons/icon-384x384.png", 42 | "sizes": "384x384", 43 | "type": "image/png", 44 | "purpose": "maskable any" 45 | }, 46 | { 47 | "src": "assets/icons/icon-512x512.png", 48 | "sizes": "512x512", 49 | "type": "image/png", 50 | "purpose": "maskable any" 51 | } 52 | ] 53 | } 54 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | import "zone.js"; 2 | -------------------------------------------------------------------------------- /src/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | Sitemap: https://andrewbateman.org/sitemap.xml -------------------------------------------------------------------------------- /src/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | https://andrewbateman.org/ 6 | 7 | 8 | https://andrewbateman.org/projects 9 | 10 | 11 | https://andrewbateman.org/skills 12 | 13 | 14 | https://andrewbateman.org/contact 15 | 16 | 17 | https://andrewbateman.org/posts 18 | 19 | 20 | https://andrewbateman.org/web-tech 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/styles.scss: -------------------------------------------------------------------------------- 1 | @use "@angular/material" as mat; 2 | @include mat.all-component-typographies(); 3 | 4 | $angular-primary: mat.m2-define-palette(mat.$m2-blue-grey-palette, 700); 5 | $angular-accent: mat.m2-define-palette(mat.$m2-blue-palette, 900); 6 | $angular-warn: mat.m2-define-palette(mat.$m2-orange-palette, 800); 7 | 8 | $angular-light-theme: mat.m2-define-light-theme( 9 | ( 10 | color: ( 11 | primary: $angular-primary, 12 | accent: $angular-accent, 13 | warn: $angular-warn, 14 | ), 15 | ) 16 | ); 17 | 18 | $angular-dark-theme: mat.m2-define-dark-theme( 19 | ( 20 | color: ( 21 | primary: $angular-primary, 22 | accent: $angular-accent, 23 | warn: $angular-warn, 24 | ), 25 | ) 26 | ); 27 | 28 | .dark-theme { 29 | @include mat.all-component-colors($angular-dark-theme); 30 | } 31 | .light-theme { 32 | @include mat.all-component-colors($angular-light-theme); 33 | } 34 | 35 | html { 36 | overflow-y: overlay; 37 | } 38 | 39 | body { 40 | min-height: 100vh; 41 | position: relative; 42 | margin: 0; 43 | } 44 | 45 | // styling for general cards used in blog and web-info pages 46 | .general-card { 47 | .title-style { 48 | margin: 0 0 4px; 49 | font-size: 18px; 50 | text-decoration: underline; 51 | text-decoration-color: #68a1e2; 52 | text-decoration-thickness: 2px; 53 | } 54 | 55 | .subtitle-style { 56 | font-size: 14px; 57 | font-weight: 700; 58 | } 59 | 60 | .content-style { 61 | white-space: pre-wrap; 62 | margin: 0 0 8px; 63 | height: 90px; 64 | } 65 | 66 | .small-text { 67 | font-size: 14px !important; 68 | } 69 | } 70 | 71 | .general-link { 72 | color: white; 73 | padding: 0 16px; 74 | } 75 | 76 | .snackbar-common { 77 | position: absolute; 78 | right: 0.5rem; 79 | top: 4.5rem; 80 | 81 | .mat-mdc-snack-bar-action { 82 | color: white !important; 83 | } 84 | } 85 | 86 | @media only screen and (max-width: 480px) { 87 | .snackbar-common { 88 | width: 100%; 89 | min-width: 100%; 90 | } 91 | } 92 | 93 | .green-snackbar { 94 | background-color: green !important; 95 | color: white; 96 | 97 | .mat-mdc-snack-bar-action { 98 | color: white !important; 99 | } 100 | } 101 | 102 | .red-snackbar { 103 | background: #b71c1c; 104 | color: white; 105 | } 106 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import "zone.js/dist/zone-testing"; 4 | import { getTestBed } from "@angular/core/testing"; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from "@angular/platform-browser-dynamic/testing"; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { 15 | teardown: { destroyAfterEach: false }, 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "src/main.ts" 9 | ], 10 | "include": [ 11 | "src/**/*.d.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | /* eslint:disable */ 3 | { 4 | "compileOnSave": false, 5 | "compilerOptions": { 6 | "baseUrl": "./", 7 | "outDir": "./dist/out-tsc", 8 | "forceConsistentCasingInFileNames": true, 9 | "esModuleInterop": true, 10 | "strict": true, 11 | "noImplicitOverride": true, 12 | "noPropertyAccessFromIndexSignature": false, 13 | "strictPropertyInitialization": false, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "sourceMap": true, 17 | "skipLibCheck": true, 18 | "declaration": false, 19 | "experimentalDecorators": true, 20 | "moduleResolution": "node", 21 | "target": "ES2022", 22 | "typeRoots": ["node_modules/@types"], 23 | "module": "es2022", 24 | "lib": ["ES2022", "dom"], 25 | "useDefineForClassFields": false, 26 | "importHelpers": true 27 | }, 28 | "angularCompilerOptions": { 29 | "enableI18nLegacyMessageIdFormat": false, 30 | "strictInjectionParameters": true, 31 | "strictInputAccessModifiers": true, 32 | "strictTemplates": true 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* eslint:disable */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["src/test.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | --------------------------------------------------------------------------------