-
Notifications
You must be signed in to change notification settings - Fork 0
/
countdown.html
159 lines (141 loc) · 8.09 KB
/
countdown.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="Ming Media is a game development studio based in Sweden. We create simple fun experiences for the metaverse and have over 900 million play sessions across our titles." />
<title>Next Update - Ming Media</title>
<link rel="canonical" href="https://mingmedia.io/">
<meta property="og:locale" content="en_US">
<meta property="og:site_name" content="Ming Media">
<meta property="og:type" content="website">
<meta property="og:url" content="https://mingmedia.io/">
<meta property="og:image" content="/assets/img/thumbnails/2830250344.png">
<meta property="og:description" content="Ming Media is a game development studio based in Sweden. We create simple fun experiences for the metaverse and have over 900 million play sessions across our titles.">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1080">
<meta property="og:image:type" content="image/png">
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="assets/favicon.png" />
<!-- Font Awesome icons (free version)-->
<script src="https://use.fontawesome.com/releases/v6.1.0/js/all.js" crossorigin="anonymous"></script>
<!-- Google fonts-->
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="css/styles.css" rel="stylesheet" />
</head>
<body id="page-top">
<!-- Navigation-->
<nav class="navbar navbar-expand-lg text-uppercase" id="mainNav">
<div class="container">
<a style="margin: auto;" href="/">
<img class="logo" src="assets/logo.svg">
</a>
<!-- <div class="navbar-collapse collapse" id="navbarResponsive">
<ul class="navbar-nav ms-auto">
<li class="nav-item mx-0 mx-lg-1"><a class="nav-link" href="#games">Games</a></li>
<li class="nav-item mx-0 mx-lg-1"><a class="nav-link" href="#about">About</a></li>
<li class="nav-item mx-0 mx-lg-1"><a class="nav-link" href="#careers">Careers</a></li>
<li class="nav-item mx-0 mx-lg-1"><a class="nav-link" href="#contact">Contact</a></li>
</ul>
</div> -->
</div>
</nav>
<!-- Masthead-->
<header class="text-center thumbnail">
<div class="tag-1 container">
<div class="tag-2">
<div>
<h1>Simple fun</h1>
<h2 id="countdown"></h2>
<a href="https://www.roblox.com/games/920587237" target="_blank" rel="noopener noreferrer" class="play">
<i class="fas fa-play"></i>
</a>
</div>
</div>
</div>
</header>
<!-- Footer-->
<footer class="footer text-center bg-primary">
<div class="container">
<a href="/">
<img style="height: 3rem; margin-bottom: 1.5rem;" src="assets/logo.svg">
</a>
<div class="row">
<!-- Footer Location-->
<!-- Footer Social Icons-->
<div>
<a target="_blank" class="btn btn-dark btn-social mx-1" href="https://twitter.com/MingRBLX"><i class="fab fa-fw fa-twitter"></i></a>
<a target="_blank" class="btn btn-dark btn-social mx-1" href="https://discord.com/invite/pPrq2zt"><i class="fab fa-fw fa-discord"></i></a>
</div>
<!-- Footer About Text-->
</div>
</div>
<div class="copyright container"><small>© 2023 Ming Media. All Rights Reserved.</small></div>
</footer>
<!-- Copyright Section-->
<!-- <div class="copyright py-4 text-center text-white">
<div class="container"><small>© 2023 Ming Media. All Rights Reserved.</small></div>
</div> -->
<!-- Bootstrap core JS-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
// fetch(`https://games.roblox.com/v1/games/multiget-place-details?placeIds=2830250344`, {
// method: 'POST',
// }).then((response) => response.json())
// .then((data) => {
// return data.data[0].id;
// })
// .catch(error => console.warn(error));
// Get time and string from URL query
const urlParams = new URLSearchParams(window.location.search);
const timeParam = urlParams.get('time');
const titleParam = urlParams.get('title');
const placeIdParam = urlParams.get('placeId');
// Change thumbnail
const thumbnail = document.querySelector('.thumbnail');
thumbnail.style.backgroundImage=`url(/assets/img/thumbnails/${placeIdParam}.png)`;
// Change play link
const link = document.querySelector('.play');
link.href = `https://www.roblox.com/games/${placeIdParam}`;
// Convert time parameter to a Unix timestamp in milliseconds
const targetTime = Date.parse(timeParam);
// Select the H1 tag and update its text with the string parameter
const heading = document.querySelector('h1');
heading.textContent = `${titleParam}`;
// Select the element that will display the countdown timer
const countdownDisplay = document.querySelector('#countdown');
// Define a function to update the countdown timer
function updateCountdown() {
// Calculate the time remaining until the target time
const now = new Date();
const remaining = targetTime - now.getTime();
// If the target time has passed, update the display and stop the timer
if (remaining <= 0) {
countdownDisplay.textContent = 'Released!';
clearInterval(timer);
} else {
// Otherwise, convert the remaining time to hours, minutes, and seconds
const hours = Math.floor(remaining / (1000 * 60 * 60));
const minutes = Math.floor((remaining % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((remaining % (1000 * 60)) / 1000);
// Update the display with the remaining time
countdownDisplay.textContent = `${hours} hours ${minutes} minutes ${seconds} seconds`;
}
}
// Call the updateCountdown function once to display the initial countdown
updateCountdown();
// Set up a timer to call the updateCountdown function every second
const timer = setInterval(updateCountdown, 1000);
</script>
<!-- http://127.0.0.1:5500/countdown.html?time=2023-04-01T12:00:00Z&title=Spring%20Festival&placeId=2830250344 -->
<!-- Core theme JS-->
<!-- <script src="js/scripts.js"></script> -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *-->
<!-- * * SB Forms JS * *-->
<!-- * * Activate your form at https://startbootstrap.com/solution/contact-forms * *-->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *-->
<!-- <script src="https://cdn.startbootstrap.com/sb-forms-latest.js"></script> -->
</body>
</html>