-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
79 lines (63 loc) · 3.6 KB
/
index.php
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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="preconnect" href="//cdnjs.cloudflare.com" crossorigin="anonymous">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Identify Browser, Browser Size and Screen Size | What device am I using?</title>
<meta name="Description" content="Identify screen size, viewport, browser and device information instantly. *Click to COPY to clipboard!* and send to your web developer. 'What device am I using' is perfect for debugging problems remotely with clients.">
<meta property="og:title" content="What device am I using?">
<meta property="og:site_name" content="The Two Percent">
<meta property="og:url" content="https://debug.thetwopercent.co.uk">
<meta property="og:description" content="Identify screen size, viewport, browser and device information. *Click to COPY to clipboard!* What device am I using is perfect for debugging problems remotely with clients.">
<meta property="og:type" content="article">
<meta property="og:image" content="https://debug.thetwopercent.co.uk/what-device.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@thetwopct">
<meta name="twitter:title" content="What device am I using?">
<meta name="twitter:description" content="Instantly get screen size, viewport, browser and device information. *Click to COPY to clipboard!* What device am I using is perfect for debugging problems remotely with clients.">
<meta name="twitter:image" content="https://debug.thetwopercent.co.uk/what-device.png">
<meta name="twitter:image:alt" content="Never ask - What device are you using? - EVER again">
<link rel='stylesheet' href='styles.css' type='text/css' media='all' />
<link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css' type='text/css' media='all' crossorigin="anonymous" />
</head>
<body>
<?php
// get user agent info.
$user_agent = $_SERVER['HTTP_USER_AGENT'];
// set everything up.
require_once 'identification.php';
$user_os = getOS2($user_agent);
$user_browser = getBrowser($user_agent);
$user_browser_version = getBrowserVersion($user_agent);
?>
<div class='debug-container' id='debug'>
<h2>Device Debug</h2>
<ul class="debug-details">
<li><strong>Screen Width: </strong><span class="screen-width"></span></li>
<li><strong>Screen Height: </strong><span class="screen-height"></span></li>
<li><strong>Viewport Width: </strong><span class="viewport-width"></span></li>
<li><strong>Viewport Height: </strong><span class="viewport-height"></span></li>
<?php
if ($user_browser) {
echo '<li><strong>Browser: </strong>' . $user_browser . ' ' . $user_browser_version . '</li>';
}
if ($user_os) {
echo '<li><strong>Operating System: </strong>' . $user_os . '</li>';
}
echo '<li><strong>Raw Browser Info: ' . $user_agent . '</strong></li>';
?>
</ul>
</div>
<div class="fixed-header">
Click the info to copy to your clipboard. <br class="hide">Paste the info when giving feedback on projects.
</div>
<div class="fixed-footer">
<a href="https://www.thetwopercent.co.uk" rel="noopener" target="_blank">Made by The Two Percent</a> - <a href="https://github.com/thetwopct/device-debug" rel="noopener" target="_blank">Find this on Github</a>
</div>
</body>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" crossorigin="anonymous"></script>
<script src="browser.js"></script>
<script defer src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js" crossorigin="anonymous"></script>
</html>