This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 144
/
index.html
109 lines (101 loc) · 3.23 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html lang="en-gb" data-ng-app="elasticDemo" id="ng-app">
<head>
<meta charset="utf-8">
<title>Angular Elastic</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="//necolas.github.io/normalize.css/2.1.1/normalize.css">
<style>
html {
background: #e7f3ff;
color: #1c000e;
text-shadow: 0 1px 0 #fff;
}
body {
margin: 8px auto;
max-width: 90%;
width: 480px;
}
h1 {
margin: 0 0 8px;
font-weight: normal;
font-size: 30px;
}
a {
color: #0074e7;
text-decoration: none;
-webkit-transition: all 250ms ease-in-out;
-moz-transition: all 250ms ease-in-out;
-o-transition: all 250ms ease-in-out;
transition: all 250ms ease-in-out;
}
a:hover,
a:focus,
a:active {
color: #0067ce;
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
textarea {
padding: 10px;
width: 300px;
max-width: 90%;
}
.animate:focus {
-webkit-transition: height 50ms ease-in-out;
-moz-transition: height 50ms ease-in-out;
-o-transition: height 50ms ease-in-out;
transition: height 50ms ease-in-out;
}
.msd-elastic {
max-height: 400px;
}
#first {
font-size: 30px;
}
</style>
</head>
<body data-ng-controller="elasticDemoController">
<h1>Angular Elastic</h1>
<form data-ng-submit="submit()">
<p>
<textarea class="msd-elastic" data-ng-model="foo" id="first" data-ng-show="show" data-ng-controller="elasticCallbackController"></textarea>
</p>
<small data-ng-show="show"><a href data-ng-click="show = false">Hide</a> | </small>
<small data-ng-show="!show"><a href data-ng-click="show = true">Show</a> | </small>
<small><a href data-ng-click="foo = 'Model changed'">Change model</a></small>
<p>
<textarea class="animate msd-elastic: \n;" data-ng-model="bar"></textarea>
</p>
<p>
<input type="submit" value="Submit and reset">
</p>
</form>
<small>
<a href="https://github.com/monospaced/angular-elastic">https://github.com/monospaced/angular-elastic</a> <br>
<a href="http://monospaced.github.io/">Monospaced Labs</a>
</small>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script>
<script src="elastic.js"></script>
<script>
angular.module('elasticDemo', ['monospaced.elastic'])
.controller('elasticDemoController', ['$scope', '$log', function($scope, $log){
'use strict';
$scope.foo = 'This textarea is going to grow when you fill it with text. Just type a few more words in it and you will see. This textarea is going to grow when you fill it with text.';
$scope.bar = 'Elastic with a CSS transition. Try typing something...';
$scope.submit = function(){
$scope.bar = '';
};
$scope.show = true;
}])
.controller('elasticCallbackController', ['$scope', '$log', function($scope, $log){
'use strict';
$scope.$on('elastic:resize', function(){
$log.log('Height was adjusted!');
});
}]);
</script>
</body>
</html>