Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed minor css issues and copy to clipboard #74

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions projects/ngx-stories/src/lib/interfaces/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type StoryType = 'image' | 'video';
export type StoryStateType = 'playing' | 'paused' | 'holding' | 'buffering' ;
export interface Story {
id: number,
type: StoryType,
Expand Down
4 changes: 2 additions & 2 deletions projects/ngx-stories/src/lib/ngx-stories.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AfterViewInit, Component, ElementRef, Input, Output, QueryList, ViewChildren, HostListener } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { HammerModule } from '@angular/platform-browser';
import { StoryGroup } from '../lib/interfaces/interfaces';
import { StoryGroup, StoryStateType } from '../lib/interfaces/interfaces';
import { CommonModule } from '@angular/common';
import { NgxStoriesService } from './ngx-stories.service';
import { NgxStoriesOptions } from '../lib/interfaces/interfaces';
Expand Down Expand Up @@ -45,7 +45,7 @@ export class NgxStoriesComponent implements AfterViewInit {
isSwipingRight = false;
isHolding = false;
holdTimeout: any; // Timeout for holding the story (pause functionality)
storyState: 'playing' | 'paused' | 'holding' | 'buffering' = 'playing';
storyState: StoryStateType = 'playing';
isLoading: boolean = false;
currentProgressWidth: number = 0;
// constants
Expand Down
9 changes: 9 additions & 0 deletions public/assets/images/copy-done.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 1 addition & 12 deletions src/app/app.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
margin: 0;
padding: 0;
box-sizing: border-box;
overflow: hidden;
/* overflow: hidden; */
}

/* body{
background-repeat: repeat;
background-size: auto;
background-image: url("/assets/images/background.png");
} */

/* logo CSS */
.angularlogo {
Expand Down Expand Up @@ -222,12 +217,6 @@ body {
width: 70vw;
height: 100px;
}

/* td {
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
} */
}


Expand Down
8 changes: 4 additions & 4 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<div class="main-container">
<div class="data-container">
<h1 class="heading">Ngx-Stories</h1>
<p class="intro-text">An angular component for rendering Instagram-like stories.</p>
<p class="install-text">npm i ngx-stories<a href=""><img class="copy" src="assets/images/copy.png" alt=""></a></p>
<p class="intro-text">An angular component for rendering instagram like stories.</p>
<p class="install-text">npm i ngx-stories<a href="javascript:void(0)" (click)="copyCommand()"><img class="copy" [src]="installIcon" alt="copy icon"></a></p>

<div class="table">

<table>
<thead>
<tr>
<th>Instructions for the Insta Stories</th>
<th>Instructions for the Ngx-Stories</th>
</tr>
</thead>
<tbody>
<tr>
<td><img class="instructions" src="assets/images/left.png" alt=""> Tap left for previous stories</td>
</tr>
<tr>
<td><img class="instructions" src="assets/images/right.png" alt=""> Tap right for previous stories</td>
<td><img class="instructions" src="assets/images/right.png" alt=""> Tap right for next stories</td>
</tr>
<tr>
<td><img class="instructions" src="assets/images/center.png" alt=""> Press and hold to pause</td>
Expand Down
6 changes: 6 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { NgxStoriesComponent, NgxStoriesOptions, StoryGroup } from '../../projec
styleUrl: './app.component.css',
})
export class AppComponent {
installIcon: string = 'assets/images/copy.png';
storyOptions: NgxStoriesOptions = {
width: 338,
height: 600,
Expand Down Expand Up @@ -55,4 +56,9 @@ export class AppComponent {
currentStoryDetails(eventData: object) {
console.log('currentStoryDetails', eventData);
}

copyCommand() {
navigator.clipboard.writeText('npm i ngx-stories');
this.installIcon = 'assets/images/copy-done.svg';
}
}
Loading