-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #815 from IgniteUI/rivanova/carousel-samples
Add Carousel samples
- Loading branch information
Showing
37 changed files
with
1,576 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"printWidth": 250, | ||
"tabWidth": 4, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": false, | ||
"trailingComma": "none", | ||
"bracketSpacing": true, | ||
"jsxBracketSameLine": false, | ||
"fluid": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!-- NOTE: do not change this file because it's auto re-generated from template: --> | ||
<!-- https://github.com/IgniteUI/igniteui-wc-examples/tree/vnext/templates/browser/sample/ReadMe.md --> | ||
|
||
This folder contains implementation of Web Components application with example of Animations feature using [Carousel](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component. | ||
|
||
|
||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> | ||
<body> | ||
<a target="_blank" href="https://infragistics.com/webcomponentssite/components/general-getting-started.html" rel="noopener noreferrer"> | ||
<img height="40px" style="border-radius: 0rem" alt="View Docs" src="https://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/button-docs.png"/> | ||
</a> | ||
<a target="_blank" href="./src/index.ts" rel="noopener noreferrer"> | ||
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="View Code" src="https://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/button-code.png"/> | ||
</a> | ||
<a target="_blank" href="https://www.infragistics.com/webcomponents-demos/samples/layouts/carousel/animations" rel="noopener noreferrer"> | ||
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/button-run.png"/> | ||
</a> | ||
<a target="_blank" href="https://codesandbox.io/s/github/IgniteUI/igniteui-wc-examples/tree/master/samples/layouts/carousel/animations?fontsize=14&hidenavigation=1&theme=dark&view=preview&file=/src/{SampleFile}" rel="noopener noreferrer"> | ||
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/button-sandbox.png"/> | ||
</a> | ||
</body> | ||
</html> | ||
|
||
## Branches | ||
|
||
> **_NOTE:_** You should use [master](https://github.com/IgniteUI/igniteui-angular-examples/tree/master) branch of this repository if you want to run samples on your computer. Use the [vnext](https://github.com/IgniteUI/igniteui-angular-examples/tree/vnext) branch only when you want to contribute new samples to this repository. | ||
## Instructions | ||
|
||
To set up this project locally, execute these commands: | ||
|
||
``` | ||
git clone https://github.com/IgniteUI/igniteui-wc-examples.git | ||
git checkout master | ||
cd ./igniteui-wc-examples | ||
cd ./samples/layouts/carousel/animations | ||
``` | ||
|
||
open above folder in VS Code or type: | ||
``` | ||
code . | ||
``` | ||
|
||
In terminal window, run: | ||
|
||
``` | ||
npm install | ||
npm run start | ||
``` | ||
|
||
Then open http://localhost:4200/ in your browser | ||
|
||
|
||
## Learn More | ||
|
||
To learn more about **Ignite UI for Web Components**, check out the [Web Components documentation](https://infragistics.com/webcomponentssite/components/general-getting-started.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Carousel Animations</title> | ||
<meta charset="UTF-8" /> | ||
|
||
<link rel="shortcut icon" href="https://static.infragistics.com/xplatform/images/browsers/wc.png" > | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" /> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium Web" /> | ||
<link rel="stylesheet" href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css" type="text/css" /> | ||
</head> | ||
|
||
<body> | ||
<div id="root"> | ||
<div class="carousel-wrapper"> | ||
<div class="action-wrapper"> | ||
<div class="action"> | ||
<span>Animation type</span> | ||
<igc-select id="select"> | ||
<igc-select-item value="slide" selected>Slide</igc-select-item> | ||
<igc-select-item value="fade">Fade</igc-select-item> | ||
<igc-select-item value="none">None</igc-select-item> | ||
</igc-select> | ||
</div> | ||
<div class="action"> | ||
<igc-switch label-position="before">Vertical alignment</igc-switch> | ||
</div> | ||
</div> | ||
<igc-carousel hide-indicators> | ||
<igc-carousel-slide> | ||
<div class="slide-wrapper"> | ||
<igc-card> | ||
<igc-card-header> | ||
<h3 slot="title">Ignite UI for Angular</h3> | ||
</igc-card-header> | ||
<igc-card-content> | ||
<p>30+ Material-based Angular components to code speedy web apps faster.</p> | ||
</igc-card-content> | ||
<igc-card-media> | ||
<img src="https://www.infragistics.com/angular-demos-lob/assets/images/carousel/slide1-angular.png"> | ||
</igc-card-media> | ||
<igc-card-actions> | ||
<igc-button slot="start" href="https://www.infragistics.com/products/ignite-ui-angular" target="_blank" rel="noopener"> | ||
Visit Page | ||
</igc-button> | ||
</igc-card-actions> | ||
</igc-card> | ||
</div> | ||
</igc-carousel-slide> | ||
<igc-carousel-slide> | ||
<div class="slide-wrapper"> | ||
<igc-card> | ||
<igc-card-header> | ||
<h3 slot="title">Ignite UI for Javascript</h3> | ||
</igc-card-header> | ||
<igc-card-content> | ||
<p>A complete JavaScript UI library empowering you to build data-rich responsive web apps.</p> | ||
</igc-card-content> | ||
<igc-card-media> | ||
<img src="https://www.infragistics.com/angular-demos-lob/assets/images/carousel/slide2-ignite.png"> | ||
</igc-card-media> | ||
<igc-card-actions> | ||
<igc-button slot="start" href="https://www.infragistics.com/products/ignite-ui" target="_blank" rel="noopener"> | ||
Visit Page | ||
</igc-button> | ||
</igc-card-actions> | ||
</igc-card> | ||
</div> | ||
</igc-carousel-slide> | ||
<igc-carousel-slide> | ||
<div class="slide-wrapper"> | ||
<igc-card> | ||
<igc-card-header> | ||
<h3 slot="title">Ultimate UI for ASP.NET</h3> | ||
</igc-card-header> | ||
<igc-card-content> | ||
<p>Build full-featured business apps with the most versatile set of ASP.NET AJAX UI controls.</p> | ||
</igc-card-content> | ||
<igc-card-media> | ||
<img src="https://www.infragistics.com/angular-demos-lob/assets/images/carousel/slide3-aspnet.png"> | ||
</igc-card-media> | ||
<igc-card-actions> | ||
<igc-button slot="start" href="https://www.infragistics.com/products/aspnet" target="_blank" rel="noopener"> | ||
Visit Page | ||
</igc-button> | ||
</igc-card-actions> | ||
</igc-card> | ||
</div> | ||
</igc-carousel-slide> | ||
</igc-carousel> | ||
</div> | ||
</div> | ||
<!-- This script is needed only for parcel and it will be excluded for webpack --> | ||
<% if (false) { %><script src="src/index.ts"></script><% } %> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"name": "wc-carousel-animations", | ||
"version": "1.0.0", | ||
"description": "This project provides example of carousel animations using IgniteUI for Web Components", | ||
"main": "src/index.ts", | ||
"scripts": { | ||
"build": "npm run build:prod", | ||
"build:dev": "webpack --mode development --config ./webpack.config.js --progress --color --display-error-details", | ||
"build:prod": "webpack --env.NODE_ENV=production --mode production --config ./webpack.config.js --progress --color --display-error-details --bail", | ||
"serve:dev": "node --max-old-space-size=8192 node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode development --config ./webpack.config.js --hot --progress --open", | ||
"serve:prod": "webpack-dev-server --env.NODE_ENV=production --mode production --config ./webpack.config.js --port 3000 --host 0.0.0.0 --hot --progress --open --content-base dist/", | ||
"start": "npm run serve:dev", | ||
"build:legacy": "npm run build:prod:legacy", | ||
"build:dev:legacy": "webpack --env.legacy=true --mode development --config ./webpack.config.js --progress --color --display-error-details", | ||
"build:prod:legacy": "webpack --env.NODE_ENV=production --env.legacy=true --mode production --config ./webpack.config.js --progress --color --display-error-details --bail", | ||
"serve:dev:legacy": "node --max-old-space-size=8192 node_modules/webpack-dev-server/bin/webpack-dev-server.js --env.legacy=true --mode development --config ./webpack.config.js --hot --progress --open", | ||
"serve:prod:legacy": "webpack-dev-server --env.NODE_ENV=production --env.legacy=true --mode production --config ./webpack.config.js --port 3000 --host 0.0.0.0 --hot --progress --open --content-base dist/", | ||
"start:legacy": "npm run serve:dev:legacy" | ||
}, | ||
"author": "Infragistics", | ||
"dependencies": { | ||
"@webcomponents/custom-elements": "^1.4.1", | ||
"@webcomponents/template": "^1.4.2", | ||
"babel-runtime": "^6.26.0", | ||
"core-js": "^3.6.5", | ||
"igniteui-webcomponents": "5.1.1", | ||
"lit": "^3.2.1", | ||
"lit-html": "^3.2.1", | ||
"tslib": "^2.6.3" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.8.3", | ||
"@babel/core": "^7.8.3", | ||
"@babel/plugin-proposal-class-properties": "^7.8.3", | ||
"@babel/plugin-transform-runtime": "^7.10.0", | ||
"@babel/preset-env": "^7.8.3", | ||
"@babel/preset-typescript": "^7.8.3", | ||
"@types/source-map": "^0.5.7", | ||
"babel-loader": "^8.1.0", | ||
"babel-plugin-transform-custom-element-classes": "^0.1.0", | ||
"css-loader": "^1.0.0", | ||
"csv-loader": "^3.0.2", | ||
"file-loader": "^4.2.0", | ||
"fork-ts-checker-webpack-plugin": "^4.1.5", | ||
"html-webpack-plugin": "^4.3.0", | ||
"parcel-bundler": "^1.6.1", | ||
"source-map": "^0.7.3", | ||
"style-loader": "^0.22.1", | ||
"tsconfig-paths-webpack-plugin": "^4.0.0", | ||
"typescript": "^4.4.4", | ||
"webpack": "^5.74.0", | ||
"webpack-cli": "^4.10.0", | ||
"webpack-dev-server": "^4.11.1", | ||
"worker-loader": "^3.0.8", | ||
"xml-loader": "^1.2.1" | ||
}, | ||
"license": "", | ||
"homepage": "." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"infiniteLoopProtection": false, | ||
"hardReloadOnChange": false, | ||
"view": "browser", | ||
"template": "parcel" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* shared styles are loaded from: */ | ||
/* https://static.infragistics.com/xplatform/css/samples */ | ||
|
||
.carousel-wrapper { | ||
height: 600px; | ||
width: 90%; | ||
margin: 20px auto; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
} | ||
|
||
.action-wrapper { | ||
height: 40px; | ||
width: 500px; | ||
display: flex; | ||
justify-content: space-between; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.action { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.slide-wrapper { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 10px; | ||
} | ||
|
||
igc-carousel { | ||
border: 0.5px solid #dde0e4; | ||
} | ||
|
||
igc-select { | ||
width: 150px; | ||
margin-left: 10px; | ||
--ig-size: var(--ig-size-small); | ||
} | ||
|
||
igc-card { | ||
border: none; | ||
} | ||
|
||
igc-card-header { | ||
padding: 8px 16px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { defineComponents, IgcButtonComponent, IgcCardComponent, IgcCarouselComponent, IgcSelectComponent, IgcSwitchComponent } from "igniteui-webcomponents"; | ||
import "igniteui-webcomponents/themes/light/bootstrap.css"; | ||
import "./index.css"; | ||
|
||
defineComponents(IgcCarouselComponent, IgcSelectComponent, IgcCardComponent, IgcButtonComponent, IgcSwitchComponent); | ||
|
||
export class CarouselAnimations { | ||
private carousel: IgcCarouselComponent; | ||
private select: IgcSelectComponent; | ||
private switch: IgcSwitchComponent; | ||
|
||
constructor() { | ||
this.carousel = document.querySelector('igc-carousel') as IgcCarouselComponent; | ||
this.select = document.querySelector('igc-select') as IgcSelectComponent; | ||
this.switch = document.querySelector('igc-switch') as IgcSwitchComponent; | ||
|
||
this.select.addEventListener("igcChange", (e) => { | ||
const animation = e.detail.value as 'slide' | 'fade' | 'none'; | ||
this.carousel.animationType = animation; | ||
}); | ||
|
||
this.switch.addEventListener("igcChange", (e) => { | ||
this.carousel.vertical = e.detail.checked; | ||
}); | ||
} | ||
} | ||
|
||
new CarouselAnimations(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"compilerOptions": { | ||
"noImplicitReturns": true, | ||
"esModuleInterop": true, | ||
"noImplicitAny": true, | ||
"declarationDir": "dist/types", | ||
"moduleResolution": "node", | ||
"declaration": true, | ||
"target": "es2015", | ||
"module": "es2015", | ||
"strict": true | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"exclude": [ | ||
"node_modules", | ||
"dist" | ||
] | ||
} |
Oops, something went wrong.