-
Notifications
You must be signed in to change notification settings - Fork 36
/
index.html
210 lines (197 loc) · 7.2 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script
src="https://kit.fontawesome.com/72fc4d72f1.js"
crossorigin="anonymous"
></script>
<link href="https://fonts.googleapis.com/css2?family=Bangers&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles/normalize.css" />
<link rel="stylesheet" href="styles/styles.css" />
<script src="scripts/scripts.js" defer></script>
<title>Giphy Search | @lcrojano</title>
</head>
<body class="flex-col align-items-center">
<div id="github-link">
<a href="https://github.com/lcrojano/Giphy_Explorer" target="_blank">
<img src="assets/images/github-mark-white.png" alt="GitHub" />
<h1>Fork Me</h1>
</a>
</div>
<section class="modal" id="modal-overlay">
<div class="share-modal">
<div class="share-head">
<h2>Share GIF</h2>
<i class="fa-solid fa-x" id="close"></i>
</div>
<ul class="social-links">
<li><i id="share-fb" class="fa-brands fa-square-facebook"></i></li>
<li>
<i id="share-twitter" class="fa-brands fa-square-twitter"></i>
</li>
<!-- <li><i id="share-insta" class="fa-brands fa-square-instagram"></i></li> -->
<!-- not possible due to instagram api restrictions -->
<li>
<i id="share-pinterest" class="fa-brands fa-square-pinterest"></i>
</li>
</ul>
<button id="copy" class="secondary-btn copy-btn">Copy Link</button>
</div>
</section>
<section class="container flex-col justify-content-center">
<button onclick="topFunction()" id="myBtn" title="Go to top">
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="feather feather-arrow-up"
>
<line x1="12" y1="19" x2="12" y2="5"></line>
<polyline points="5 12 12 5 19 12"></polyline>
</svg>
</button>
<header
class="flex-row justify-content-btw align-items-center headerdata"
>
<div>
<a href="https://lcrojano.github.io/Giphy_Explorer/" class="logo-link">
<h1 class="grow-2" id="logo">Giphy Search</h1>
</a>
<caption style="font-family: 'Patrick Hand', cursive; font-weight: bolder;">
By Luis Rojano
</caption>
</div>
<div style="display: flex">
<button class="secondary-btn">
<a href="login.html" style="text-decoration: none; color: inherit;">Log In</a>
</button>
<!-- Add this button to trigger the modal for uploading GIFs -->
<button
id="upload-button"
class="secondary-btn upload-btn"
style="margin-left: 15px; font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; font-weight: bolder;"
>
Upload GIF
</button>
<!-- Add a hidden input element for file selection -->
<input
type="file"
id="file-upload"
accept=".gif"
style="display: none"
/>
</div>
</header>
<section
class="flex-col justify-content-center stickysearchbar"
id="searchbar"
>
<div class="flex-row justify-content-btw align-items-center">
<input
class="grow-2 sticky"
type="search"
name="search"
id="search"
placeholder="Search GIF here"
/>
<button id="search-btn" class="primary-btn">
<img
src="https://giphy.com/static/img/search-icon.svg"
width="30"
/>
</button>
<button id="toggle" class="primary-btn" onClick="toggleLightDark()">
<img
id="toggle-image"
src="./assets/images/lightLamp.svg"
alt="https://www.flaticon.com/free-icons/electronics"
width="30"
/>
</button>
<button id="fav-btn" class="primary-btn">
<a href="./favs.html">
<img src="./assets/images/heart.png" alt="favorites" width="30" />
</a>
</button>
</div>
</section>
<!-- Update the modal for sharing GIFs -->
<section class="modal" id="modal-overlay">
<div class="share-modal">
<div class="share-head">
<h2>Share GIF</h2>
<i class="fa-solid fa-x" id="close"></i>
</div>
<ul class="social-links">
<li><i class="fa-brands fa-square-facebook"></i></li>
<li><i class="fa-brands fa-square-twitter"></i></li>
<li><i class="fa-brands fa-square-instagram"></i></li>
<li><i class="fa-brands fa-square-pinterest"></i></li>
</ul>
<button id="copy" class="secondary-btn copy-btn" style="margin-bottom: 10px;">Copy Link</button>
</div>
</section>
<section
class="flex-row justify-content-btw align-items-center searchtermdata"
>
<div class="flex-col">
<strong id="search-term">GATOS</strong>
<span id="">2000</span>
</div>
<nav>
<menu id="history" class="flex-row tag-menu" ></menu>
</nav>
</section>
<main>
<div
id="gifs-list"
class="flex-row flex-wrap justify-content-center"
></div>
</main>
</section>
<aside></aside>
<script type="text/javascript">
mybutton = document.getElementById('myBtn');
logo = document.getElementById('logo');
searchbar = document.getElementById('searchbar');
// Indicate scroll down or scroll up
var scrollBefore = 0;
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function () {
scrollFunction();
};
function scrollFunction() {
const scrolled = window.scrollY;
if (window.pageYOffset > 50 && scrollBefore < window.scrollY) {
mybutton.style.display = 'block';
logo.classList.add('fixedlogo', 'show');
logo.classList.remove('logo');
searchbar.classList.remove('stickysearchbar');
searchbar.classList.add('fixedsearchbar');
scrollBefore = scrolled;
} else if (window.pageYOffset < 50) {
scrollBefore = window.scrollY;
mybutton.style.display = 'none';
searchbar.classList.add('stickysearchbar');
searchbar.classList.remove('fixedsearchbar');
logo.classList.remove('fixedlogo', 'show');
logo.classList.add('logo');
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0; // For Safari
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
}
</script>
</body>
</html>