website changes for open beta, drop prefinery/referrals

This commit is contained in:
Jeremy Kauffman 2017-07-28 20:45:52 -04:00
parent a54e045f3d
commit de2def240a
22 changed files with 90 additions and 514 deletions

View file

@ -4,8 +4,6 @@ class Session
{
const KEY_DOWNLOAD_ACCESS_ERROR = 'download_error2',
KEY_DOWNLOAD_ALLOWED = 'beta_download_allowed2',
KEY_PREFINERY_USER_ID = 'prefinery_user_id',
KEY_PREFINER_USED_CUSTOM_CODE = 'prefinery_used_custom_code',
KEY_DEVELOPER_LAST_FORM = 'developer_last_form',
KEY_DEVELOPER_CREDITS_ERROR = 'developer_credits_error',
KEY_DEVELOPER_CREDITS_WALLET_ADDRESS = 'developer_credits_wallet_address',

View file

@ -28,58 +28,16 @@ class DownloadActions extends Actions
public static function executeGet()
{
$email = static::getEmailParam();
$user = [];
if ($email)
{
if (filter_var($email, FILTER_VALIDATE_EMAIL))
{
$user = Prefinery::findUser($email);
}
if (!$user)
{
Session::unsetKey(Session::KEY_PREFINERY_USER_ID);
Session::unsetKey(Session::KEY_DOWNLOAD_ALLOWED);
}
}
elseif (Session::get(Session::KEY_PREFINERY_USER_ID))
{
try
{
$user = Prefinery::findUser(Session::get(Session::KEY_PREFINERY_USER_ID));
}
catch (PrefineryException $e)
{
if (stripos($e->getMessage(), 'Tester is hidden.') === false)
{
throw $e;
}
}
}
if ($user)
{
static::setSessionVarsForPrefineryUser($user);
}
if (!Session::get(Session::KEY_DOWNLOAD_ALLOWED))
{
return ['download/get'];
}
$osChoices = OS::getAll();
$os = static::guessOs();
if ($os && isset($osChoices[$os]))
{
list($uri, $osTitle, $osIcon, $partial) = $osChoices[$os];
return ['download/getAllowed', [
return ['download/get', [
'os' => $os,
'osTitle' => $osTitle,
'osIcon' => $osIcon,
'prefineryUser' => $user ?: [],
'downloadHtml' => View::exists('download/' . $partial) ?
View::render('download/' . $partial, ['downloadUrl' => Github::getAppDownloadUrl($os)]) :
false
@ -93,7 +51,6 @@ class DownloadActions extends Actions
public static function executeSignup()
{
$email = Request::getParam('email');
$code = Request::getParam('code');
if (!$email || !filter_var($email, FILTER_VALIDATE_EMAIL))
{
@ -101,39 +58,10 @@ class DownloadActions extends Actions
}
else
{
$referrerId = Request::getParam('referrer_id');
$failure = false;
Mailgun::sendSubscriptionConfirmation($email);
try
{
$user = Prefinery::findOrCreateUser($email, $code, $referrerId);
static::setSessionVarsForPrefineryUser($user);
if ($code && strlen($code) > 2 && in_array(substr($code, 0, 2), ['my', 'pf', 'sl']))
{
Session::set(Session::KEY_PREFINER_USED_CUSTOM_CODE, true);
}
}
catch (CurlException $e)
{
$failure = true;
Slack::sendErrorIfProd($e);
}
catch (PrefineryException $e)
{
$failure = true;
}
if ($failure)
{
Session::set(Session::KEY_DOWNLOAD_ALLOWED, false);
Session::set(Session::KEY_DOWNLOAD_ACCESS_ERROR,
'We were unable to add you to the wait list. Received error "' . $e->getMessage() . '". Please contact ' .
Config::HELP_CONTACT_EMAIL . ' if you think this is a mistake.');
}
}
return Controller::redirect('/get');
return Controller::redirect(Request::getReferrer('/get'));
}
public static function prepareListPartial(array $vars)
@ -148,39 +76,6 @@ class DownloadActions extends Actions
{
return $vars + [
'defaultEmail' => static::getEmailParam(),
'allowInviteCode' => true,
'referralCode' => Request::getParam('r', '')
];
}
protected static function setSessionVarsForPrefineryUser($userData)
{
Session::set(Session::KEY_DOWNLOAD_ALLOWED, in_array($userData['status'], [Prefinery::STATE_ACTIVE, Prefinery::STATE_INVITED]));
Session::set(Session::KEY_PREFINERY_USER_ID, (int)$userData['id']);
}
public static function prepareReferPartial(array $vars)
{
$userId = (int)Session::get(Session::KEY_PREFINERY_USER_ID);
if (!$userId)
{
return null;
}
$prefineryUser = Prefinery::findUser($userId);
if ($prefineryUser)
{
preg_match('/\?r\=(\w+)/', $prefineryUser['share_link'], $matches);
}
else
{
$matches = null;
}
return $vars + [
'prefineryUser' => $prefineryUser,
'referralCode' => $matches[1] ?? 'unknown'
];
}

View file

@ -15,9 +15,8 @@ bounty:
completed_notice: This bounty has already been completed and can no longer be claimed.
pull_request_link: View the Pull Request
description:
allowed: Download/install the latest version of LBRY for %os%.
faq: Frequently asked questions about LBRY.
get: Download/install the latest version of LBRY.
get: Experience content freedom! Download the latest version of LBRY for Windows, mac OS, or Linux.
home: Meet LBRY, a content sharing and publishing platform that is decentralized and owned by its users.
join: Follow along and receive updates about LBRY via email.
learn: Learn more about LBRY, the technology that puts you back in control of the internet.
@ -29,10 +28,10 @@ description:
test: WHAT WHAT
what: Access information and content in ways you never dreamed possible. Earn credits for your unused bandwidth and diskspace.
download:
beta: This is still a beta.
beta: This software is in beta.
creator: Creator? Skip the Line
credits: Claim Credits
curse: While LBRY is now live, it may crash, work unreliably, or inadvertently put a curse on your family for generations (a common programming error). Use at your own risk.
curse: It may crash, work unreliably, or inadvertently put a curse on your family for generations (a common programming error).
deb: Download .deb
earn1: Earn
# this many credits
@ -43,11 +42,11 @@ download:
for-os: LBRY for %os%
github: Or, view the source and compile instructions on
osx: Arrival is expected by July 5.
osx2: Download for OS X
osx2: Download for macOS
other: Other Systems
popular: Popular publishers can earn $1,000 and early access for publishing via LBRY.
select: Select an OS
unavailable: LBRY is not yet out on your platform. You will receive an email as we expand LBRY to your preferred platform.
unavailable: LBRY is not yet out on this platform, but will be soon. Enter your email to be notified when it is released.
verb: Download
windows: Download for Windows
works: "Works with Ubuntu, Debian, or any distro with <code>apt</code> or <code>dpkg</code>."
@ -79,7 +78,6 @@ global:
sentence: Watch, read and play in a decentralized digital library controlled by the community.
tagline: Content Freedom
learn:
100: LBRY in 100 Seconds
art: Art in the Internet Age
essay: Read the Essay
exchange_faq: Buy/Sell LBRY Credits
@ -237,8 +235,8 @@ social:
github: GitHub (source code)
header: Build With Us
humansheader: Humans
humanstext: Let's create a freer, more creative world.
robotsheader: Wanna Be Robots
humanstext: Join the LBRY community.
robotsheader: Robots
robotstext: Make with us. All LBRY code is open source.
slack: Slack (chat)
tweets: Tweets by @LBRYio

View file

@ -1,189 +0,0 @@
<?php
class Prefinery
{
const STATE_APPLIED = 'applied';
const STATE_INVITED = 'invited';
const STATE_IMPORTED = 'imported';
const STATE_REJECTED = 'rejected';
const STATE_ACTIVE = 'active';
const STATE_SUSPENDED = 'suspended';
const DOMAIN = 'https://lbry.prefinery.com';
const PREFIX = '/api/v2/betas/8679';
protected static $curlOptions = [
'headers' => [
'Accept: application/json',
'Content-type: application/json'
],
'json_data' => true,
'json_response' => true
];
public static function findUser($emailOrId, $useApc = true)
{
$apcEnabled = Apc::isEnabled();
if ($useApc && $apcEnabled)
{
$cached = apc_fetch('prefinery-user-' . $emailOrId, $success);
if ($success)
{
return $cached;
}
}
try
{
$user = is_numeric($emailOrId) ? Prefinery::findTesterById($emailOrId) : Prefinery::findTesterByEmail($emailOrId);
}
catch (PrefineryException $e)
{
if (stripos($e->getMessage(), 'Tester is hidden.') === false)
{
throw $e;
}
}
if ($user)
{
unset($user['invitation_code']); // so we dont leak it
if ($useApc && $apcEnabled)
{
apc_store('prefinery-user-' . $emailOrId, $user, 3600);
}
}
return $user;
}
protected static function findTesterById($id)
{
return static::get('/testers/' . (int)$id);
}
protected static function findTesterByEmail($email)
{
$data = static::get('/testers', ['email' => $email]);
if ($data && is_array($data) && count($data))
{
foreach ($data as $userData) //can partial match on email, very unlikely though
{
if (strtolower($userData['email']) == strtolower($email))
{
return $userData;
}
}
return $data[0];
}
return null;
}
public static function findOrCreateUser($email, $inviteCode = null, $referrerId = null)
{
$user = static::findUser($email);
if (!$user)
{
// dont record ip for lbry.io addresses, for testing
$ip = !preg_match('/@lbry\.io$/', $email) ? Request::getOriginalIp() : null;
$ua = Request::getUserAgent();
$user = Prefinery::createTester(array_filter([
'email' => $email,
'status' => $inviteCode ? static::STATE_ACTIVE : static::STATE_APPLIED, # yes, has to be ACTIVE to validate invite code
'invitation_code' => $inviteCode,
'referrer_id' => $referrerId,
'profile' => ['ip' => $ip, 'user_agent' => $ua]
]));
// if ($inviteCode)
// {
// $user = static::updateTester(array_intersect_key($user, ['id' => null]) + ['status' => static::STATE_ACTIVE]);
// if ($user['invitation_code'] != $inviteCode)
// {
// $user['is_custom_code'] = true;
// }
// }
$user['is_custom_code'] = false;
}
// unset($user['invitation_code']); // so we dont leak it
return $user;
}
protected static function createTester(array $testerData)
{
return static::post('/testers', ['tester' => array_filter($testerData)], false);
}
public static function updateTester(array $testerData)
{
if (!$testerData['id'])
{
throw new PrefineryException('Update tester must be called with a tester id');
}
if (Apc::isEnabled())
{
apc_delete('prefinery-user-' . $testerData['id']);
}
return static::put('/testers/' . $testerData['id'], ['tester' => array_diff_key(array_filter($testerData), ['id' => null])], false);
}
protected static function put($endpoint, array $data = [])
{
$apiKey = Config::get('prefinery_key');
$options = static::$curlOptions;
$options['headers'][] = 'X-HTTP-Method-Override: PUT';
return static::decodePrefineryResponse(
Curl::put(static::DOMAIN . static::PREFIX . $endpoint . '.json?api_key=' . $apiKey, $data, $options)
);
}
protected static function get($endpoint, array $data = [])
{
return static::decodePrefineryResponse(
Curl::get(static::DOMAIN . static::PREFIX . $endpoint . '.json?api_key=' . Config::get('prefinery_key'),
$data, array_merge(static::$curlOptions, ['retry' => 3])
)
);
}
protected static function post($endpoint, array $data = [], bool $allowEmptyResponse = true)
{
return static::decodePrefineryResponse(
Curl::post(static::DOMAIN . static::PREFIX . $endpoint . '.json?api_key=' . Config::get('prefinery_key'),
$data, array_merge(static::$curlOptions, ['retry' => 3])
),
$allowEmptyResponse
);
}
protected static function decodePrefineryResponse($data, $allowEmptyResponse = true)
{
if (!$allowEmptyResponse && !$data && $data !== [])
{
throw new PrefineryException('Received empty or improperly encoded response.');
}
if (isset($data['error']))
{
throw new PrefineryException($data['error']);
}
if (isset($data['errors']))
{
throw new PrefineryException($data['errors'] ?
implode("\n", array_map(function ($error) { return $error['message']; }, (array)$data['errors'])) :
'Received empty error array.'
);
}
return $data;
}
}
class PrefineryException extends Exception
{
}

View file

@ -14,7 +14,7 @@ class OS
//yes, this is probably a bad pattern
return [
OS::OS_WINDOWS => ['/windows', 'Windows', 'icon-windows', '_windows'],
OS::OS_OSX => ['/osx', 'OS X', 'icon-apple', '_osx'],
OS::OS_OSX => ['/osx', 'macOS', 'icon-apple', '_osx'],
OS::OS_LINUX => ['/linux', 'Linux', 'icon-linux', '_linux'],
OS::OS_ANDROID => ['/android', 'Android', 'icon-android', '_android'],
OS::OS_IOS => ['/ios', 'iOS', 'icon-mobile', '_ios']

View file

@ -3,7 +3,7 @@
When running, the LBRY daemon provides a JSON-RPC server running at <code class="code-inline">http://localhost:5279/lbryapi</code>.
</p>
<p>
It can be accessed by any utility capable of making HTTPS GET and POST requests, such as cURL or possibly your toaster. Psst, if you are on windows you could use PowerShell while testing, scroll down to the bottom of this page to get more info.
It can be accessed by any utility capable of making HTTPS GET and POST requests, such as cURL or possibly your toaster. On Windows? You can also use PowerShell. <a class="link-primary" href="#windows">Learn more</a>.
</p>
<p>
To verify the LBRY daemon is running correctly, let's try looking up a URI:
@ -54,12 +54,12 @@
<p>You can also list all of the commands available by calling the <span class="code-plan">help</span> command.</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"help"}'
</code>
<h3>Windows</h3>
<h3 id="windows">Windows</h3>
<p>If you are running Windows and would like to follow this guide you could substitute curl with a PowerShell console and the following code.
</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>Invoke-RestMethod -Uri 'http://localhost:5279/lbryapi' -Body 'THE_JSON_DATA' -Method POST | ConvertTo-Json
</code>
<p>If PowerShell does not work and you want to continue with cURL, you'll need to escape inner double quotes with a \ to pass the JSON properly via Command Prompt.
<p>If PowerShell does not work and you want to continue with cURL, you'll need to escape inner double quotes with a \ to pass the JSON properly via Command Prompt.
</p>
<code class="code-bash"><span class="code-bash__prompt">$</span>curl "http://localhost:5279/lbryapi" --data "{\"method\":\"get\",\"params\":{\"uri\":\"what\"} }"
</code>

View file

@ -1,4 +0,0 @@
<p>
<strong>{{download.beta}}</strong>
{{download.curse}}
</p>

View file

@ -1,7 +1,7 @@
<div class="text-center">
<p>
<a id="linux-download" class="btn-alt" <?php echo $downloadUrl ? 'download' : '' ?>
href="<?php echo $downloadUrl ?: 'https://github.com/lbryio/lbry/releases' ?>"
<a id="linux-download" class="btn-alt btn-large" <?php echo $downloadUrl ? 'download' : '' ?>
href="<?php echo $downloadUrl ?: 'https://github.com/lbryio/lbry-app/releases' ?>"
<?php /*
data-facebook-track-id="XXXXX"
data-twitter-track-id="XXXXX"
@ -13,7 +13,7 @@
</p>
<div class="meta">
{{download.works}}
Prefer to build from source? Go <a href="https://github.com/lbryio/lbry" class="link-primary">here</a>.
Prefer to build from source? Go <a href="https://github.com/lbryio/lbry-app" class="link-primary">here</a>.
</div>
</div>

View file

@ -1,7 +1,7 @@
<div class="text-center">
<p>
<a class="btn-alt" <?php echo $downloadUrl ? 'download' : '' ?>
href="<?php echo $downloadUrl ?: 'https://github.com/lbryio/lbry/releases' ?>"
<a class="btn-alt btn-large" <?php echo $downloadUrl ? 'download' : '' ?>
href="<?php echo $downloadUrl ?: 'https://github.com/lbryio/lbry-app/releases' ?>"
<?php /*
data-facebook-track-id="XXXXX"
data-twitter-track-id="XXXXX"

View file

@ -1,5 +0,0 @@
<div class="cover cover-dark cover-center content content-dark" style="background-image:url('/img/cover-home3.jpg')">
<h3 class="cover-title text-center cover-title-tile">Know the command line?<br/>Skip the real line.</h3>
<p class="cover-subtitle text-center" style="max-width: 450px">Developers and other technical users can try LBRY before it goes public.</p>
<a href="/quickstart" class="btn btn-alt">Developer Program</a>
</div>

View file

@ -1,42 +0,0 @@
<h3>{{title.refer}}</h3>
<p>{{page.refer.earn1}} <?php echo i18n::formatCredits($prefineryUser['id'] < 75000 ? 10 : (date('Y-m-d') > '2017-06-19' ? 2.5 : 5)) ?> {{page.refer.earn2}}</p>
<p>
<input type="text" value="<?php echo Request::getHostAndProto() ?>/get?r=<?php echo $referralCode ?>" style="width: 100%; border-color: #155B4A" readonly id="referral-url-input"/>
<?php js_start() ?>
$('#referral-url-input')
.focus(function() { $(this).select(); })
.click(function() { $(this).select(); });
<?php js_end() ?>
</p>
<h3>{{page.refer.status}}</h3>
<p><?php echo __($prefineryUser['share_signups_count'] == 1 ? 'page.refer.referone' : 'page.refer.refermany',
['%count%' => $prefineryUser['share_signups_count']]) ?>
<?php
if ($prefineryUser['share_signups_count'] <= 0)
{
echo __('page.refer.count0');
}
elseif ($prefineryUser['share_signups_count'] <= 5)
{
echo __('page.refer.count1');
}
elseif ($prefineryUser['share_signups_count'] <= 10)
{
echo __('page.refer.count2');
}
elseif ($prefineryUser['share_signups_count'] <= 25)
{
echo __('page.refer.count3');
}
elseif ($prefineryUser['share_signups_count'] <= 100)
{
echo __('page.refer.count4');
}
else
{
echo 'Wow! You are too good at this. Please contact us at ' . Config::HELP_CONTACT_EMAIL . ' to make sure we can count all of these. We will also stop sending you an email for each referral, but you can always check back here.';
}
?>
</p>
<div class="meta"><a href="/faq/referrals" class="link-primary">{{page.refer.more}}</a></div>

View file

@ -1,7 +1,8 @@
<form method="POST" action="/signup" id="signup-form" class="hide">
<div class="hide">
<input type="hidden" name="referrer_id" value="<?php echo htmlspecialchars($referralCode) ?>" />
</div>
<form method="POST" action="/signup" id="signup-form">
<?php if (Session::get(Session::KEY_DOWNLOAD_ACCESS_ERROR)): ?>
<div class="notice notice-error spacer1"><?php echo Session::get(Session::KEY_DOWNLOAD_ACCESS_ERROR) ?></div>
<?php Session::unsetKey(Session::KEY_DOWNLOAD_ACCESS_ERROR) ?>
<?php endif ?>
<div class="form-row">
<label for="email">
<?php echo __('email.address') ?>
@ -10,54 +11,7 @@
<input type="text" value="<?php echo htmlspecialchars($defaultEmail) ?>" name="email" class="required standard input-large" placeholder="someone@somewhere.com">
</div>
</div>
<?php if ($allowInviteCode): ?>
<div class="form-row">
<label for="code_select">
<?php echo __('email.code') ?>
</label>
<div class="form-input">
<label class="label-radio">
<input name="code_select" type="radio" value="" />
{{email.nocode}}
</label>
</div>
<div class="form-input">
<label class="label-radio">
<input name="code_select" type="radio" value="yes" />
{{email.yescode}}
</label>
</div>
<div class="form-input has-code">
<input type="text" value="" name="code" class="required standard" placeholder="abc123">
</div>
</div>
<?php else: ?>
<div class="hide"><input name="code_select" type="radio" checked="checked" /></div>
<?php endif ?>
<div class="invite-submit has-code">
<input type="submit" value="Access LBRY" name="subscribe" class="btn-alt">
</div>
<div class="invite-submit no-code">
<div class="invite-submit">
<input type="submit" value="Join List" name="subscribe" class="btn-alt btn-large">
</div>
</form>
<?php js_start() ?>
(function(){
var form = $('#signup-form'),
codeRadioInputs = form.find('input[name="code_select"]');
codeRadioInputs.change(function() {
var selectedInput = codeRadioInputs.filter(':checked'),
hasChoice = selectedInput.length,
hasCode = selectedInput.val() == 'yes';
form.find('.has-code')[hasChoice && hasCode ? 'show' : 'hide']();
form.find('.no-code')[hasChoice && !hasCode ? 'show' : 'hide']();
if (!hasCode)
{
form.find('input[name="code"]').val('');
}
}).change();
form.show();
})();
<?php js_end() ?>
</form>

View file

@ -1,3 +0,0 @@
<div class="notice notice-info">
<p>{{download.unavailable}}</p>
</div>

View file

@ -1,3 +1,3 @@
<div class="video">
<iframe width="560" height="315" src="https://www.youtube.com/embed/DjouYBEkQPY" frameborder="0" allowfullscreen></iframe>
<video src="https://spee.ch/hellolbry/6.mp4" poster="/img/lbry-ui.png" controls></video>
</div>

View file

@ -1,7 +1,7 @@
<div class="text-center">
<p>
<a class="btn-alt" <?php echo $downloadUrl ? 'download' : '' ?>
href="<?php echo $downloadUrl ?: 'https://github.com/lbryio/lbry/releases' ?>"
<a class="btn-alt btn-large" <?php echo $downloadUrl ? 'download' : '' ?>
href="<?php echo $downloadUrl ?: 'https://github.com/lbryio/lbry-app/releases' ?>"
<?php /*
data-facebook-track-id="XXXXX"
data-twitter-track-id="XXXXX"

View file

@ -5,29 +5,29 @@
<main class="column-fluid">
<div class="span7">
<div class="cover cover-dark cover-dark-grad content content-stretch content-dark">
<h1>{{global.get}}</h1>
<?php if (Session::get(Session::KEY_DOWNLOAD_ACCESS_ERROR)): ?>
<div class="notice notice-error spacer1"><?php echo Session::get(Session::KEY_DOWNLOAD_ACCESS_ERROR) ?></div>
<?php Session::unsetKey(Session::KEY_DOWNLOAD_ACCESS_ERROR) ?>
<?php endif ?>
<?php if (Session::get(Session::KEY_PREFINERY_USER_ID)): ?>
<h3>You're In!</h3>
<p>You'll be sent an invite when LBRY early access begins.</p>
<p>And remember, friends don't let other friends miss out on content freedom.</p>
<?php echo View::render('download/_refer') ?>
<h1><?php echo __('download.for-os', ['%os%' => $osTitle]) ?> <span class="<?php echo $osIcon ?>"></span></h1>
<?php if ($downloadHtml): ?>
<p>
This is a browser and wallet for the LBRY network.
<a href="https://lbry.io/faq/what-is-lbry" class="link-primary">What is LBRY?</a>
</p>
<p>
<strong>{{download.beta}}</strong>
{{download.curse}}
</p>
<?php echo $downloadHtml ?>
<?php else: ?>
<div class="spacer1">
<h4>LBRY early access began April 2017.</h4>
</div>
<?php echo View::render('download/_signup', ['allowInviteCode' => false]) ?>
<p>{{download.unavailable}}</p>
<?php echo View::render('download/_signup') ?>
<?php endif ?>
</div>
</div>
<div class="span5">
<?php echo View::render('download/_list', [
'excludeOs' => $os
]) ?>
<?php echo View::render('download/_social') ?>
<?php echo View::render('download/_publish') ?>
</div>
</main>
<?php echo View::render('nav/_footer') ?>
<?php echo View::render('nav/_footer') ?>

View file

@ -1,38 +0,0 @@
<?php Response::setMetaDescription(__('description.allowed', ['%os%' => $osTitle])) ?>
<?php NavActions::setNavUri('/get') ?>
<?php echo View::render('nav/_header', ['isDark' => false]) ?>
<main class="column-fluid">
<div class="span7">
<div class="cover cover-dark cover-dark-grad content content-stretch content-dark">
<h1><?php echo __('download.for-os', ['%os%' => $osTitle]) ?> <span class="<?php echo $osIcon ?>"></span></h1>
<?php if ($downloadHtml): ?>
<?php echo View::render('download/_betaNotice') ?>
<?php if (Session::get(Session::KEY_PREFINER_USED_CUSTOM_CODE)): ?>
<div class="notice notice-info spacer1">
It looks like you may have been invited via a custom code.
<strong>If so, please check your email for a single-use code to claim credits after installing.</strong>
</div>
<?php endif ?>
<?php echo $downloadHtml ?>
<?php else: ?>
<?php echo View::render('download/_unavailable', [
'os' => $os
]) ?>
<?php endif ?>
</div>
<?php if ($prefineryUser): ?>
<div class="cover cover-light content content-stretch content-light">
<?php echo View::render('download/_refer') ?>
</div>
<?php endif ?>
</div>
<div class="span5">
<?php echo View::render('download/_list', [
'excludeOs' => $os
]) ?>
<?php echo View::render('download/_social') ?>
</div>
</main>
<?php echo View::render('nav/_footer') ?>

View file

@ -6,7 +6,7 @@
<h1 class="cover-title cover-title-flat text-center">Content Freedom</h1>
</div>
<div class="cover home__media">
<img alt="Picture of LBRY Browser" src="/img/lbry-ui.png" />
<a href="/get"><img alt="Picture of LBRY Browser" src="/img/lbry-ui.png" /></a>
</div>
<div class="cover cover-light content content-light content-wide home__copy">
<div class="spacer2">
@ -15,7 +15,7 @@
<h3 class="cover-subtitle cover-title-flat">Hollywood films, college lessons, amazing streamers and more are on the first media network ruled by <em>you</em>.</h3>
</div>
<div class="spacer2 text-center">
<a href="/get" class="btn-primary btn-large spacer1">Early Access</a>
<a href="/get" class="btn-primary btn-large spacer1">Access LBRY</a>
<a href="/learn" class="btn-link btn-large">{{global.learn}}</a>
</div>
</div>

View file

@ -3,22 +3,23 @@
<?php echo View::render('nav/_header', ['isDark' => false]) ?>
<main class="column-fluid ">
<div class="span6">
<div class="cover cover-dark cover-dark-grad">
<div class="content content-dark content-tile">
<h1 class="cover-title cover-title-tile">{{learn.100}}</h1>
<div class="cover cover-dark cover-center content content-dark" style="background-image:url(/img/altamira-bison.jpg)">
<h1 class="cover-title cover-title-tile">{{learn.art}}</h1>
<p class="cover-subtitle text-center" style="max-width: 660px">{{learn.how}}</p>
<a href="/what" class="btn-alt btn-large"><?php echo __('learn.essay') ?></a>
</div>
</div>
<div class="span6">
<div class="cover cover-light">
<div class="content content-light content-tile">
<h2 class="cover-title cover-title-tile cover-title-flat">Hello LBRY</h2>
<p>See previews of the LBRY UI and the great content available now on LBRY.</p>
<?php echo View::render('download/_videoIntro') ?>
</div>
</div>
</div>
<div class="span6">
<div class="cover cover-dark cover-center content content-dark" style="background-image:url(/img/altamira-bison.jpg)">
<h2 class="cover-title cover-title-tile">{{learn.art}}</h2>
<p class="cover-subtitle text-center" style="max-width: 660px">{{learn.how}}</p>
<a href="/what" class="btn-alt"><?php echo __('learn.essay') ?></a>
</div>
</div>
<div class="span4">
<div class="cover cover-light-alt cover-light-alt-grad">
<div class="cover cover-light">
<div class="content content-light content-tile">
<h3>{{learn.explore}}</h3>
<div class="spacer1">
@ -26,9 +27,10 @@
</div>
<div class="spacer1">
<a href="/faq" class="link-primary">{{page.faq.header}}</a>
(<a href="/faq/what-is-lbry" class="link-primary">What is LBRY?</a>)
</div>
<div class="spacer1">
<a href="http://explorer.lbry.io" class="link-primary">{{learn.explorer}}</a>
<a href="http://explorer.lbry.io" class="link-primary">Blockchain Explorer</a>
</div>
<div class="spacer1">
<a href="/team" class="link-primary">About the Team</a>
@ -40,14 +42,15 @@
</div>
</div>
<div class="span4">
<div class="cover cover-light">
<div class="cover cover-light-alt cover-light-alt-grad">
<div class="content content-light content-tile">
<h3>{{learn.nerd}}</h3>
<h3>For Developers</h3>
<p>LBRY is 100% open source in the <a class="link-primary" href="https://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar">Bazaar tradition</a>.</p>
<?php echo View::render('social/_listDev') ?>
</div>
</div>
</div>
<div class="span4">
<div class="cover cover-dark cover-dark-grad">
<div class="content content-dark content-tile">

View file

@ -12,3 +12,6 @@
<div class="spacer1">
<a href="https://github.com/lbryio" class="link-primary"><span class="icon-code-fork icon-fw"></span><span class="btn-label">Source Code</span></a>
</div>
<div class="spacer1">
<a href="https://slack.lbry.io" class="link-primary"><span class="icon-slack icon-fw"></span><span class="btn-label">Slack (#dev channel)</span></a>
</div>

View file

@ -97,21 +97,21 @@ $(document).ready(function() {
if (!ga) return;
ga('send', 'social', 'Facebook', 'like', window.location.href);
}
$('.video > iframe').each(function() {
var iframe = $(this);
iframe.data('maxWidth', iframe.attr('width'));
iframe.data('maxHeight', iframe.attr('height'));
iframe.data('aspectRatio', iframe.attr('height') / iframe.attr('width'))
.removeAttr('height')
.removeAttr('width');
resizeVideo(iframe);
});
$(window).resize(function() {
$('.video > iframe').each(function() {
resizeVideo($(this));
})
});
//
// $('.video > video').each(function() {
// var iframe = $(this);
// iframe.data('maxWidth', iframe.attr('width'));
// iframe.data('maxHeight', iframe.attr('height'));
// iframe.data('aspectRatio', iframe.attr('height') / iframe.attr('width'))
// .removeAttr('height')
// .removeAttr('width');
//
// resizeVideo(iframe);
// });
//
// $(window).resize(function() {
// $('.video > video').each(function() {
// resizeVideo($(this));
// })
// });
});

View file

@ -231,3 +231,9 @@ body
@include flex(2);
}
}
video {
width: 100%;
max-width: 800px;
height: auto;
}