Add disappointment.
This commit is contained in:
parent
64f30b0cbb
commit
27f5836e07
9 changed files with 19 additions and 226 deletions
|
@ -6,7 +6,6 @@ use Misuzu\Controllers\UserController;
|
|||
|
||||
return [
|
||||
Route::get('/', 'index', HomeController::class),
|
||||
Route::get('/is_ready', 'isReady', HomeController::class),
|
||||
|
||||
Route::get('/auth/login', 'login', AuthController::class),
|
||||
Route::post('/auth/login', 'login', AuthController::class),
|
||||
|
|
|
@ -97,7 +97,6 @@ class Application extends ApplicationBase
|
|||
$twig->addFilter('json_decode');
|
||||
$twig->addFilter('byte_symbol');
|
||||
|
||||
$twig->addFunction('flashii_is_ready');
|
||||
$twig->addFunction('byte_symbol');
|
||||
$twig->addFunction('session_id');
|
||||
$twig->addFunction('config', [$this->config, 'get']);
|
||||
|
|
|
@ -61,17 +61,24 @@ class AuthController extends Controller
|
|||
|
||||
public function register()
|
||||
{
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$app = Application::getInstance();
|
||||
$allowed_to_reg = $app->config->get('Testing', 'public_registration', 'bool', false)
|
||||
|| in_array(
|
||||
IP::remote(),
|
||||
explode(' ', $app->config->get('Testing', 'allow_ip_registration', 'string', '127.0.0.1 ::1'))
|
||||
);
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$twig = $app->templating;
|
||||
$twig->vars([
|
||||
'has_registrations' => $this->hasRegistrations(),
|
||||
'allowed_to_register' => $allowed_to_reg,
|
||||
]);
|
||||
|
||||
return $twig->render('auth.register');
|
||||
}
|
||||
|
||||
if (!flashii_is_ready()) {
|
||||
if (!$allowed_to_reg) {
|
||||
return [
|
||||
'error' => "Nice try, but you'll have to wait a little longer. I appreciate your excitement though!"
|
||||
];
|
||||
|
|
|
@ -13,9 +13,4 @@ class HomeController extends Controller
|
|||
|
||||
return $twig->render('home.landing');
|
||||
}
|
||||
|
||||
public function isReady(): string
|
||||
{
|
||||
return flashii_is_ready() ? 'yes' : 'no';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,12 +62,6 @@ function byte_symbol($bytes, $decimal = false)
|
|||
return sprintf("%.2f %s%sB", $bytes, $symbol, $symbol !== '' && !$decimal ? 'i' : '');
|
||||
}
|
||||
|
||||
function flashii_is_ready()
|
||||
{
|
||||
$ipAddr = \Misuzu\Net\IP::remote();
|
||||
return in_array($ipAddr, ['83.85.244.163', '127.0.0.1', '::1']) || time() > 1517443200;
|
||||
}
|
||||
|
||||
function get_country_code(string $ipAddr, string $fallback = 'XX'): string
|
||||
{
|
||||
if (function_exists("geoip_country_code_by_name")) {
|
||||
|
|
|
@ -9,11 +9,7 @@
|
|||
{% block content %}
|
||||
<div class="platform form" id="auth-form">
|
||||
<div>
|
||||
{% if flashii_is_ready() %}
|
||||
<a href="/auth/register"><button class="button" type="button">Click here if you don't have an account yet</button></a>
|
||||
{% else %}
|
||||
<p style="padding: .2em">You can't create an account yet, but you may log in if you have one already!</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
<input class="form__text" type="text" name="username" placeholder="Username">
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<h1 style="align-self: center; text-align: left; flex-grow: 1; padding-left: 2em">
|
||||
{% if has_registrations %}
|
||||
Your IP address already has an account!
|
||||
{% elseif not flashii_is_ready() %}
|
||||
{% elseif not allowed_to_register %}
|
||||
You'll have to wait a little longer!
|
||||
{% else %}
|
||||
Welcome, thanks for dropping by!
|
||||
|
@ -19,9 +19,9 @@
|
|||
<div class="platform" style="text-align: left;">
|
||||
<p>As a temporary security measure we only allow one account per IP address, this will definitely be changed in the future but for now; sorry for the possible inconvenience!</p>
|
||||
</div>
|
||||
{% elseif not flashii_is_ready() %}
|
||||
{% elseif not allowed_to_register %}
|
||||
<div class="platform" style="text-align: left;">
|
||||
<p>You'll be able to register once the countdown on the landing page runs out!</p>
|
||||
<p>You'll be able to register once the site enter public beta!</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="platform form" id="auth-form">
|
||||
|
|
|
@ -1,212 +1,14 @@
|
|||
{% extends '@nova/home/master.twig' %}
|
||||
|
||||
{% set banner_classes = 'banner--insane landing__banner' %}
|
||||
{% set banner = 'https://static.flash.moe/images/banner-clouds.png' %}
|
||||
|
||||
{% block banner_content %}
|
||||
<div id="countdown"></div>
|
||||
<style>
|
||||
#countdown {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.countdown-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
transition: transform .5s;
|
||||
}
|
||||
|
||||
.countdown-digit {
|
||||
background: url('https://static.flash.moe/images/countdown-sprite.png');
|
||||
width: 68px;
|
||||
height: 80px;
|
||||
display: inline-block;
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
transition: background-position-y .2s;
|
||||
}
|
||||
|
||||
.countdown-digit[data-digit="0"] { background-position: 0px 0px; }
|
||||
.countdown-digit[data-digit="1"] { background-position: 0px -86px; }
|
||||
.countdown-digit[data-digit="2"] { background-position: 0px -172px; }
|
||||
.countdown-digit[data-digit="3"] { background-position: 0px -259px; }
|
||||
.countdown-digit[data-digit="4"] { background-position: 0px -345px; }
|
||||
.countdown-digit[data-digit="5"] { background-position: 0px -432px; }
|
||||
.countdown-digit[data-digit="6"] { background-position: 0px -518px; }
|
||||
.countdown-digit[data-digit="7"] { background-position: 0px -604px; }
|
||||
.countdown-digit[data-digit="8"] { background-position: 0px -691px; }
|
||||
.countdown-digit[data-digit="9"] { background-position: 0px -777px; }
|
||||
|
||||
.countdown-digit[data-digit=";"] { transition: background-position-y 0s; background-position: -56px 0px; }
|
||||
.countdown-digit[data-digit=":"] { transition: background-position-y 0s; background-position: -56px -86px; }
|
||||
.countdown-digit[data-digit=","] { transition: background-position-y 0s; background-position: -56px -172px; }
|
||||
.countdown-digit[data-digit="."] { transition: background-position-y 0s; background-position: -56px -259px; }
|
||||
.countdown-digit[data-digit="+"] { transition: background-position-y 0s; background-position: -56px -345px; }
|
||||
.countdown-digit[data-digit="-"] { transition: background-position-y 0s; background-position: -56px -432px; }
|
||||
.countdown-digit[data-digit=" "] { transition: background-position-y 0s; background-position: -56px -518px; }
|
||||
</style>
|
||||
<script>
|
||||
var countdownTarget,
|
||||
countdownDigits = [],
|
||||
countdownContainer,
|
||||
countdownInterval,
|
||||
countdownFlashingTicks = 0,
|
||||
countdownLastString = '',
|
||||
countdownFinish,
|
||||
countdownIgnoreHidden = false,
|
||||
continueChecking = true,
|
||||
checkClient = null,
|
||||
checkTimeout;
|
||||
|
||||
function countdownSetup(container, target, finish) {
|
||||
countdownFinish = finish || null;
|
||||
countdownContainer = container;
|
||||
countdownTarget = target.getTime();
|
||||
countdownResize(10);
|
||||
countdownInterval = setInterval(function () { countdownUpdate(countdownIgnoreHidden); }, 100);
|
||||
countdownUpdate(countdownIgnoreHidden);
|
||||
}
|
||||
|
||||
function countdownStop() {
|
||||
clearInterval(countdownInterval);
|
||||
countdownResize(0);
|
||||
countdownTarget = 0;
|
||||
countdownContainer.parentNode.removeChild(countdownContainer);
|
||||
countdownFinish = null;
|
||||
}
|
||||
|
||||
function countdownResize(num) {
|
||||
if (num == countdownDigits.length)
|
||||
return;
|
||||
|
||||
if (num < countdownDigits.length) {
|
||||
num = countdownDigits.length - num;
|
||||
|
||||
for (var i = 0; i < num; i++)
|
||||
countdownContainer.removeChild(countdownDigits.pop());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (num > countdownDigits.length) {
|
||||
num = num - countdownDigits.length;
|
||||
|
||||
for (var i = 0; i < num; i++) {
|
||||
var elem = document.createElement('div');
|
||||
elem.className = 'countdown-digit';
|
||||
elem.setAttribute('data-digit', i);
|
||||
countdownDigits.push(elem);
|
||||
countdownContainer.appendChild(elem);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function countdownUpdate(ignoreHidden) {
|
||||
if (!ignoreHidden && document.hidden)
|
||||
return;
|
||||
|
||||
var now = Date.now();
|
||||
|
||||
if (countdownTarget < now) {
|
||||
if ((typeof countdownFinish) === 'function') {
|
||||
countdownFinish.call();
|
||||
countdownFinish = null;
|
||||
}
|
||||
|
||||
countdownWrite(++countdownFlashingTicks % 10 < 5 ? '00:00:00' : '00 00 00');
|
||||
return;
|
||||
}
|
||||
|
||||
var milliseconds = now - countdownTarget;
|
||||
|
||||
var days = Math.ceil(milliseconds / 86400000);
|
||||
milliseconds -= days * 86400000;
|
||||
|
||||
var hours = Math.ceil(milliseconds / 3600000);
|
||||
milliseconds -= hours * 3600000;
|
||||
|
||||
var minutes = Math.ceil(milliseconds / 60000);
|
||||
milliseconds -= minutes * 60000;
|
||||
|
||||
var seconds = Math.ceil(milliseconds / 1000);
|
||||
milliseconds -= seconds * 1000;
|
||||
|
||||
var cdString = '';
|
||||
|
||||
if (days < 0)
|
||||
cdString += Math.abs(days) + ' ';
|
||||
|
||||
if (days < 0 || hours < 0)
|
||||
cdString += Math.abs(hours) + ':';
|
||||
|
||||
if (days < 0 || hours < 0 || minutes < 0)
|
||||
cdString += Math.abs(minutes).toString().padStart(2, '0') + ':';
|
||||
|
||||
cdString += Math.abs(seconds).toString().padStart(2, '0');
|
||||
|
||||
countdownWrite(cdString);
|
||||
|
||||
if (days >= 0 && hours >= 0 && minutes >= 0 && seconds <= 0) {
|
||||
var scale = 1;
|
||||
|
||||
if (seconds < 0)
|
||||
scale += 4 * Math.pow((60 + seconds) / 60, 2);
|
||||
|
||||
countdownContainer.style.transform = 'scale(' + scale + ')';
|
||||
}
|
||||
}
|
||||
|
||||
function countdownWrite(str) {
|
||||
if ((typeof str) !== 'string')
|
||||
str = str.toString();
|
||||
|
||||
countdownLastString = str;
|
||||
countdownResize(str.length);
|
||||
|
||||
for (var i = 0; i < str.length; i++)
|
||||
countdownDigits[i].setAttribute('data-digit', str[i]);
|
||||
}
|
||||
|
||||
function checkIfFlashiiReady(continuous) {
|
||||
continueChecking = !(!continuous);
|
||||
|
||||
if (checkClient === null) {
|
||||
checkClient = new XMLHttpRequest();
|
||||
|
||||
checkClient.addEventListener('readystatechange', function () {
|
||||
if (checkClient.readyState === 4 && checkClient.responseText !== 'no')
|
||||
location.reload(true);
|
||||
});
|
||||
}
|
||||
|
||||
checkClient.open('GET', '/is_ready?' + Date.now(), true);
|
||||
checkClient.send();
|
||||
|
||||
if (continueChecking)
|
||||
checkTimeout = setTimeout(function () { checkIfFlashiiReady(continueChecking); }, 1000);
|
||||
}
|
||||
|
||||
window.addEventListener("load", function () {
|
||||
var container = document.createElement('div');
|
||||
container.className = 'countdown-container';
|
||||
document.getElementById('countdown').appendChild(container);
|
||||
countdownSetup(container, new Date("Mon, 2 01 2018 1:00:00 +0100"), function () {
|
||||
checkIfFlashiiReady(true);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<h1 style="align-self: center; text-align: left; flex-grow: 1; padding-left: 2em">Well, this is embarrassing...</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="platform" style="text-align: left;">
|
||||
<p>So I have to be honest, when the timer runs out you shouldn't expect a fully functional site. A chat, registration, login and a basic session system will most likely be at most in place though. On the positive side of things you get to see the site evolve, so yay!!</p>
|
||||
<p>In any case I hope you all will enjoy what I have in store going forward. I've also decided to push launch back to the 1st or February because I'll need the time.</p>
|
||||
<p>Lastly I'd like to add that none of the designs are final, most of this I put together ages ago as an eventual redesign for the old site, since then I haven't done much aside from the work in the last month.</p>
|
||||
<p>Long story short, almost nothing is ready and going live now (or within the next week) will just lead to greater disappointment. I set up a <a href="https://twitter.com/flashiinet" class="container__footer-link" target="_blank" rel="noreferrer noopener">Twitter</a> again on which I'll eventually inform when the site goes in public beta.</p>
|
||||
<p>I offer my sincerest apologies for not being able to live up to the hype I've created (twice, even) but understand that this decision will make for a less rushed end product and less coping with hurried code in the future.</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -41,12 +41,13 @@
|
|||
<a href="https://flash.moe" class="container__footer-link">flash.moe 2013-{{ ''|date('Y') }}</a> |
|
||||
<a href="https://github.com/flashwave/misuzu/tree/{{ git_branch() }}" class="container__footer-link">{{ git_branch() }}</a>#<a href="https://github.com/flashwave/misuzu/commit/{{ git_hash(true) }}" class="container__footer-link">{{ git_hash() }}</a>
|
||||
</div>
|
||||
{#<div class="container__footer-links">
|
||||
<div class="container__footer-links">
|
||||
<a href="#" class="container__footer-link">Terms of Service</a>
|
||||
<a href="#" class="container__footer-link">Rules</a>
|
||||
<a href="#" class="container__footer-link">Contact</a>
|
||||
<a href="#" class="container__footer-link">Status</a>
|
||||
</div>#}
|
||||
<a href="https://twitter.com/flashiinet" class="container__footer-link" target="_blank" rel="noreferrer noopener">@flashiinet</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Reference in a new issue