-
Notifications
You must be signed in to change notification settings - Fork 0
/
you6.html
183 lines (174 loc) · 5.64 KB
/
you6.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html>
<html>
<head>
<title>For You</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://use.typekit.net/znk3xkz.css">
</head>
<body class="questions">
<!-- header -->
<img src="images/menu.png" width="100%">
<!-- header -->
<!-- questions -->
<div class="youquestion6">
<img src="images/q10.png" width="15%" class="qcount">
<p class="questiontitle">What dress length do you prefer?</p>
<figure>
<img src="images/length3.png" width="80%" class="imgselection" onclick="chooseDressLength('short')" id="dressShort">
<figcaption>Short</figcaption>
</figure>
<figure>
<img src="images/length2.png" width="80%" class="imgselection" onclick="chooseDressLength('medium')" id="dressMedium">
<figcaption>Medium</figcaption>
</figure>
<figure>
<img src="images/length1.png" width="80%" class="imgselection" onclick="chooseDressLength('long')" id="dressLong">
<figcaption>Long</figcaption>
</figure>
<br>
<p class="questiontitle2">What sleeve length do you prefer?</p>
<figure>
<img src="images/length4.png" width="100%" class="imgselection" onclick="chooseSleeve('short')" id="sleeveShort">
<figcaption>Short</figcaption>
</figure>
<figure>
<img src="images/length5.png" width="100%" class="imgselection" onclick="chooseSleeve('medium')" id="sleeveMedium">
<figcaption>Medium</figcaption>
</figure>
<figure>
<img src="images/length6.png" width="100%" class="imgselection" onclick="chooseSleeve('long')" id="sleeveLong">
<figcaption>Long</figcaption>
</figure>
<br>
<!-- <a href="you5.html"><button class="stylebutton">back ›</button></a> -->
<!-- <button class="stylebutton" onclick="getLength()">discover now ›</button> -->
<img src="images/done.png" class="done" onclick="getLength()" width="14%">
</div>
<!-- questions -->
<script>
function getLength(){
len = []
if(dressLength!=null)
len.push(dressLength)
if(sleeveLength!=null)
len.push(sleeveLength)
if(typeof(Storage) !== "undefined") {
//sessionStorage.len = null
if(len.length!=0)
sessionStorage.len = len;
} else {
document.getElementByClass("youquestion6").innerHTML = "Sorry, your browser does not support web storage...";
}
console.log(sessionStorage.len);
window.open("results.html", "_self");
}
dressLength = null
dressShort = false
dressMedium = false
dressLong = false
sleeveLength = null
sleeveShort = false
sleeveMedium = false
sleeveLong = false
if(sessionStorage.len!=null){
if(sessionStorage.len.indexOf('tshort')>=0){
dressShort = true;
dressLength = "tshort"
document.getElementById("dressShort").style.WebkitAnimation = "imageselection 0.6s ease infinite";
}
if(sessionStorage.len.indexOf('tmedium')>=0){
dressMedium = true;
dressLength = "tmedium"
document.getElementById("dressMedium").style.WebkitAnimation = "imageselection 0.6s ease infinite";
}
if(sessionStorage.len.indexOf('tlong')>=0){
dressLong = true;
dressLength = "tlong"
document.getElementById("dressLong").style.WebkitAnimation = "imageselection 0.6s ease infinite";
}
if(sessionStorage.len.indexOf('sshort')>=0){
sleeveShort = true;
sleeveLength = "sshort"
document.getElementById("sleeveShort").style.WebkitAnimation = "imageselection 0.6s ease infinite";
}
if(sessionStorage.len.indexOf('smedium')>=0){
sleeveMedium = true;
sleeveLength = "smedium"
document.getElementById("sleeveMedium").style.WebkitAnimation = "imageselection 0.6s ease infinite";
}
if(sessionStorage.len.indexOf('slong')>=0){
sleeveLong = true;
sleeveLength = "slong"
document.getElementById("sleeveLong").style.WebkitAnimation = "imageselection 0.6s ease infinite";
}
}
function chooseDressLength(val) {
dressLength = null
document.getElementById("dressShort").style.WebkitAnimation= "";
document.getElementById("dressMedium").style.WebkitAnimation= "";
document.getElementById("dressLong").style.WebkitAnimation= "";
if(val=="short"){
dressShort = !dressShort
if(dressShort){
dressMedium = false
dressLong = false
dressLength = "tshort"
document.getElementById("dressShort").style.WebkitAnimation = "imageselection 0.6s ease infinite";
}
}
if(val=="medium"){
dressMedium = !dressMedium
if(dressMedium){
dressShort = false
dressLong = false
dressLength = "tmedium"
document.getElementById("dressMedium").style.WebkitAnimation = "imageselection 0.6s ease infinite";
}
}
if(val=="long"){
dressLong=!dressLong
if(dressLong){
dressShort = false
dressMedium = false
dressLength = "tlong"
document.getElementById("dressLong").style.WebkitAnimation = "imageselection 0.6s ease infinite";
}
}
}
function chooseSleeve(val) {
sleeveLength = null
document.getElementById("sleeveShort").style.WebkitAnimation = "";
document.getElementById("sleeveMedium").style.WebkitAnimation = "";
document.getElementById("sleeveLong").style.WebkitAnimation = "";
if(val=="short"){
sleeveShort = !sleeveShort
if(sleeveShort){
sleeveMedium = false
sleeveLong = false
sleeveLength = "sshort"
document.getElementById("sleeveShort").style.WebkitAnimation = "imageselection 0.6s ease infinite";
}
}
if(val=="medium"){
sleeveMedium = !sleeveMedium
if(sleeveMedium){
sleeveShort = false
sleeveLong = false
sleeveLength = "smedium"
document.getElementById("sleeveMedium").style.WebkitAnimation = "imageselection 0.6s ease infinite";
}
}
if(val=="long"){
sleeveLong=!sleeveLong
if(sleeveLong){
sleeveShort = false
sleeveMedium = false
sleeveLength = "slong"
document.getElementById("sleeveLong").style.WebkitAnimation = "imageselection 0.6s ease infinite";
}
}
}
</script>
</body>
</html>