diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..4f9ac26 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,16 @@ +# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries + +# For the full list of supported browsers by the Angular framework, please see: +# https://angular.io/guide/browser-support + +# You can see what browsers were selected by your queries by running: +# npx browserslist + +last 1 Chrome version +last 1 Firefox version +last 2 Edge major versions +last 2 Safari major versions +last 2 iOS major versions +Firefox ESR diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..3d9a482 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# Editor configuration, see https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = tab +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.ts] +quote_type = single + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..53fdfcd --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# Compiled output +/dist +/tmp +/out-tsc +/bazel-out + +# Node +/node_modules +npm-debug.log +yarn-error.log + +# IDEs and editors +.idea/ +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# Visual Studio Code +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* + +# Miscellaneous +/.angular/cache +.sass-cache/ +/connect.lock +/coverage +/libpeerconnection.log +testem.log +/typings + +# System files +.DS_Store +Thumbs.db +/package-lock.json diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml new file mode 100644 index 0000000..a4a820d --- /dev/null +++ b/.gitlab/.gitlab-ci.yml @@ -0,0 +1,97 @@ +image: node:16 + +stages: + - build + - test + - publish + - deploy + +npm: + stage: build + artifacts: + paths: + - dist + expire_in: 1 week + cache: + - key: + files: + - package.json + paths: + - node_modules + - package-lock.json + policy: pull-push + - key: $CI_PIPELINE_ID + paths: + - dist + policy: push + script: + - npm i + - npm run build + rules: + - if: $CI_COMMIT_BRANCH + +audit: + stage: test + cache: + - key: + files: + - package.json + paths: + - node_modules + policy: pull + script: + - AUDIT=$(npm audit) + - echo "vulnerabilities_high $(echo $AUDIT | grep -oE '[0-9]+ high' | grep -oE '[0-9]+' || echo 0)" > metrics.txt + - echo "vulnerabilities_medium $(echo $AUDIT | grep -oE '[0-9]+ moderate' | grep -oE '[0-9]+' || echo 0)" >> metrics.txt + - echo "vulnerabilities_low $(echo $AUDIT | grep -oE '[0-9]+ low' | grep -oE '[0-9]+' || echo 0)" >> metrics.txt + - echo "$AUDIT" + artifacts: + reports: + metrics: metrics.txt + rules: + - if: $CI_COMMIT_BRANCH + +registry: + stage: publish + image: docker + cache: + - key: $CI_PIPELINE_ID + paths: + - dist + policy: pull + before_script: + - docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY + script: + - TAG=$([ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ] && echo "latest" || echo "$CI_COMMIT_BRANCH" | sed -E "s/[_/]/-/g") + - docker build --no-cache -t "$CI_REGISTRY_IMAGE:$TAG" . + - docker push "$CI_REGISTRY_IMAGE:$TAG" + rules: + - if: $CI_COMMIT_BRANCH + +tag: + stage: publish + image: + name: alpine/git + entrypoint: [ "" ] + cache: [ ] + before_script: + - git remote set-url origin http://gitlab-ci-token:$DEPLOY_TOKEN@gitlab.zakscode.com/$CI_PROJECT_PATH.git + script: + - VERSION=$(cat package.json | grep version | grep -Eo ':.+' | grep -Eo '[[:alnum:]\.\/\-]+') + - git tag -f $VERSION $CI_COMMIT_SHA + - git push -f origin $VERSION + rules: + - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + allow_failure: true + +production: + stage: deploy + image: node:16 + cache: [ ] + script: + - curl -X POST https://portainer.zakscode.com/api/webhooks/9fcc5dce-a884-4063-8666-34c0acf0aec5 + environment: + name: Production + url: https://legioxxx.zakscode.com + rules: + - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_DEPLOY_FREEZE == null' diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8b7d62a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM node:16 as build + +# Variables +ARG NODE_ENV=prod +ARG NODE_OPTIONS="--max_old_space_size=4096" +ENV NG_CLI_ANALYTICS=ci \ + NODE_ENV=${NODE_ENV} \ + NODE_OPTIONS=${NODE_OPTIONS} + +# Setup +RUN npm config set unsafe-perm true && \ + mkdir /app +WORKDIR /app +COPY . . + +# Install +RUN if [ ! -d "dist" ] && [ ! -d "node_modules" ]; then npm install; fi + +# Build +RUN BUILD_MODE=$([ "$NODE_ENV" = "prod" ] && echo "dynmaic-prod" || echo "dynamic") && \ + if [ ! -d "dist" ]; then npm run "build:$BUILD_MODE"; fi + +# Use Nginx to serve +FROM nginx:1.20-alpine +COPY --from=build /app/dist /usr/share/nginx/html +COPY docker/robots.txt /usr/share/nginx/html/robots.txt +COPY docker/nginx.conf /etc/nginx/nginx.conf +EXPOSE 80 diff --git a/README.md b/README.md index 563a8bd..e972cff 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,47 @@ -# 291st +# 291st JTF +Clan page for the 291st Joint Task Force -Clan page for the 291st +This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.2.2. -## Getting started +## Table of Contents +[[_TOC_]] -To make it easy for you to get started with GitLab, here's a list of recommended next steps. +## Prerequisites +- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) +- [NodeJS 16](https://nodejs.org/en/) +- _[Docker](https://docs.docker.com/install/) (Optional)_ -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! +## Setup +The project can either be run using NPM or Docker. NPM is recommended for development. +
+NPM -## Add your files +1. Install the dependencies: `npm install` +2. Start the Angular server: `npm run start` +
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: +
+Docker -``` -cd existing_repo -git remote add origin https://gitlab.zakscode.com/zakscode/291st.git -git branch -M develop -git push -uf origin develop +1. Build the docker image: `docker build -t legio-xxx: .` +2. Start the new image: `docker run -p 4200:80 legio-xxx:` + +
+ +The website should now be accessible on [http://localhost:4200](http://localhost:4200) + +## Cheatsheet +```bash +# Start Angular server +npm run start + +# Build production +npm run build:prod + +# Build docker image +docker build -t legio-xxx: + +# Run docker image +docker run -p 4200:80 legio-xxx: ``` -## Integrate with your tools - -- [ ] [Set up project integrations](https://gitlab.zakscode.com/zakscode/291st/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. diff --git a/angular.json b/angular.json new file mode 100644 index 0000000..2089dd8 --- /dev/null +++ b/angular.json @@ -0,0 +1,91 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "291st": { + "projectType": "application", + "schematics": { + "@schematics/angular:component": { + "style": "scss" + } + }, + "root": "", + "sourceRoot": "src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.app.json", + "inlineStyleLanguage": "scss", + "assets": [ + "src/assets" + ], + "styles": [ + "src/styles.scss" + ], + "scripts": [ ] + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "outputHashing": "all" + }, + "development": { + "buildOptimizer": false, + "optimization": false, + "vendorChunk": true, + "extractLicenses": false, + "sourceMap": true, + "namedChunks": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { + "browserTarget": "291st:build:production" + }, + "development": { + "browserTarget": "291st:build:development" + } + }, + "defaultConfiguration": "development" + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "291st:build" + } + } + } + } + }, + "cli": { + "analytics": false + } +} diff --git a/assets/291.png b/assets/291.png deleted file mode 100644 index 76b0d38..0000000 Binary files a/assets/291.png and /dev/null differ diff --git a/assets/background.jpg b/assets/background.jpg deleted file mode 100644 index f0d1acb..0000000 Binary files a/assets/background.jpg and /dev/null differ diff --git a/assets/minecraft.webp b/assets/minecraft.webp deleted file mode 100644 index 6d1b70e..0000000 Binary files a/assets/minecraft.webp and /dev/null differ diff --git a/docker/nginx.conf b/docker/nginx.conf new file mode 100644 index 0000000..94c2533 --- /dev/null +++ b/docker/nginx.conf @@ -0,0 +1,31 @@ +worker_processes auto; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + + gzip on; + gzip_proxied any; + gzip_types text/plain text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript application/json application/x-font-woff; + gzip_vary on; + gzip_disable "MSIE [1-6]\.(?!.*SV1)"; + + sendfile off; + keepalive_timeout 65; + + server { + listen 80; + index index.html; + root /usr/share/nginx/html; + autoindex off; + + location / { + try_files $uri$args $uri$args/ /index.html; + } + } +} diff --git a/docker/robots.txt b/docker/robots.txt new file mode 100644 index 0000000..f6e6d1d --- /dev/null +++ b/docker/robots.txt @@ -0,0 +1,2 @@ +User-Agent: * +Allow: / diff --git a/index.html b/index.html deleted file mode 100644 index 16325ca..0000000 --- a/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - - 291st Joint Task Force - - - - - - - - -
\ -
-
- 291st JTF -
-

291st Joint Task Force

-

"Putting the Damned to Rest"

-
-
-
-
-
-
- minecraft -
-
-

Minecraft

- Host: 291st.ca:25565 -
-
- -
-
-
-
- -
-
-
- - diff --git a/package.json b/package.json new file mode 100644 index 0000000..ec7c181 --- /dev/null +++ b/package.json @@ -0,0 +1,44 @@ +{ + "name": "291st", + "version": "0.0.0", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "npm run build:dev", + "build:dev": "ng build --configuration development", + "build:prod": "ng build --configuration production", + "watch": "ng build --watch --configuration development" + }, + "private": true, + "dependencies": { + "@angular/animations": "^14.2.0", + "@angular/cdk": "^14.2.2", + "@angular/common": "^14.2.0", + "@angular/compiler": "^14.2.0", + "@angular/core": "^14.2.0", + "@angular/forms": "^14.2.0", + "@angular/material": "^14.2.2", + "@angular/platform-browser": "^14.2.0", + "@angular/platform-browser-dynamic": "^14.2.0", + "@angular/router": "^14.2.0", + "bootstrap": "^5.2.1", + "jquery": "^3.6.1", + "rxjs": "~7.5.0", + "tslib": "^2.3.0", + "webstorage-decorators": "^4.2.0", + "zone.js": "~0.11.4" + }, + "devDependencies": { + "@angular-devkit/build-angular": "^14.2.2", + "@angular/cli": "~14.2.2", + "@angular/compiler-cli": "^14.2.0", + "@types/jasmine": "~4.0.0", + "jasmine-core": "~4.3.0", + "karma": "~6.4.0", + "karma-chrome-launcher": "~3.1.0", + "karma-coverage": "~2.2.0", + "karma-jasmine": "~5.1.0", + "karma-jasmine-html-reporter": "~2.0.0", + "typescript": "~4.7.2" + } +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts new file mode 100644 index 0000000..d508f10 --- /dev/null +++ b/src/app/app.module.ts @@ -0,0 +1,29 @@ +import {NgModule} from '@angular/core'; +import {BrowserModule} from '@angular/platform-browser'; +import {AppRouting} from './app.routing'; +import {FooterComponent} from './components/footer/footer.component'; +import {NavbarComponent} from './components/navbar/navbar.component'; +import {AppComponent} from './containers/app/app.component'; +import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; +import {MaterialModule} from './material.module'; +import {HomeComponent} from './views/home/home.component'; + +export const APP_COMPONENTS = [ + AppComponent, + HomeComponent, + FooterComponent, + NavbarComponent +] + +@NgModule({ + declarations: APP_COMPONENTS, + imports: [ + BrowserModule, + AppRouting, + BrowserAnimationsModule, + MaterialModule + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { } diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts new file mode 100644 index 0000000..ff4e4f0 --- /dev/null +++ b/src/app/app.routing.ts @@ -0,0 +1,13 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import {HomeComponent} from './views/home/home.component'; + +const routes: Routes = [ + {path: '', pathMatch: 'full', component: HomeComponent} +]; + +@NgModule({ + imports: [RouterModule.forRoot(routes)], + exports: [RouterModule] +}) +export class AppRouting { } diff --git a/src/app/components/footer/footer.component.html b/src/app/components/footer/footer.component.html new file mode 100644 index 0000000..d483af1 --- /dev/null +++ b/src/app/components/footer/footer.component.html @@ -0,0 +1,8 @@ +
+
+

+ Copyright © 291st JTF 2022 | All Rights Reserved
+ Created by Zak Timson +

+
+
diff --git a/src/app/components/footer/footer.component.scss b/src/app/components/footer/footer.component.scss new file mode 100644 index 0000000..18d2d6e --- /dev/null +++ b/src/app/components/footer/footer.component.scss @@ -0,0 +1,4 @@ +.copywright { + a, a:visited { color: #b10000; } + a:hover, a:visited:hover { color: #cc0000; } +} diff --git a/src/app/components/footer/footer.component.ts b/src/app/components/footer/footer.component.ts new file mode 100644 index 0000000..4c8456c --- /dev/null +++ b/src/app/components/footer/footer.component.ts @@ -0,0 +1,8 @@ +import {Component} from '@angular/core'; + +@Component({ + selector: 'app-footer', + templateUrl: './footer.component.html', + styleUrls: ['./footer.component.scss'] +}) +export class FooterComponent { } diff --git a/src/app/components/navbar/navbar.component.html b/src/app/components/navbar/navbar.component.html new file mode 100644 index 0000000..d42a1c6 --- /dev/null +++ b/src/app/components/navbar/navbar.component.html @@ -0,0 +1,16 @@ + + +
+ +
291st Joint Task Force
+
+
+
+
+
+ +
+
+ diff --git a/src/app/components/navbar/navbar.component.scss b/src/app/components/navbar/navbar.component.scss new file mode 100644 index 0000000..b270c63 --- /dev/null +++ b/src/app/components/navbar/navbar.component.scss @@ -0,0 +1,58 @@ +.navbar-spacing { + height: 64px; + width: 100%; +} + +::ng-deep mat-toolbar { + background: #000 !important; + border-bottom: #fff solid 1px; + height: 64px; + position: fixed; + top: 0; + z-index: 100; + + .mat-toolbar-row { + height: 100%; + } + + .navbar-brand { + color: #fff; + //font-weight: lighter; + + &:hover img { + filter: brightness(5%) sepia(75) saturate(100) hue-rotate(25deg); + } + } + + .navbar-button { + //color: rgba(255, 255, 255, 0.55); + font-weight: normal; + padding: 0 8px 0 8px; + + //&:hover { + // color: rgba(255, 255, 255, 0.75); + //} + } +} + +::ng-deep .mat-menu-content { + background: #000; + border: #fff solid 1px; + padding: 0 !important; + border-radius: 0.25rem; + + mat-divider { + border-color: white; + margin-top: 0.2rem; + padding-bottom: 0.1rem; + } + + button { + height: 36px; + line-height: 36px; + + &:hover { + background: rgba(255, 255, 255, 0.15) !important; + } + } +} diff --git a/src/app/components/navbar/navbar.component.ts b/src/app/components/navbar/navbar.component.ts new file mode 100644 index 0000000..3317648 --- /dev/null +++ b/src/app/components/navbar/navbar.component.ts @@ -0,0 +1,34 @@ +import {AfterViewInit, Component, EventEmitter, Input, OnDestroy, Output} from '@angular/core'; +import {ActivatedRoute} from '@angular/router'; +import {Subscription} from 'rxjs'; + +@Component({ + selector: 'app-navbar', + templateUrl: './navbar.component.html', + styleUrls: ['./navbar.component.scss'] +}) +export class NavbarComponent implements AfterViewInit, OnDestroy { + private sub!: Subscription; + + @Input() hamburger = true; + + @Output() hamburgerClick = new EventEmitter(); + + constructor(private route: ActivatedRoute) { } + + ngAfterViewInit() { + this.sub = this.route.fragment.subscribe(frag => { + if(frag) this.scroll(frag); + }); + } + + ngOnDestroy(): void { + if(this.sub) this.sub.unsubscribe(); + } + + scroll(id: string) { + const el = document.getElementById(id); + if(el) el.scrollIntoView({behavior: 'smooth'}); + else setTimeout(() => this.scroll(id), 500); + } +} diff --git a/src/app/containers/app/app.component.html b/src/app/containers/app/app.component.html new file mode 100644 index 0000000..78e026c --- /dev/null +++ b/src/app/containers/app/app.component.html @@ -0,0 +1,5 @@ + +
+ + +
diff --git a/src/app/containers/app/app.component.scss b/src/app/containers/app/app.component.scss new file mode 100644 index 0000000..2b27cf7 --- /dev/null +++ b/src/app/containers/app/app.component.scss @@ -0,0 +1,5 @@ +.app-container { + overflow-x: hidden; + overflow-y: auto; + scroll-behavior: smooth; +} diff --git a/src/app/containers/app/app.component.ts b/src/app/containers/app/app.component.ts new file mode 100644 index 0000000..1140d68 --- /dev/null +++ b/src/app/containers/app/app.component.ts @@ -0,0 +1,23 @@ +import {BreakpointObserver} from '@angular/cdk/layout'; +import { Component } from '@angular/core'; +import {ActivatedRoute, NavigationEnd, Router} from '@angular/router'; +import {filter} from 'rxjs'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'] +}) +export class AppComponent { + mobile = false; + open = false; + + constructor(private router: Router, route: ActivatedRoute, breakpointObserver: BreakpointObserver) { + router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(() => this.open = false); + breakpointObserver.observe(['(max-width: 750px)']).subscribe(result => { + this.mobile = result.matches; + this.open = !this.mobile; + }) + } + +} diff --git a/src/app/material.module.ts b/src/app/material.module.ts new file mode 100644 index 0000000..9190c7e --- /dev/null +++ b/src/app/material.module.ts @@ -0,0 +1,16 @@ +import {NgModule} from '@angular/core'; +import {MatButtonModule} from '@angular/material/button'; +import {MatIconModule} from '@angular/material/icon'; +import {MatToolbarModule} from '@angular/material/toolbar'; + +export const MATERIAL_MODULES = [ + MatButtonModule, + MatIconModule, + MatToolbarModule +]; + +@NgModule({ + imports: MATERIAL_MODULES, + exports: MATERIAL_MODULES, +}) +export class MaterialModule {} diff --git a/src/app/views/home/home.component.html b/src/app/views/home/home.component.html new file mode 100644 index 0000000..66d4467 --- /dev/null +++ b/src/app/views/home/home.component.html @@ -0,0 +1,9 @@ +
+
+ +
+
+
+
+
+
diff --git a/src/app/views/home/home.component.scss b/src/app/views/home/home.component.scss new file mode 100644 index 0000000..9663fbe --- /dev/null +++ b/src/app/views/home/home.component.scss @@ -0,0 +1,3 @@ +.background { + background: url("/assets/img/291st-background.png") no-repeat center center; +} diff --git a/src/app/views/home/home.component.ts b/src/app/views/home/home.component.ts new file mode 100644 index 0000000..f17a747 --- /dev/null +++ b/src/app/views/home/home.component.ts @@ -0,0 +1,10 @@ +import {Component} from '@angular/core'; + +@Component({ + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.scss'] +}) +export class HomeComponent { + +} diff --git a/src/assets/img/291st-background.png b/src/assets/img/291st-background.png new file mode 100644 index 0000000..b1961de Binary files /dev/null and b/src/assets/img/291st-background.png differ diff --git a/src/assets/img/logo.png b/src/assets/img/logo.png new file mode 100644 index 0000000..9557944 Binary files /dev/null and b/src/assets/img/logo.png differ diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts new file mode 100644 index 0000000..3612073 --- /dev/null +++ b/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/src/environments/environment.ts b/src/environments/environment.ts new file mode 100644 index 0000000..ffe8aed --- /dev/null +++ b/src/environments/environment.ts @@ -0,0 +1,3 @@ +export const environment = { + production: false +}; diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..e8969d8 --- /dev/null +++ b/src/index.html @@ -0,0 +1,23 @@ + + + + + + + + + + + 291st JTF + + + + + + + + + + + + diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..c7b673c --- /dev/null +++ b/src/main.ts @@ -0,0 +1,12 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule) + .catch(err => console.error(err)); diff --git a/src/polyfills.ts b/src/polyfills.ts new file mode 100644 index 0000000..429bb9e --- /dev/null +++ b/src/polyfills.ts @@ -0,0 +1,53 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes recent versions of Safari, Chrome (including + * Opera), Edge on the desktop, and iOS and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + * because those flags need to be set before `zone.js` being loaded, and webpack + * will put import in the top of bundle, so user need to create a separate file + * in this directory (for example: zone-flags.ts), and put the following flags + * into that file, and then add the following code before importing zone.js. + * import './zone-flags'; + * + * The flags allowed in zone-flags.ts are listed here. + * + * The following flags will work for all browsers. + * + * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + * + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + * + * (window as any).__Zone_enable_cross_context_check = true; + * + */ + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/src/styles.scss b/src/styles.scss new file mode 100644 index 0000000..78d7713 --- /dev/null +++ b/src/styles.scss @@ -0,0 +1,54 @@ +@use '@angular/material' as mat; +@include mat.core(); + +// hue. Available color palettes: https://material.io/design/color/ +$LegioXXX-primary: mat.define-palette(mat.$red-palette, 900); +$LegioXXX-accent: mat.define-palette(mat.$indigo-palette, 900); +$LegioXXX-warn: mat.define-palette(mat.$orange-palette, 500); +$LegioXXX-theme: mat.define-dark-theme(( + color: ( + primary: $LegioXXX-primary, + accent: $LegioXXX-accent, + warn: $LegioXXX-warn, + ) +)); + +@include mat.all-component-themes($LegioXXX-theme); + +@import '~bootstrap/dist/css/bootstrap-utilities.min.css'; + +::-webkit-scrollbar-track { + background: rgba(0, 0, 0, 0); +} + +::-webkit-scrollbar { + width: 10px; + background: rgba(0, 0, 0, 0); +} + +::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.6); + &:hover { background: rgba(255, 255, 255, 0.8); } +} + +html, body { + height: 100%; +} +body { + background: #000; + color: #fff; + font-family: Roboto, sans-serif; + margin: 0; + overflow: hidden; +} + +a, a:visited { + text-decoration: none; + color: rgba(255, 255, 255, 0.6); +} +a:hover, a:visited:hover { color: #b10000; } + +.fill { + height: 0; + min-height: calc(100vh - 64px); +} diff --git a/tsconfig.app.json b/tsconfig.app.json new file mode 100644 index 0000000..82d91dc --- /dev/null +++ b/tsconfig.app.json @@ -0,0 +1,15 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/app", + "types": [] + }, + "files": [ + "src/main.ts", + "src/polyfills.ts" + ], + "include": [ + "src/**/*.d.ts" + ] +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..ff06eae --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,32 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "sourceMap": true, + "declaration": false, + "downlevelIteration": true, + "experimentalDecorators": true, + "moduleResolution": "node", + "importHelpers": true, + "target": "es2020", + "module": "es2020", + "lib": [ + "es2020", + "dom" + ] + }, + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +}