-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
executable file
·148 lines (98 loc) · 3.25 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Flames</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/fancyInput.css">
<link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:700' rel='stylesheet' type='text/css'>
<script src="http://use.edgefonts.net/league-gothic.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<div id='disp'>
<h1 >Flames</h1>
<form method="get" action="simple" id="form1">
<div id='content'>
<section class='input'>
<div>
<input type="text" name="girl" autocomplete="off">
</div>
</section>
</div>
<br> <br><br><br><br><br><br>
<div id='content'>
<section class='input'>
<div>
<input type="text" name="boy" autocomplete="off">
</div>
</section>
</div>
<br> <br><br> <br>
<a href="javascript:;" onclick="document.getElementById('form1').submit();"> Reveal :P</a>
</form>
<script src='js/fancyInput.js'></script>
<script>
$('section :input').val('').fancyInput()[0].focus();
// Everything below is only for the DEMO
function init(str){
var input = $('section input').val('')[0],
s = 'Who?'.split('').reverse(),
len = s.length-1,
e = $.Event('keypress');
var input1 = $('section input').val('')[1],
s1 = 'Partner?!'.split('').reverse(),
len1 = s1.length-1,
e1 = $.Event('keypress');
var initInterval = setInterval(function(){
if( s.length ){
var c = s.pop();
fancyInput.writer(c, input, len-s.length).setCaret(input);
input.value += c;
//e.charCode = c.charCodeAt(0);
//input.trigger(e);
}
else clearInterval(initInterval);
},150);
var initInterval1 = setInterval(function(){
if( s1.length ){
var c1 = s1.pop();
fancyInput.writer(c1, input1, len1-s1.length).setCaret(input1);
input1.value += c1;
//e.charCode = c.charCodeAt(0);
//input.trigger(e);
}
else clearInterval(initInterval1);
},150);
}
init();
$('menu').on('click', 'button', toggleEffect);
$('menu.radio').on('change', 'input', changeForm).find('input:first').prop('checked',true).trigger('change');
// change effects
function toggleEffect(num){
var className = '';
idx = $(this).index() + 1,
$fancyInput = $('.fancyInput');
if( idx > 1 )
className = 'effect' + idx;
$('#content').prop('class', className);
$fancyInput.find(':input')[0].focus(); $fancyInput.find(':input')[1].focus();
}
function changeForm(e){
// radio buttons stuff
var page = this.value,
highlight = $(e.delegateTarget).find('> div'),
label = $(this.parentNode),
marginLeft = parseInt( label.css('margin-left') , 10 ),
xPos;
highlight.css({'left':label.position().left + marginLeft, 'width':label.width() });
// page change stuff
xPos = '-' + label.index() * 50;
$('#content').css( 'transform', 'translateX(' + xPos + '%)' );
setTimeout(function(){
$('#content').find('.' + page + ' :input')[0].focus();
}, 100);
}
</script>
</body>
</html>