-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
205 lines (195 loc) · 13 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
<!DOCTYPE html>
<html lang="en-us" dir="ltr" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="preconnect" href="https://mc.yandex.ru" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://mc.yandex.ru" />
<title>DeviceInfo.cc | Device information for site feedback</title>
<meta name="description" content="Have you recently stumbled on an issue with one of the sites you regularly visit? Would you like to suggest an improvement perhaps? Contact the site, describe the issue and share your device's information easily & anonymously using this web application. Your IP is never shared." />
<meta name="keywords" content="device info, device information, device details, browser info, browser information, browser details, what is my browser, site feedback" />
<meta property="og:url" content="https://deviceinfo.cc" />
<meta property="og:type" content="website" />
<meta property="og:title" content="DeviceInfo.cc | Device information for site feedback" />
<meta property="og:description" content="Have you recently stumbled on an issue with one of the sites you regularly visit? Would you like to suggest an improvement perhaps? Contact the site, describe the issue and share your device's information easily & anonymously using this web application. Your IP is never shared." />
<meta property="og:image" content="https://deviceinfo.cc/assets/social/20220304.png" />
<meta property="og:image:alt" content="DeviceInfo.cc | Device information for site feedback" />
<meta name="image" content="https://deviceinfo.cc/assets/social/20220304.png" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="DeviceInfo.cc | Device information for site feedback" />
<meta name="twitter:description" content="Have you recently stumbled on an issue with one of the sites you regularly visit? Would you like to suggest an improvement perhaps? Contact the site, describe the issue and share your device's information easily & anonymously using this web application. Your IP is never shared." />
<meta name="twitter:image" content="https://deviceinfo.cc/assets/social/20220304.png" />
<meta name="twitter:image:alt" content="DeviceInfo.cc | Device information for site feedback" />
<link rel="icon" href="./assets/favicon/favicon.ico" sizes="any" />
<link rel="icon" href="./assets/favicon/favicon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="./assets/favicon/apple-touch-icon.png" />
<link rel="manifest" href="./assets/favicon/site.webmanifest" />
<style>
body {font-family:Helvetica, Arial, sans-serif;line-height:130%;margin:0;padding:0;background:#fafafa;border-top:3px solid #6528c1;}
a {color:#6528c1;}
a:hover {color:#b182f7;}
p {padding:5px 0;margin:0;font-size:0.88rem;}
ul {list-style:none;padding:5px 0;margin:0;}
ul li {padding:5px 0 10px;margin:0;line-height:150%;}
h1, h2, h3, h4 {line-height:120%;padding:5px 0;margin:0;}
h1 {background:url(./assets/svg/laptop.svg) no-repeat 0 50%;background-size:30px 30px;line-height:1;padding:0 0 0 45px;margin-bottom:15px;}
h2 {padding:0 0 5px;margin:0 0 10px;border-bottom:2px solid #dadada;line-height:120%;}
h3 {font-size:0.94rem;font-weight:normal;}
button {background:#6528c1;color:#fff;padding:5px 15px;border-radius:5px;border:0;font-size:0.9rem;line-height:150%;cursor:pointer;}
.container {max-width:1200px;padding:0 15px;margin:0 auto;}
header {margin:0;padding:15px;text-align:right;}
header a {display:inline-block;}
main {display:grid;grid-template-columns:1fr 3fr;grid-gap:30px;margin:0 0 15px;}
.about {display:grid;grid-template-columns:1fr;grid-template-rows:auto auto 100%;grid-gap:15px;align-items:start;padding:15px;}
.about .info p {font-size:0.8rem;color:#606060;}
.about .copy,
.about .share {padding:15px 0;display:grid;grid-template-columns:1fr;grid-gap:5px;align-items:center;border-top:2px solid #dadada;}
.details {background:#fff;padding:15px;border-radius:10px;box-shadow:0 5px 10px rgba(0,0,0,0.2);}
#device {margin-bottom:15px;}
footer {padding:15px;}
footer p {color:#909090;font-size:0.8rem;text-align:center;}
@media only screen and (max-width:768px) {
ul li b {display:block;}
h1 {background:url(./assets/svg/phone.svg) no-repeat 0 50%;background-size:contain;}
h2 {font-size:1.4rem;}
header {padding:15px 15px 5px;}
main {grid-template-columns:1fr;}
.about {grid-template-rows:auto auto auto;grid-gap:0;}
.about .copy p,
.about .share p {padding:0;}
}
</style>
</head>
<body>
<div class="container">
<header>
<a href="https://deviceinfo.gr">Ελληνικά</a>
</header>
<main>
<div class="about">
<div class="info">
<h1>DeviceInfo.cc</h1>
<p>Have you recently stumbled on an issue with one of the sites you regularly visit? Would you like to suggest an improvement perhaps? Contact the site, describe the issue and share your device's information easily & anonymously using this web application. Your IP is never shared.</p>
</div>
<div class="copy">
<p>Copy your device info in plain text (e.g. for sharing in an email)</p>
<div>
<button id="copyInfo">COPY INFO</button>
</div>
</div>
<div class="share">
<p>Get a URL containing your device info which you can then share with others</p>
<div>
<button id="copyLink">COPY URL</button>
</div>
</div>
</div>
<div class="details">
<h2>Your Device Info</h2>
<div id="device"></div>
<h2>Your IP & Location</h2>
<div id="iplocation"></div>
</div>
</main>
<footer>
<p>Last Update: 28/02/2022 (v1.0) - Report issues or suggest improvements on the project's <a rel="noopener" title="Feedback for DeviceInfo.cc" target="_blank" href="https://github.com/kodeka/deviceinfo.cc/issues">GitHub Issues</a>.</p>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/ua-parser-js@1.0.2/src/ua-parser.min.js"></script>
<script>
function copyToClipboard(str) {
var el = document.createElement('textarea');
el.value = str;
el.setAttribute('readonly', '');
el.style.position = 'absolute';
el.style.left = '-9999px';
document.body.appendChild(el);
var selected = (document.getSelection().rangeCount > 0) ? document.getSelection().getRangeAt(0) : false;
el.select();
document.execCommand('copy');
document.body.removeChild(el);
if (selected) {
document.getSelection().removeAllRanges();
document.getSelection().addRange(selected);
}
}
// Get current date & time (as timestamp)
var d = new Date();
var month = ((d.getMonth() + 1) < 10 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1));
var timestamp = d.getFullYear() + '' + month + '' + d.getDate() + '' + d.getHours() + '' + d.getMinutes() + '' + d.getSeconds();
// Check for shareable device info
var deviceFromUrl, locationFromUrl;
var qs = window.location.search;
if (qs.indexOf('?info=') > -1) {
var urlParams = new URLSearchParams(qs);
deviceFromUrl = JSON.parse(decodeURIComponent(urlParams.get('info')));
locationFromUrl = decodeURIComponent(urlParams.get('location'));
}
// Device
var parser = new UAParser();
var device = parser.getResult();
device.screensize = window.screen.width + ' x ' + window.screen.height;
device.browsersize = window.innerWidth + ' x ' + window.innerHeight;
if (deviceFromUrl) {
device = deviceFromUrl;
}
var deviceDetails = {
'Browser Name': device.browser.name,
'Browser Version': device.browser.version,
'Operating System': device.os.name,
'Operating System Version': device.os.version,
'Screen Size': device.screensize,
'Browser Window Size': device.browsersize,
'User Agent': device.ua
}
var devContainer = document.getElementById('device');
var devProps = [];
for (var key in deviceDetails) {
devProps.push('<li>' + key + ': <b>' + (deviceDetails[key] ? deviceDetails[key].replace(/(<([^>]+)>)/gi, '') : '') + '</b></li>');
}
devContainer.innerHTML = '<ul>' + devProps.join('') + '</ul>';
// IP - Location
var ipLocContainer = document.getElementById('iplocation');
var ipLocProps = [];
if (locationFromUrl) {
ipLocProps.push('<li id="location">Location: <b>' + locationFromUrl.replace(/(<([^>]+)>)/gi, '') + '</b></li>');
ipLocContainer.innerHTML = '<ul>' + ipLocProps.join('') + '</ul>';
} else {
fetch('https://ipv4.myip.wtf/json').then(response => response.json()).then(function(data) {
var location = data.YourFuckingLocation.split(',')[0] + ', ' + data.YourFuckingCountryCode;
ipLocProps.push('<li>IP Address: <b>' + data.YourFuckingIPAddress + '</b></li>');
ipLocProps.push('<li>ISP: <b>' + data.YourFuckingISP + '</b></li>');
ipLocProps.push('<li id="location">Location: <b>' + location + '</b></li>');
ipLocContainer.innerHTML = '<ul>' + ipLocProps.join('') + '</ul>';
});
}
// Copy device info
document.getElementById('copyInfo').onclick = function(e) {
var devInfo = document.getElementById('device');
var devInfoAsText = devInfo.innerText || devInfo.textContent;
var locInfo = document.getElementById('location');
var locInfoAsText = locInfo.innerText || locInfo.textContent;
copyToClipboard(devInfoAsText + '\n' + locInfoAsText + '\nDevice Information Source: https://deviceinfo.cc');
alert('Your device information is now copied to the clipboard.\n\nYou can paste this information in your message to the site owners you wish to contact and provide feedback.');
}
// Copy shareable URL
document.getElementById('copyLink').onclick = function(e) {
var locInfo = document.getElementById('location').getElementsByTagName('b')[0];
var locInfoAsText = locInfo.innerText || locInfo.textContent;
var currentUrl = window.location.href;
if (currentUrl.indexOf('?') > -1) {
currentUrl = currentUrl.split('?')[0];
}
var link = currentUrl + '?info=' + encodeURIComponent(JSON.stringify(device)) + '&location=' + encodeURIComponent(locInfoAsText);
copyToClipboard(link);
alert('Your device information has been copied into a shareable URL.\n\nYou can paste this URL in your message to the site owners you wish to contact and provide feedback.');
}
</script>
<!-- Yandex.Metrika counter -->
<script type="text/javascript">(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://cdn.jsdelivr.net/npm/yandex-metrica-watch/tag.js", "ym");ym(87657634, "init", {clickmap:false,trackLinks:true, accurateTrackBounce:false,trackHash:true});</script>
<noscript><div><img src="https://mc.yandex.ru/watch/87657634" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
</body>
</html>