Commit 0231ce3a authored by Anusha Mamidala's avatar Anusha Mamidala
Browse files

Added electron and web

parent f4589e30
......@@ -27,9 +27,13 @@
"src/assets"
],
"styles": [
"src/styles.css"
"src/styles.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": []
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"
]
},
"configurations": {
"production": {
......@@ -90,9 +94,13 @@
"src/assets"
],
"styles": [
"src/styles.css"
"src/styles.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": []
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"
]
}
},
"lint": {
......
This diff is collapsed.
{
"name": "balaswecha",
"version": "0.0.0",
"main": "main.js",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
"e2e": "ng e2e",
"electron": "electron ./src/electron.dev",
"desktop": "concurrently \"ng serve\" \"npm run electron\""
},
"private": true,
"private": false,
"dependencies": {
"@angular/animations": "~11.2.0",
"@angular/common": "~11.2.0",
......@@ -19,6 +22,8 @@
"@angular/platform-browser": "~11.2.0",
"@angular/platform-browser-dynamic": "~11.2.0",
"@angular/router": "~11.2.0",
"bootstrap": "^4.6.0",
"jquery": "^3.6.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.3"
......@@ -30,6 +35,8 @@
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"concurrently": "^6.0.0",
"electron": "^12.0.1",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.1.0",
......
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './components/home/home.component';
import { SimulationsComponent } from './components/simulations/simulations.component';
import { VideoSimulationComponent } from './components/video-simulation/video-simulation.component';
const routes: Routes = [];
const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{
path: 'home', component: HomeComponent
},
{
path: 'videos', component: SimulationsComponent,
},
{
path: 'videos/:simUrl', component: VideoSimulationComponent,
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
......
<div *ngFor="let item of appsList">
<iframe [src]="item | safe" width="500" height="500" scrolling="no" allowfullscreen></iframe>
</div>
\ No newline at end of file
<app-header></app-header>
<router-outlet></router-outlet>
\ No newline at end of file
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule } from '@angular/common/http';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { SafePipe } from './safe.pipe';
import { HeaderComponent } from './components/header/header.component';
import { FooterComponent } from './components/footer/footer.component';
import { HomeComponent } from './components/home/home.component';
import { SimulationsComponent } from './components/simulations/simulations.component';
import { VideoSimulationComponent } from './components/video-simulation/video-simulation.component';
@NgModule({
declarations: [
AppComponent,
SafePipe
SafePipe,
HeaderComponent,
FooterComponent,
HomeComponent,
SimulationsComponent,
VideoSimulationComponent
],
imports: [
BrowserModule,
AppRoutingModule
AppRoutingModule,
HttpClientModule,
],
providers: [],
bootstrap: [AppComponent]
......
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FooterComponent } from './footer.component';
describe('FooterComponent', () => {
let component: FooterComponent;
let fixture: ComponentFixture<FooterComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ FooterComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(FooterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.css']
})
export class FooterComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
@import url("https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@500&display=swap");
header {
display: flex;
align-items: center;
padding-top: 10px;
padding-bottom: 10px;
width: 100%;
z-index: 9999;
font-family: "Roboto Slab", serif;
}
header ul {
display: flex;
width: 100%;
margin-top: 1em;
align-items: center;
z-index: 999;
justify-content: flex-end;
}
header ul li {
list-style-type: none;
margin-right: 15px;
}
header ul li a {
text-decoration: none;
color: #666;
font-size: 18px;
}
header ul li a:hover {
color: red;
cursor: pointer;
}
.active {
color: red !important;
}
<header>
<!-- <img src="./../../assets/images/log.png" alt="Logo" class="logoImage"> -->
<ul>
<li><a [routerLink]="['home']" class="active">Home</a></li>
<li><a>Videos</a></li>
<li><a>Blog</a></li>
<li><a>About</a></li>
</ul>
</header>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HeaderComponent } from './header.component';
describe('HeaderComponent', () => {
let component: HeaderComponent;
let fixture: ComponentFixture<HeaderComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ HeaderComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(HeaderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css']
})
export class HeaderComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
.home-main-banner {
background-color: #fff0f454;
display: flex;
width: 100%;
justify-content: space-between;
align-items: center;
padding-top: 50px;
padding-bottom: 50px;
}
.home-main-banner-heading {
display: flex;
flex-direction: column;
width: 100%;
}
.home-main-banner-heading span {
font-size: xxx-large;
font-family: cursive;
align-self: center;
color: #3f3d56;
}
<div class="home-main-banner">
<div class="home-main-banner-heading">
<span>Learn,</span>
<span> Share &</span> <span>Explore</span>
</div>
<img src="../../../assets/main-banner.svg">
</div>
<div class="container mt-5 mb-5">
<div class="row justify-content-center">
<div class="col-3">
<select class="form-control" #formClassSelect (change)="onSelectClass(formClassSelect.value)">
<option selected disabled>Select class</option>
<option *ngFor="let option of classes" [value]="option">Class {{option}}</option>
</select>
</div>
<div class="col-3">
<select class="form-control" #formSubSelect (change)="onSelectSubject(formSubSelect.value)">
<option selected disabled>Select Subject</option>
<option *ngFor="let option of subjects" [value]="option.type">{{option.value}}</option>
</select>
</div>
<button type="submit" class="btn btn-primary" (click)="getCourses()">Get Courses!</button>
</div>
</div>
<app-simulations [simulationItems]="simulationItems"></app-simulations>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HomeComponent } from './home.component';
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ HomeComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { CourseService } from 'src/app/services/course.service';
import { Course } from 'src/app/shared/course';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
selectedClass = 4;
selectedSubject = 'all';
selectedOption: any;
simulationItems: Course[];
classes: number[] = [4, 5, 6, 7, 8, 9];
subjects = [{ type: "phy", value: "Physics" }, { type: "che", value: "Chemistry" }, { type: "math", value: "Maths" }, { type: "bio", value: "Biology" }]
constructor(private service: CourseService) { }
ngOnInit(): void {
this.service.getJSON().subscribe((response: any) => {
this.simulationItems = response;
})
}
getCourses() {
this.selectedOption = {
"selectedClass": this.selectedClass,
"selectedSubject": this.selectedSubject
}
if (this.selectedOption?.selectedSubject !== 'all') {
console.log('here', this.selectedOption?.selectedSubject);
this.simulationItems = this.simulationItems.filter(e => e.category === this.selectedOption?.selectedSubject);
}
}
onSelectClass(value) {
this.selectedClass = value;
}
onSelectSubject(value) {
this.selectedSubject = value;
}
}
.simulations {
cursor: pointer;
margin: 30px;
display: flex;
padding: 5px;
}
.simulations div {
margin: 10px;
}
<div class="simulations">
<div class="card" (click)="onClickSimulation(item)" *ngFor="let item of simulationItems;">
<img class="card-img-top" src='{{ "assets/" + item.img_src }}'>
<div class="card-body">
<p class="card-text">{{item.name}}</p>
</div>
</div>
</div>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment