This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(whiteframe) Interpolate whiteframe value, and remove whiteframe …
…style when set to -1 Closes #8058
- Loading branch information
1 parent
621cc95
commit a55faa0
Showing
5 changed files
with
147 additions
and
8 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/components/whiteframe/demoDirectiveInterpolation/index.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,19 @@ | ||
<div layout="row" layout-padding layout-wrap layout-margin ng-cloak layout-align="space-around" ng-controller="DemoCtrl as ctrl"> | ||
<div class="padded" md-whiteframe="{{ctrl.elevation}}" flex="100" flex-gt-sm="50" layout="column" layout-align="center center"> | ||
<span ng-non-bindable>md-whiteframe="{{ctrl.elevation}}"</span> | ||
<span>md-whiteframe="{{ctrl.elevation}}"</span> | ||
<span>Increments through the available elevations</span> | ||
</div> | ||
<div class="padded" md-whiteframe="{{height}}" flex="100" flex-gt-sm="50" layout="column" layout-align="center center" | ||
ng-init="height = 3" ng-mouseenter="height = 6" ng-mouseleave="height = 3"> | ||
<span ng-non-bindable>md-whiteframe="{{height}}"</span> | ||
<span>md-whiteframe="{{height}}"</span> | ||
<span>Hover to toggle</span> | ||
</div> | ||
<div class="padded" md-whiteframe="{{ctrl.showFrame}}" flex="100" flex-gt-sm="50" layout="column" layout-align="center center" | ||
ng-click="ctrl.toggleFrame()"> | ||
<span ng-non-bindable>md-whiteframe="{{ctrl.showFrame}}"</span> | ||
<span>md-whiteframe="{{ctrl.showFrame}}"</span> | ||
<span>Set to -1 to remove elevation shadow, click to toggle</span> | ||
</div> | ||
</div> |
17 changes: 17 additions & 0 deletions
17
src/components/whiteframe/demoDirectiveInterpolation/script.js
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,17 @@ | ||
angular.module('whiteframeDirectiveUsage', ['ngMaterial']) | ||
.controller('DemoCtrl', function($interval) { | ||
this.elevation = 1; | ||
this.showFrame = 3; | ||
|
||
this.nextElevation = function() { | ||
if (++this.elevation == 25) { | ||
this.elevation = 1; | ||
} | ||
}; | ||
|
||
$interval(this.nextElevation.bind(this), 500); | ||
|
||
this.toggleFrame = function() { | ||
this.showFrame = this.showFrame == 3 ? -1 : 3; | ||
}; | ||
}); |
56 changes: 56 additions & 0 deletions
56
src/components/whiteframe/demoDirectiveInterpolation/style.css
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 @@ | ||
md-whiteframe, div.padded { | ||
background: #fff; | ||
height: 100px; | ||
} | ||
|
||
md-whiteframe:focus, div.padded:focus { | ||
outline: none; | ||
} | ||
|
||
.layout-margin div.padded { | ||
margin: 16px 8px; | ||
} | ||
|
||
/* For breakpoint `-xs` */ | ||
@media (max-width: 599px) { | ||
md-whiteframe, div.padded { | ||
margin: 7px; | ||
height: 50px; | ||
background-color: #c8e4fa; | ||
} | ||
md-whiteframe > span, div.padded > span { | ||
font-size: 0.4em; | ||
} | ||
} | ||
|
||
/* For breakpoint `-sm` */ | ||
@media (min-width: 600px ) and (max-width: 959px) { | ||
md-whiteframe, div.padded { | ||
height: 75px; | ||
} | ||
md-whiteframe > span, div.padded > span { | ||
font-size: 0.6em; | ||
} | ||
} | ||
|
||
/* For breakpoint `-md` */ | ||
@media (min-width: 960px ) and (max-width: 1279px) { | ||
md-whiteframe, div.padded { | ||
height: 90px; | ||
background-color: #fcddde; | ||
} | ||
md-whiteframe > span, div.padded > span { | ||
font-size: 0.9em; | ||
} | ||
} | ||
|
||
/* For breakpoint `-gt-md` */ | ||
@media (min-width: 1280px) { | ||
md-whiteframe, div.padded { | ||
height: 100px; | ||
background-color: #F2FCE2; | ||
} | ||
md-whiteframe > span, div.padded > span { | ||
font-size: 1.0em; | ||
} | ||
} |
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