mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
feat: challenge 45 Simple Animations
This commit is contained in:
36
apps/angular/simple-animations/.eslintrc.json
Normal file
36
apps/angular/simple-animations/.eslintrc.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"extends": ["../../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"plugin:@nx/angular",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"rules": {
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "attribute",
|
||||
"prefix": "app",
|
||||
"style": "camelCase"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": "app",
|
||||
"style": "kebab-case"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@nx/angular-template"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
13
apps/angular/simple-animations/README.md
Normal file
13
apps/angular/simple-animations/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Simple Animations
|
||||
|
||||
> author: thomas-laforge
|
||||
|
||||
### Run Application
|
||||
|
||||
```bash
|
||||
npx nx serve angular-simple-animations
|
||||
```
|
||||
|
||||
### Documentation and Instruction
|
||||
|
||||
Challenge documentation is [here](https://angular-challenges.vercel.app/challenges/angular/45-simple-animations/).
|
||||
22
apps/angular/simple-animations/jest.config.ts
Normal file
22
apps/angular/simple-animations/jest.config.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/* eslint-disable */
|
||||
export default {
|
||||
displayName: 'angular-simple-animations',
|
||||
preset: '../../../jest.preset.js',
|
||||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
||||
coverageDirectory: '../../../coverage/apps/angular/simple-animations',
|
||||
transform: {
|
||||
'^.+\\.(ts|mjs|js|html)$': [
|
||||
'jest-preset-angular',
|
||||
{
|
||||
tsconfig: '<rootDir>/tsconfig.spec.json',
|
||||
stringifyContentPathRegex: '\\.(html|svg)$',
|
||||
},
|
||||
],
|
||||
},
|
||||
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
|
||||
snapshotSerializers: [
|
||||
'jest-preset-angular/build/serializers/no-ng-attributes',
|
||||
'jest-preset-angular/build/serializers/ng-snapshot',
|
||||
'jest-preset-angular/build/serializers/html-comment',
|
||||
],
|
||||
};
|
||||
80
apps/angular/simple-animations/project.json
Normal file
80
apps/angular/simple-animations/project.json
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"name": "angular-simple-animations",
|
||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "application",
|
||||
"prefix": "app",
|
||||
"sourceRoot": "apps/angular/simple-animations/src",
|
||||
"tags": [],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@angular-devkit/build-angular:application",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"outputPath": "dist/apps/angular/simple-animations",
|
||||
"index": "apps/angular/simple-animations/src/index.html",
|
||||
"browser": "apps/angular/simple-animations/src/main.ts",
|
||||
"polyfills": ["zone.js"],
|
||||
"tsConfig": "apps/angular/simple-animations/tsconfig.app.json",
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": [
|
||||
"apps/angular/simple-animations/src/favicon.ico",
|
||||
"apps/angular/simple-animations/src/assets"
|
||||
],
|
||||
"styles": ["apps/angular/simple-animations/src/styles.scss"],
|
||||
"scripts": []
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "500kb",
|
||||
"maximumError": "1mb"
|
||||
},
|
||||
{
|
||||
"type": "anyComponentStyle",
|
||||
"maximumWarning": "2kb",
|
||||
"maximumError": "4kb"
|
||||
}
|
||||
],
|
||||
"outputHashing": "all"
|
||||
},
|
||||
"development": {
|
||||
"optimization": false,
|
||||
"extractLicenses": false,
|
||||
"sourceMap": true
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@angular-devkit/build-angular:dev-server",
|
||||
"configurations": {
|
||||
"production": {
|
||||
"buildTarget": "angular-simple-animations:build:production"
|
||||
},
|
||||
"development": {
|
||||
"buildTarget": "angular-simple-animations:build:development"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "development"
|
||||
},
|
||||
"extract-i18n": {
|
||||
"executor": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"buildTarget": "angular-simple-animations:build"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": ["{options.outputFile}"]
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "apps/angular/simple-animations/jest.config.ts"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { render } from '@testing-library/angular';
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
describe('AppComponent', () => {
|
||||
test('...', async () => {
|
||||
await render(AppComponent);
|
||||
});
|
||||
});
|
||||
78
apps/angular/simple-animations/src/app/app.component.ts
Normal file
78
apps/angular/simple-animations/src/app/app.component.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [],
|
||||
selector: 'app-root',
|
||||
template: `
|
||||
<div class="mx-20 my-40 flex gap-5">
|
||||
<div class="flex flex-1 flex-col gap-5">
|
||||
<section>
|
||||
<h4 class="subtitle">2008</h4>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Vitae
|
||||
mollitia sequi accusantium, distinctio similique laudantium eveniet
|
||||
quidem sit placeat possimus tempore dolorum inventore corporis atque
|
||||
quae ad, nobis explicabo delectus.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="subtitle">2010</h4>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Vitae
|
||||
mollitia sequi accusantium, distinctio similique laudantium eveniet
|
||||
quidem sit placeat possimus tempore dolorum inventore corporis atque
|
||||
quae ad, nobis explicabo delectus.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h4 class="subtitle">2012</h4>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Vitae
|
||||
mollitia sequi accusantium, distinctio similique laudantium eveniet
|
||||
quidem sit placeat possimus tempore dolorum inventore corporis atque
|
||||
quae ad, nobis explicabo delectus.
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-1 flex-col gap-5">
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="flex flex-col border-b px-5 pb-2 lg:flex-row">
|
||||
<div class="key flex-1">Name:</div>
|
||||
<div class="value flex-1">Samuel</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col border-b px-5 pb-2 lg:flex-row">
|
||||
<div class="key flex-1">Age:</div>
|
||||
<div class="value flex-1">28</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col border-b px-5 pb-2 lg:flex-row">
|
||||
<div class="key flex-1">Birthdate:</div>
|
||||
<div class="value flex-1">02.11.1995</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col border-b px-5 pb-2 lg:flex-row">
|
||||
<div class="key flex-1">City:</div>
|
||||
<div class="value flex-1">Berlin</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col border-b px-5 pb-2 lg:flex-row">
|
||||
<div class="key flex-1">Language:</div>
|
||||
<div class="value flex-1">English</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col border-b px-5 pb-2 lg:flex-row">
|
||||
<div class="key flex-1">Like Pizza:</div>
|
||||
<div class="value flex-1">Hell yeah</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
styles: [''],
|
||||
})
|
||||
export class AppComponent {}
|
||||
5
apps/angular/simple-animations/src/app/app.config.ts
Normal file
5
apps/angular/simple-animations/src/app/app.config.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { ApplicationConfig } from '@angular/core';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [],
|
||||
};
|
||||
0
apps/angular/simple-animations/src/assets/.gitkeep
Normal file
0
apps/angular/simple-animations/src/assets/.gitkeep
Normal file
BIN
apps/angular/simple-animations/src/favicon.ico
Normal file
BIN
apps/angular/simple-animations/src/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
13
apps/angular/simple-animations/src/index.html
Normal file
13
apps/angular/simple-animations/src/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>angular-simple-animations</title>
|
||||
<base href="/" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||
</head>
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
</body>
|
||||
</html>
|
||||
7
apps/angular/simple-animations/src/main.ts
Normal file
7
apps/angular/simple-animations/src/main.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { AppComponent } from './app/app.component';
|
||||
import { appConfig } from './app/app.config';
|
||||
|
||||
bootstrapApplication(AppComponent, appConfig).catch((err) =>
|
||||
console.error(err),
|
||||
);
|
||||
5
apps/angular/simple-animations/src/styles.scss
Normal file
5
apps/angular/simple-animations/src/styles.scss
Normal file
@@ -0,0 +1,5 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
/* You can add global styles to this file, and also import other style files */
|
||||
2
apps/angular/simple-animations/src/test-setup.ts
Normal file
2
apps/angular/simple-animations/src/test-setup.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
import '@testing-library/jest-dom';
|
||||
import 'jest-preset-angular/setup-jest';
|
||||
14
apps/angular/simple-animations/tailwind.config.js
Normal file
14
apps/angular/simple-animations/tailwind.config.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind');
|
||||
const { join } = require('path');
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
join(__dirname, 'src/**/!(*.stories|*.spec).{ts,html}'),
|
||||
...createGlobPatternsForDependencies(__dirname),
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
10
apps/angular/simple-animations/tsconfig.app.json
Normal file
10
apps/angular/simple-animations/tsconfig.app.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../../dist/out-tsc",
|
||||
"types": []
|
||||
},
|
||||
"files": ["src/main.ts"],
|
||||
"include": ["src/**/*.d.ts"],
|
||||
"exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"]
|
||||
}
|
||||
7
apps/angular/simple-animations/tsconfig.editor.json
Normal file
7
apps/angular/simple-animations/tsconfig.editor.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"types": ["jest", "node"]
|
||||
}
|
||||
}
|
||||
33
apps/angular/simple-animations/tsconfig.json
Normal file
33
apps/angular/simple-animations/tsconfig.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2022",
|
||||
"useDefineForClassFields": false,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"noImplicitOverride": true,
|
||||
"noPropertyAccessFromIndexSignature": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
},
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.app.json",
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.spec.json",
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.editor.json",
|
||||
},
|
||||
],
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableI18nLegacyMessageIdFormat": false,
|
||||
"strictInjectionParameters": true,
|
||||
"strictInputAccessModifiers": true,
|
||||
"strictTemplates": true,
|
||||
},
|
||||
}
|
||||
15
apps/angular/simple-animations/tsconfig.spec.json
Normal file
15
apps/angular/simple-animations/tsconfig.spec.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node", "@testing-library/jest-dom"]
|
||||
},
|
||||
"files": ["src/test-setup.ts"],
|
||||
"include": [
|
||||
"jest.config.ts",
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user