diff --git a/src/MistoxWebsite.Client/src/app/app.routes.ts b/src/MistoxWebsite.Client/src/app/app.routes.ts index 602aaac..b25b7ee 100644 --- a/src/MistoxWebsite.Client/src/app/app.routes.ts +++ b/src/MistoxWebsite.Client/src/app/app.routes.ts @@ -9,6 +9,7 @@ import { SettingsComponent } from './pages/account/settings/settings.component'; import { LogoutComponent } from './pages/account/logout/logout.component'; import { ResetPasswordComponent } from './pages/account/resetpassword/resetpassword.component'; import { VerifyEmailComponent } from './pages/account/verifyemail/verifyemail.component'; +import { NewItemComponent } from './pages/store/admin/newitem/new.component'; export const routes: Routes = [ @@ -27,6 +28,9 @@ export const routes: Routes = [ // Store { path: "store/catalog", component: CatalogComponent }, + // AdminPages + { path: "store/admin/new", component: NewItemComponent }, + // Legal { path: "about", component: AboutComponent }, ] \ No newline at end of file diff --git a/src/MistoxWebsite.Client/src/app/pages/store/admin/newitem/new.component.css b/src/MistoxWebsite.Client/src/app/pages/store/admin/newitem/new.component.css new file mode 100644 index 0000000..1081939 --- /dev/null +++ b/src/MistoxWebsite.Client/src/app/pages/store/admin/newitem/new.component.css @@ -0,0 +1,145 @@ +.gameCard { + position: relative; + background-color: var(--Mistox-Black); + float: left; + box-sizing: border-box; + margin: 0; + padding: 0; + width: 100%; + border-radius: 10px; + break-inside: avoid; + margin-bottom: 2rem; + border: solid 2px var(--Mistox-Background); + transition-duration: 1s; +} + +.gameCard :hover{ + border-color: var(--Mistox-Light); +} + +.gameCard-Name { + width: 100%; + text-align: left; + font-size: 25px; + padding: 5px 0 0 5px; + background-color: rgba(0,0,0,.1); +} + +.gameCard-Grid { + column-count: 4; + column-gap: 2rem; + padding-top: 20px; + width: calc(100% - 40px); + margin-left: 20px; +} + +@media (max-width: 1400px) { + .gameCard-Grid { + column-count: 3; + padding-top: 20px; + width: calc(100% - 40px); + margin-left: 20px; + } +} + +@media (max-width: 1100px) { + .gameCard-Grid { + column-count: 2; + padding-top: 20px; + width: calc(100% - 40px); + margin-left: 20px; + } +} + +@media (max-width: 900px) { + .gameCard-Grid { + column-count: 1; + padding-top: 20px; + width: calc(100% - 40px); + margin-left: 20px; + } +} + +.gameCard-Img { + width: 100%; + border-radius: 10px 10px 0 0; +} + +.gameCard-Next, +.gameCard-Prev { + background-color: transparent; + color: var(--Mistox-White); + padding: 16px; + margin-top: -22px; + font-size: 18px; + font-weight: bold; + border: none; + transition: background-color 0.6s ease; +} + + .gameCard-Next:hover, + .gameCard-Prev:hover { + background-color: rgba(0, 0, 0, 0.5); + } + +.gameCard-Prev { + position: absolute; + top: 50%; +} + +.gameCard-Next { + position: absolute; + top: 50%; + right: 0; +} + +.gameCard-Desc { + font-size: 13px; + margin: 5px; + color: var(--Mistox-Light); +} + +.gameCard-Price { + width: calc(50% - 10px); + float: left; + margin: 5px; + text-align: center; + margin-bottom: 10px; +} + +.gameCard-Button { + width: 40%; + margin: 5px 5%; + height: 38.4px; + color: var(--Mistox-Black); + background-color: var(--Mistox-Light); + font-size: 16px; + text-decoration: none; + text-transform: uppercase; + overflow: hidden; + transition: 0.5s; + letter-spacing: 2px; + border: 1px solid var(--Mistox-Light); + border-radius: 5px; +} + + .gameCard-Button :hover{ + background-color: var(--Mistox-Light); + color: var(--Mistox-White); + box-shadow: 4px 3px 6px var(--Mistox-Dark); + } + +.cartopen { + position: absolute; + background: var(--Mistox-Offset); + right: 10px; + top: 55px; + width: 400px; + border-radius: 5px; + backdrop-filter: blur(3px); + border: 1px solid var(--Mistox-Light); +} + +.cartclosed { + display: none; +} \ No newline at end of file diff --git a/src/MistoxWebsite.Client/src/app/pages/store/admin/newitem/new.component.html b/src/MistoxWebsite.Client/src/app/pages/store/admin/newitem/new.component.html new file mode 100644 index 0000000..e299d31 --- /dev/null +++ b/src/MistoxWebsite.Client/src/app/pages/store/admin/newitem/new.component.html @@ -0,0 +1,39 @@ +
\ No newline at end of file diff --git a/src/MistoxWebsite.Client/src/app/pages/store/admin/newitem/new.component.ts b/src/MistoxWebsite.Client/src/app/pages/store/admin/newitem/new.component.ts new file mode 100644 index 0000000..c2e4051 --- /dev/null +++ b/src/MistoxWebsite.Client/src/app/pages/store/admin/newitem/new.component.ts @@ -0,0 +1,59 @@ +import { Component } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { FormsModule } from '@angular/forms'; +import { Router, ActivatedRoute } from '@angular/router'; +import { Title } from '@angular/platform-browser'; +import { CommonModule } from '@angular/common'; +import { Authentication } from '../../../../services/Authentication'; +import { Product } from 'app/models/Product'; + +@Component({ + selector: 'item-new', + templateUrl: './new.component.html', + styleUrl: './new.component.css', + imports: [ FormsModule, CommonModule ] +}) +export class NewItemComponent { + + newItem: Product = new Product(); + + errorMsgs: string[] = []; + + constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) { + this.title.setTitle("New | ADMIN"); + }; + + sleep(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + selectedFiles: File[] = []; + onFileSelected(event: any){ + this.selectedFiles = event.target.files; + } + + onSubmit(){ + // Add uploaded files to dto + if (this.selectedFiles.length > 0){ + for(let i=0; i