-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
302 lines (275 loc) · 12.7 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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Kōdan, make your own anime</title>
<meta name="description" content="Kōdan is a tool to build your own anime using only your mind & your keyboard.">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://kodan.app/">
<meta property="og:title" content="Kōdan, make your own anime">
<meta property="og:description" content="Kōdan is a tool to build your own anime using only your mind & your keyboard.">
<meta property="og:image" content="./kodanCar.png">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://kodan.app/">
<meta property="twitter:title" content="Kōdan, make your own anime">
<meta property="twitter:description" content="Kōdan is a tool to build your own anime using only your mind & your keyboard.">
<meta property="twitter:image" content="./kodanCar.png">
<link rel="stylesheet" href="styles.css">
<style>
body {
margin: 0;
overflow: hidden;
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-image: url('./kodanPurple.png');
background-size: cover;
background-position: center;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
#backgroundOverlay {
position: fixed;
top: 0;
opacity: 0;
left: 0;
pointer-events: none;
width: 100%;
height: 100%;
background-color: rgb(255, 0, 0);
mix-blend-mode: saturation;
transition: opacity 0.5s ease-out;
}
#scrollImage {
transition: bottom 0.5s ease-out;
bottom: -50%; /* Start half off-screen */
position: fixed;
left: 50%;
transform: translateX(-50%);
max-width: 700px;
width: 100%;
}
#mainContent {
transition: transform 0.5s ease-out;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
#overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.6);
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
visibility: hidden;
transition: opacity 0.5s ease, visibility 0.5s;
}
#overlayContent {
background-color: white;
padding: 16px;
border-radius: 10px;
max-width: 560px;
width: 100%;
font-size: 24px;
font-weight: bold;
opacity: 0;
transform: translateY(20px);
transition: opacity 0.5s ease, transform 0.5s ease;
}
.hidden {
display: none !important;
pointer-events: none;
}
.fade-in {
opacity: 1 !important;
visibility: visible !important;
}
.fade-in #overlayContent {
opacity: 1 !important;
transform: translateY(0) !important;
}
#downloadButton {
background-color: black;
color: white;
border: none;
width: 100%;
font-size: 18px;
font-weight: 500;
padding: 12px 0;
border-radius: 12px;
cursor: pointer;
transition: transform 0.1s ease-out, background-color 0.3s, color 0.3s, border 0.3s;
}
#downloadButton:active {
transform: scale(0.95);
}
#downloadButton.clicked {
background-color: #fff;
color: #000;
border: 1px solid #000;
}
</style>
</head>
<body>
<div id="backgroundOverlay"></div>
<div id="mainContent">
<img style="width: 200px; height: 200px" src="kodanLogo.png"/>
<h1 style="font-size: 52px; max-width: 100%; text-align: center; font-weight: 500; color: #fff">Make Your Own Anime</h1>
<button id="alphaButton" style="border: 1px solid #000; cursor: pointer; font-weight: 500; font-size: 18px; background-color: #fff; color: #000; padding: 16px; border-radius: 12px;"> Alpha for macOS</button>
</div>
<img id="scrollImage" src="./cupsOfCoffee.png">
<div id="overlay" class="hidden">
<div style="display: flex; flex-direction: column; gap: 16px" id="overlayContent">
<h1 style="margin: 0; font-size: 38px; font-weight: 500;">Kōdan v0.1 alpha</h1>
<div>
<p style="font-size: 18px; font-weight: 500; margin: 0">email address</p>
<input id="emailInput" style="border: 1px solid #000; width: calc(100% - 32px); font-size: 18px; padding: 8px 12px; border-radius: 12px;" placeholder="[email protected]" required/>
</div>
<div style="display: flex; align-items: center;">
<input type="checkbox" checked style="appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border: 1px solid #000; border-radius: 8px; cursor: pointer; outline: none; background-color: #817CF0; margin-right: 10px;" onchange="this.style.backgroundColor = this.checked ? '#817CF0' : 'transparent'">
<p style="font-size: 14px; font-weight: normal; margin: 0;">I want weekly Kōdan updates / anime from Dieter (co-founder)</p>
</div>
<button id="downloadButton" style="background-color: black; border: none; color: white; width: 100%; font-size: 18px; font-weight: 500; padding: 12px 0; border-radius: 12px; cursor: pointer;">Send Download</button>
<a href="https://github.com/serenityux/local-kodan" style="font-size: 14px; font-weight: normal; margin: 0; width: 100%; text-align: center;">Kōdan v0.1 alpha is fully open-source on GitHub</a>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const scrollImage = document.getElementById('scrollImage');
const mainContent = document.getElementById('mainContent');
const backgroundOverlay = document.getElementById('backgroundOverlay');
backgroundOverlay.style.opacity = 0;
let simulatedScrollY = 0;
const maxScroll = window.innerHeight; // Simulate one page height of scrolling
function updatePositions() {
const scrollPercentage = simulatedScrollY / maxScroll;
const bottomPosition = Math.max(-50, Math.min(0, -50 + scrollPercentage * 100)); // Range from -50% to 0%
scrollImage.style.bottom = `${bottomPosition}%`;
// Move the main content up, but less than before
const mainContentTranslation = Math.min(20, scrollPercentage * 40); // Max 25vh up
mainContent.style.transform = `translateY(-${mainContentTranslation}vh)`;
// Adjust background saturation
backgroundOverlay.style.opacity = scrollPercentage;
}
window.addEventListener('wheel', (event) => {
simulatedScrollY += event.deltaY;
simulatedScrollY = Math.max(0, Math.min(simulatedScrollY, maxScroll));
updatePositions();
});
// For touch devices
let touchStartY;
window.addEventListener('touchstart', (event) => {
touchStartY = event.touches[0].clientY;
});
window.addEventListener('touchmove', (event) => {
const touchY = event.touches[0].clientY;
const deltaY = touchStartY - touchY;
simulatedScrollY += deltaY;
simulatedScrollY = Math.max(0, Math.min(simulatedScrollY, maxScroll));
updatePositions();
touchStartY = touchY;
});
const alphaButton = document.getElementById('alphaButton');
const overlay = document.getElementById('overlay');
alphaButton.addEventListener('click', () => {
overlay.classList.remove('hidden');
setTimeout(() => {
overlay.classList.add('fade-in');
}, 10);
});
// New code for fading out the overlay
overlay.addEventListener('click', (event) => {
if (event.target === overlay) {
overlay.classList.remove('fade-in');
setTimeout(() => {
overlay.classList.add('hidden');
}, 500); // Wait for the fade-out transition to complete
}
});
const emailInput = document.getElementById('emailInput');
const downloadButton = document.getElementById('downloadButton');
const downloadLink = 'https://elasticbeanstalk-us-east-2-550315364459.s3.us-east-2.amazonaws.com/Kodan-1.0.0-arm64.dmg';
function validateEmail(email) {
const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return re.test(email);
}
function updateDownloadButton() {
if (validateEmail(emailInput.value)) {
downloadButton.style.opacity = '1';
downloadButton.style.cursor = 'pointer';
downloadButton.disabled = false;
} else {
downloadButton.style.opacity = '0.5';
downloadButton.style.cursor = 'not-allowed';
downloadButton.disabled = true;
}
}
emailInput.addEventListener('input', updateDownloadButton);
downloadButton.addEventListener('click', async (e) => {
e.preventDefault();
if (!validateEmail(emailInput.value)) {
emailInput.reportValidity();
} else {
// Add press down effect
downloadButton.classList.add('clicked');
// Send JSON POST request
const data = {
email: emailInput.value
};
try {
const response = await fetch('https://www.serenidad.click/newsletter', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data)
});
if (response.ok) {
downloadButton.textContent = 'Check your inbox & spam';
downloadButton.style.backgroundColor = "#fff";
downloadButton.style.color = "#000";
downloadButton.style.border = "1px solid #000";
// Trigger the download
const a = document.createElement('a');
a.href = downloadLink;
a.download = '';
a.style.display = 'none';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
downloadButton.disabled = true;
} else {
console.error('Failed to submit email');
// Revert button style if submission fails
downloadButton.classList.remove('clicked');
}
} catch (error) {
console.error('Error:', error);
// Revert button style if there's an error
downloadButton.classList.remove('clicked');
}
}
});
// Add touch start and end events for mobile devices
downloadButton.addEventListener('touchstart', () => {
downloadButton.style.transform = 'scale(0.95)';
});
downloadButton.addEventListener('touchend', () => {
downloadButton.style.transform = 'scale(1)';
});
updateDownloadButton(); // Initial state
});
</script>
</body>
</html>