forked from monospaced/angular-elastic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
95 lines (89 loc) · 2.62 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
<!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;
}
#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"></textarea>
</p>
<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', function($scope){
'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.';
$scope.bar = 'Elastic with a CSS transition. Try typing something...';
$scope.submit = function(){
$scope.bar = '';
};
}]);
</script>
</body>
</html>