Ref: changed file and folder organization

This commit is contained in:
lorenzo 2020-03-12 21:43:21 +01:00
parent 8a191dc554
commit 18e16fe2e8
49 changed files with 874 additions and 14455 deletions

View file

View file

@ -0,0 +1,30 @@
<h2>Add text or remove text from div (max and min font size)</h2>
<div style="border: 2px solid; overflow:hidden; width:100%; height:300px; font-size:520px;">
<div [fittext]="true"
[modelToWatch]="title"
[maxFontSize]="50"
[minFontSize]="30"
[activateOnResize]="true">{{title}}</div>
</div>
<h2>Add text or remove text from div (no max and no min font size)</h2>
<div style="border: 2px solid; overflow:hidden; width:100%; height:300px; font-size:520px;">
<div [fittext]="true"
[modelToWatch]="title"
[activateOnResize]="true">{{title}}</div>
</div>
<button (click)="click('add')"> ADD text</button>
<button (click)="click('remove')"> REMOVE text</button>
<br/>
<br/>
<h2>Write text in input box (text fit inside without overflowing)</h2>
<div #cont2 style="border: 2px solid; height:101px; width:300px;">
<input [fittext]="true"
style="width:100%; height:100px"
[activateOnResize]="true"
[activateOnInputEvents]="true"
[container]="cont2">
</div>

15
src/app/app.component.ts Normal file
View file

@ -0,0 +1,15 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'sdf fsd fsd fsdfsdfsdfsdfsfdf sdfsdf sdfs df fsdfsdfsdfsdfsfdf fsdfsdfsdfsdfsfdf fsdfsdfsdfsdfsfdf ' +
'fsdfsdfsdfsdfsfdf fsdfsdfsdfsdfsfdf';
click(par: string) {
this.title = par === 'add' ? (this.title + this.title) : (this.title.substring(0, this.title.length / 2 + 10));
}
}

17
src/app/app.module.ts Normal file
View file

@ -0,0 +1,17 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import {Ng2FittextModule} from '../lib/ng2-fittext.module';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
Ng2FittextModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }