-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
169 lines (155 loc) · 5.58 KB
/
index.html
File metadata and controls
169 lines (155 loc) · 5.58 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Open Graph meta tags for rich link previews -->
<meta property="og:site_name" content="Mita">
<meta property="og:title" content="Mita — Anime List">
<meta property="og:description" content="Tap to import this anime list in Mita">
<meta property="og:image" content="https://csct.github.io/mita-link/icon-512.png">
<meta property="og:image:width" content="512">
<meta property="og:image:height" content="512">
<meta property="og:type" content="website">
<meta property="og:url" content="https://csct.github.io/mita-link/">
<!-- Twitter card -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Mita — Anime List">
<meta name="twitter:description" content="Tap to import this anime list in Mita">
<meta name="twitter:image" content="https://csct.github.io/mita-link/icon-512.png">
<!-- Favicon and touch icon -->
<link rel="icon" type="image/png" href="https://csct.github.io/mita-link/icon-512.png">
<link rel="apple-touch-icon" href="https://csct.github.io/mita-link/icon-512.png">
<title>Mita</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #000;
color: #fff;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.container {
text-align: center;
padding: 40px 24px;
max-width: 400px;
}
.icon {
width: 100px;
height: 100px;
border-radius: 22px;
margin-bottom: 24px;
}
.title {
font-size: 24px;
font-weight: 700;
margin-bottom: 8px;
}
.subtitle {
font-size: 16px;
color: #aaa;
margin-bottom: 32px;
}
.list-name {
font-size: 18px;
font-weight: 600;
color: #7c9af8;
margin-bottom: 8px;
}
.list-count {
font-size: 14px;
color: #888;
margin-bottom: 32px;
}
.open-btn {
display: inline-block;
background: #7c9af8;
color: #fff;
text-decoration: none;
padding: 14px 32px;
border-radius: 12px;
font-size: 17px;
font-weight: 600;
margin-bottom: 16px;
}
.open-btn:active { opacity: 0.8; }
.fallback {
font-size: 13px;
color: #666;
}
.fallback a { color: #7c9af8; }
.spinner {
margin-bottom: 16px;
}
.spinner::after {
content: '';
display: inline-block;
width: 24px;
height: 24px;
border: 3px solid #333;
border-top-color: #7c9af8;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#redirect-msg { display: block; }
#fallback-msg { display: none; }
</style>
</head>
<body>
<div class="container">
<img src="icon.png" alt="Mita" class="icon">
<div class="title">Mita</div>
<div class="subtitle">Anime Tracker</div>
<div id="list-info" style="display: none;">
<div class="list-name" id="list-name"></div>
<div class="list-count" id="list-count"></div>
</div>
<div id="redirect-msg">
<div class="spinner"></div>
<p class="subtitle">Opening Mita...</p>
</div>
<div id="fallback-msg">
<a class="open-btn" id="open-link" href="#">Open in Mita</a>
<br><br>
<p class="fallback">Don't have the app? <!-- <a href="https://apps.apple.com/app/mita/idXXXXXX">Get Mita</a> --></p>
</div>
</div>
<script>
// Read query params and build the mita:// deep link
const params = new URLSearchParams(window.location.search);
const name = params.get('name');
const icon = params.get('icon') || 'list.bullet';
const ids = params.get('ids');
const color = params.get('color');
// Show list info if available
if (name) {
document.getElementById('list-info').style.display = 'block';
document.getElementById('list-name').textContent = name;
if (ids) {
const count = ids.split(',').length;
document.getElementById('list-count').textContent = count + ' anime';
}
}
// Build mita:// deep link
let deepLink = 'mita://list?';
const deepParams = new URLSearchParams();
if (name) deepParams.set('name', name);
if (icon) deepParams.set('icon', icon);
if (ids) deepParams.set('ids', ids);
if (color) deepParams.set('color', color);
deepLink += deepParams.toString();
document.getElementById('open-link').href = deepLink;
// Try to open the app immediately
window.location.href = deepLink;
// If still here after 1.5s, show the fallback UI
setTimeout(function() {
document.getElementById('redirect-msg').style.display = 'none';
document.getElementById('fallback-msg').style.display = 'block';
}, 1500);
</script>
</body>
</html>