-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
172 lines (150 loc) · 8.15 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!--DEBUG: code is asynchronous
checkbox on image-click https://stackoverflow.com/questions/30663562/use-images-like-checkboxes
DEBUG: process log, window not defined
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Foto Booth</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://bootswatch.com/4/litera/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./css/facebook-style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://www.promisejs.org/polyfills/promise-7.0.4.min.js"></script>
<!--<script type="text/javascript" src = "facebook-sql.js"></script>-->
<!--<script type="text/javascript" src = "load-facebooksdk.js"></script>-->
<script src="./load-facebooksdk_browserfied.js"></script>
</head>
<body>
<!--NAVIGATION BAR-->
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="#">Foto Booth</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation" style="">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor01">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
</ul>
</div>
</nav>
<!--Home Page Container-->
<div class="jumbotron">
<h1 class="display-3">Foto Booth</h1>
<p class="lead">Simple, seamless, album downloads for the new world.</p>
<hr class="my-4">
<p>Log in with Facebook to download favorite albums in bulk.</p>
<p class="lead">
<a class="btn btn-primary btn-lg" href="about.html" role="button">Learn more</a>
</p>
</div>
<!--INFOBOXES-->
<h1 style="text-align:center;">Your Facebook Photo Hub</h1><br>
<div id = "first container" style = "margin: 0 auto; display:flex; justify-content:center;">
<div class="card text-white bg-primary mb-3" style= "max-width: 20rem; display: inline-block;">
<div class="card-header">Step 1 </div>
<div class="card-body">
<h4 class="card-title">Log in with Facebook</h4>
<p class="card-text">Our website uses Facebook Graph API in order to access your albums and photos.</p>
<p style = "text-align:center;"><img src = "https://upload.wikimedia.org/wikipedia/commons/thumb/0/04/MoA-Facebook.svg/2000px-MoA-Facebook.svg.png" style = "width:75%; height:75%;"></p>
</div>
</div>
<div class="card text-white bg-secondary mb-3" style="max-width: 20rem; display: inline-block; margin-left: 10px;">
<div class="card-header">Step 2</div>
<div class="card-body">
<h4 class="card-title">Album View</h4>
<p class="card-text">Foto Booth queues up all your published albums with their cover photo, all in one space.</p>
<p style = "text-align:center;"><img src = "http://arwebzone.com/wp-content/uploads/2014/03/Download-Facebook-Albums.png" style = "height:100%; width:100%;"></p>
</div>
</div>
<div class="card text-white bg-success mb-3" style="max-width: 20rem; display:inline-block; margin-left: 10px;">
<div class="card-header">Step 3</div>
<div class="card-body">
<h4 class="card-title">Finish</h4>
<p class="card-text">In less than a minute, you've arrived at step 3. Click on the album to zip your photos straight to your computer.</p>
<p style = "text-align:center;"><img src = http://icons.iconarchive.com/icons/dtafalonso/android-lollipop/512/Downloads-icon.png style = "width:50%; height: 50%;"></p>
</div>
</div>
</div>
<h2 style="text-align:center;"> Continue now for stress-free downloads</h2><br>
<script>
overall_albums = null;
//NEXT TO DO: store together into a list, figure out how to download pictures from link
//https://gist.github.com/noelvo/4502eea719f83270c8e9
function displayAlbums(){
all_albums = [
{
'name':'Timeline Photos',
'cover_photo':'https://scontent-ort2-2.xx.fbcdn.net/v/t1.0-9/17634303_1874239819532514_8644146369447400144_n.jpg?oh=43c6ce933433d0a7519d0baaa2c51113&oe=5AFBF414',
'photos':['https://scontent-ort2-2.xx.fbcdn.net/v/t1.0-9/17634303_1874239819532514_8644146369447400144_n.jpg?oh=43c6ce933433d0a7519d0baaa2c51113&oe=5AFBF414','https://scontent-ort2-2.xx.fbcdn.net/v/t1.0-9/16473715_1847863328836830_6571888747179362375_n.jpg?oh=6e496b8a76d4e034fb33d11a38c5c1f5&oe=5AFE2992' ],
},
{
'name':'Cover Photos',
'cover_photo':'https://scontent-ort2-2.xx.fbcdn.net/v/t1.0-9/16473715_1847863328836830_6571888747179362375_n.jpg?oh=6e496b8a76d4e034fb33d11a38c5c1f5&oe=5AFE2992',
'photos':[],
},
{
'name': 'Featured Photos',
'cover_photo': 'https://scontent-iad3-1.xx.fbcdn.net/v/t1.0-9/13450177_1731852527104578_4902045573470892246_n.jpg?oh=2fa0aa056d483364a8460630bd32e927&oe=5AFE0EAA',
'photos': []
},
{
'name': 'Profile Pictures',
'cover_photo': 'https://scontent-iad3-1.xx.fbcdn.net/v/t31.0-8/18278917_1894589447497551_4159261863597356989_o.jpg?oh=c95f39bbff0d9c7b9f95a23b74dbfabd&oe=5AF0FA2A',
'photos': []
}
]
//all_albums = getAlbums();
for(var index = 0; index < all_albums.length; index++){
document.getElementById('albumDisplay').innerHTML += '<input type="checkbox" id="myCheckbox'+index+'" /><label for="myCheckbox'+index+'"><img class = "album-display" id = "img_' + index + '" src="'+all_albums[index].cover_photo+'"></label>'
}
document.getElementById("downloadButtons").style = "display:flex; justify-content:center";
overall_albums = all_albums;
}
function downloadSelectedURLS(){
var urls = []
var checkboxes = $("div :checkbox")
for(var i = 0; i < checkboxes.length; i++){
if(checkboxes[i].checked){
coverphotolink = document.getElementById("img_" + i).src
for(var j = 0; j < all_albums.length; j++){
if(all_albums[j].cover_photo == coverphotolink){
urls.concat(all_albums[j].photos);
}
}
}
}
downloadPhotos(urls);
}
function downloadAllURLS(){
var urls = []
for(var j = 0; j < all_albums.length; j++){
urls.concat(all_albums[j].photos);
}
downloadPhotos(urls);
}
</script>
<div style = "margin: 0 auto; display:flex; justify-content:center;">
<div class="fb-login-button" id = "fb-login-button" scope= "public_profile,email,user_photos" data-max-rows="1" data-size="large" data-button-type="login_with" data-show-faces="false" data-auto-logout-link="true" data-use-continue-as="true" onlogin = "checkLoginState();"></div>
</div>
<button id = "beginPics" type="button" class="btn btn-primary btn-lg btn-block" style = "display:none;" onclick = "displayAlbums();">Click to Display Albums</button><br>
<div id = "welcomeBack"></div>
<div id = albumDisplay style = "display:flex; justify-content:center;"> </div>
<div id = "downloadButtons" style = "display:none;">
<button type="button" class="btn btn-secondary" onclick = "downloadSelectedURLS();">Download Selected</button>
<button type="button" class="btn btn-secondary" onlick = "downloadAllURLS();" style = "margin-left: 10px;">Download All Photos</button>
</div>
<div id = "footerpad" style = "padding-bottom:10%;"></div>
</body>
</html>