Update landing page. Removed js, reduced css bundle size, replaced zoom() with transform:scale() to fix ff bug, added better validation warnings

This commit is contained in:
Daniel Supernault 2019-04-02 22:06:22 -06:00
parent cec0f9ba2b
commit 04d7af0e20
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
6 changed files with 885 additions and 327 deletions

File diff suppressed because one or more lines are too long

13
resources/assets/sass/landing.scss vendored Normal file
View file

@ -0,0 +1,13 @@
// Landing Page bundle
@import 'variables';
@import '~bootstrap/scss/bootstrap';
@import 'custom';
@import 'landing/carousel';
@import 'landing/devices';
.container.slim {
width: auto;
max-width: 680px;
padding: 0 15px;
}

View file

@ -0,0 +1,126 @@
@-webkit-keyframes iosDeviceCarousel {
0% {
opacity:1;
}
17% {
opacity:1;
}
25% {
opacity:0;
}
92% {
opacity:0;
}
100% {
opacity:1;
}
}
@-moz-keyframes iosDeviceCarousel {
0% {
opacity:1;
}
17% {
opacity:1;
}
25% {
opacity:0;
}
92% {
opacity:0;
}
100% {
opacity:1;
}
}
@-o-keyframes iosDeviceCarousel {
0% {
opacity:1;
}
17% {
opacity:1;
}
25% {
opacity:0;
}
92% {
opacity:0;
}
100% {
opacity:1;
}
}
@keyframes iosDeviceCarousel {
0% {
opacity:1;
}
17% {
opacity:1;
}
25% {
opacity:0;
}
92% {
opacity:0;
}
100% {
opacity:1;
}
}
#iosDevice {
position:relative;
margin:0 auto;
}
#iosDevice img {
position:absolute;
left:0;
}
#iosDevice img {
-webkit-animation-name: iosDeviceCarousel;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-iteration-count: infinite;
-webkit-animation-duration: 16s;
-moz-animation-name: iosDeviceCarousel;
-moz-animation-timing-function: ease-in-out;
-moz-animation-iteration-count: infinite;
-moz-animation-duration: 16s;
-o-animation-name: iosDeviceCarousel;
-o-animation-timing-function: ease-in-out;
-o-animation-iteration-count: infinite;
-o-animation-duration: 16s;
animation-name: iosDeviceCarousel;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-duration: 16s;
}
#iosDevice img:nth-of-type(1) {
-webkit-animation-delay: 12s;
-moz-animation-delay: 12s;
-o-animation-delay: 12s;
animation-delay: 12s;
}
#iosDevice img:nth-of-type(2) {
-webkit-animation-delay: 8s;
-moz-animation-delay: 8s;
-o-animation-delay: 8s;
animation-delay: 8s;
}
#iosDevice img:nth-of-type(3) {
-webkit-animation-delay: 4s;
-moz-animation-delay: 4s;
-o-animation-delay: 4s;
animation-delay: 4s;
}
#iosDevice img:nth-of-type(4) {
-webkit-animation-delay: 0;
-moz-animation-delay: 0;
-o-animation-delay: 0;
animation-delay: 0;
}

View file

@ -0,0 +1,593 @@
.marvel-device {
display: inline-block;
position: relative;
-webkit-box-sizing: content-box !important;
box-sizing: content-box !important
}
.marvel-device .screen {
width: 100%;
position: relative;
height: 100%;
z-index: 3;
background: white;
overflow: hidden;
display: block;
border-radius: 1px;
-webkit-box-shadow: 0 0 0 3px #111;
box-shadow: 0 0 0 3px #111
}
.marvel-device .top-bar,
.marvel-device .bottom-bar {
height: 3px;
background: black;
width: 100%;
display: block
}
.marvel-device .middle-bar {
width: 3px;
height: 4px;
top: 0px;
left: 90px;
background: black;
position: absolute
}
.marvel-device.iphone-x {
width: 375px;
height: 812px;
padding: 26px;
background: #fdfdfd;
-webkit-box-shadow: inset 0 0 11px 0 black;
box-shadow: inset 0 0 11px 0 black;
border-radius: 66px
}
.marvel-device.iphone-x .overflow {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
border-radius: 66px;
overflow: hidden
}
.marvel-device.iphone-x .shadow {
border-radius: 100%;
width: 90px;
height: 90px;
position: absolute;
background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6) 0%, rgba(255, 255, 255, 0) 60%)
}
.marvel-device.iphone-x .shadow--tl {
top: -20px;
left: -20px
}
.marvel-device.iphone-x .shadow--tr {
top: -20px;
right: -20px
}
.marvel-device.iphone-x .shadow--bl {
bottom: -20px;
left: -20px
}
.marvel-device.iphone-x .shadow--br {
bottom: -20px;
right: -20px
}
.marvel-device.iphone-x:before {
width: calc(100% - 10px);
height: calc(100% - 10px);
position: absolute;
top: 5px;
content: '';
left: 5px;
border-radius: 61px;
background: black;
z-index: 1
}
.marvel-device.iphone-x .inner-shadow {
width: calc(100% - 20px);
height: calc(100% - 20px);
position: absolute;
top: 10px;
overflow: hidden;
left: 10px;
border-radius: 56px;
-webkit-box-shadow: inset 0 0 15px 0 rgba(255, 255, 255, 0.66);
box-shadow: inset 0 0 15px 0 rgba(255, 255, 255, 0.66);
z-index: 1
}
.marvel-device.iphone-x .inner-shadow:before {
-webkit-box-shadow: inset 0 0 20px 0 #FFFFFF;
box-shadow: inset 0 0 20px 0 #FFFFFF;
width: 100%;
height: 116%;
position: absolute;
top: -8%;
content: '';
left: 0;
border-radius: 200px / 112px;
z-index: 2
}
.marvel-device.iphone-x .screen {
border-radius: 40px;
-webkit-box-shadow: none;
box-shadow: none
}
.marvel-device.iphone-x .top-bar,
.marvel-device.iphone-x .bottom-bar {
width: 100%;
position: absolute;
height: 8px;
background: rgba(0, 0, 0, 0.1);
left: 0
}
.marvel-device.iphone-x .top-bar {
top: 80px
}
.marvel-device.iphone-x .bottom-bar {
bottom: 80px
}
.marvel-device.iphone-x .volume,
.marvel-device.iphone-x .volume:before,
.marvel-device.iphone-x .volume:after,
.marvel-device.iphone-x .sleep {
width: 3px;
background: #b5b5b5;
position: absolute
}
.marvel-device.iphone-x .volume {
left: -3px;
top: 116px;
height: 32px
}
.marvel-device.iphone-x .volume:before {
height: 62px;
top: 62px;
content: '';
left: 0
}
.marvel-device.iphone-x .volume:after {
height: 62px;
top: 140px;
content: '';
left: 0
}
.marvel-device.iphone-x .sleep {
height: 96px;
top: 200px;
right: -3px
}
.marvel-device.iphone-x .camera {
width: 6px;
height: 6px;
top: 9px;
border-radius: 100%;
position: absolute;
left: 154px;
background: #0d4d71
}
.marvel-device.iphone-x .speaker {
height: 6px;
width: 60px;
left: 50%;
position: absolute;
top: 9px;
margin-left: -30px;
background: #171818;
border-radius: 6px
}
.marvel-device.iphone-x .notch {
position: absolute;
width: 210px;
height: 30px;
top: 26px;
left: 108px;
z-index: 4;
background: black;
border-bottom-left-radius: 24px;
border-bottom-right-radius: 24px
}
.marvel-device.iphone-x .notch:before,
.marvel-device.iphone-x .notch:after {
content: '';
height: 8px;
position: absolute;
top: 0;
width: 8px
}
.marvel-device.iphone-x .notch:after {
background: radial-gradient(circle at bottom left, transparent 0, transparent 70%, black 70%, black 100%);
left: -8px
}
.marvel-device.iphone-x .notch:before {
background: radial-gradient(circle at bottom right, transparent 0, transparent 70%, black 70%, black 100%);
right: -8px
}
.marvel-device.iphone-x.landscape {
height: 375px;
width: 812px
}
.marvel-device.iphone-x.landscape .top-bar,
.marvel-device.iphone-x.landscape .bottom-bar {
width: 8px;
height: 100%;
top: 0
}
.marvel-device.iphone-x.landscape .top-bar {
left: 80px
}
.marvel-device.iphone-x.landscape .bottom-bar {
right: 80px;
bottom: auto;
left: auto
}
.marvel-device.iphone-x.landscape .volume,
.marvel-device.iphone-x.landscape .volume:before,
.marvel-device.iphone-x.landscape .volume:after,
.marvel-device.iphone-x.landscape .sleep {
height: 3px
}
.marvel-device.iphone-x.landscape .inner-shadow:before {
height: 100%;
width: 116%;
left: -8%;
top: 0;
border-radius: 112px / 200px
}
.marvel-device.iphone-x.landscape .volume {
bottom: -3px;
top: auto;
left: 116px;
width: 32px
}
.marvel-device.iphone-x.landscape .volume:before {
width: 62px;
left: 62px;
top: 0
}
.marvel-device.iphone-x.landscape .volume:after {
width: 62px;
left: 140px;
top: 0
}
.marvel-device.iphone-x.landscape .sleep {
width: 96px;
left: 200px;
top: -3px;
right: auto
}
.marvel-device.iphone-x.landscape .camera {
left: 9px;
bottom: 154px;
top: auto
}
.marvel-device.iphone-x.landscape .speaker {
width: 6px;
height: 60px;
left: 9px;
top: 50%;
margin-top: -30px;
margin-left: 0
}
.marvel-device.iphone-x.landscape .notch {
height: 210px;
width: 30px;
left: 26px;
bottom: 108px;
top: auto;
border-top-right-radius: 24px;
border-bottom-right-radius: 24px;
border-bottom-left-radius: 0
}
.marvel-device.iphone-x.landscape .notch:before,
.marvel-device.iphone-x.landscape .notch:after {
left: 0
}
.marvel-device.iphone-x.landscape .notch:after {
background: radial-gradient(circle at bottom right, transparent 0, transparent 70%, black 70%, black 100%);
bottom: -8px;
top: auto
}
.marvel-device.iphone-x.landscape .notch:before {
background: radial-gradient(circle at top right, transparent 0, transparent 70%, black 70%, black 100%);
top: -8px
}
.marvel-device.note8 {
width: 400px;
height: 822px;
background: black;
border-radius: 34px;
padding: 45px 10px
}
.marvel-device.note8 .overflow {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
border-radius: 34px;
overflow: hidden
}
.marvel-device.note8 .speaker {
height: 8px;
width: 56px;
left: 50%;
position: absolute;
top: 25px;
margin-left: -28px;
background: #171818;
z-index: 1;
border-radius: 8px
}
.marvel-device.note8 .camera {
height: 18px;
width: 18px;
left: 86px;
position: absolute;
top: 18px;
background: #212b36;
z-index: 1;
border-radius: 100%
}
.marvel-device.note8 .camera:before {
content: '';
height: 8px;
width: 8px;
left: -22px;
position: absolute;
top: 5px;
background: #212b36;
z-index: 1;
border-radius: 100%
}
.marvel-device.note8 .sensors {
height: 10px;
width: 10px;
left: 120px;
position: absolute;
top: 22px;
background: #1d233b;
z-index: 1;
border-radius: 100%
}
.marvel-device.note8 .sensors:before {
content: '';
height: 10px;
width: 10px;
left: 18px;
position: absolute;
top: 0;
background: #1d233b;
z-index: 1;
border-radius: 100%
}
.marvel-device.note8 .more-sensors {
height: 16px;
width: 16px;
left: 285px;
position: absolute;
top: 18px;
background: #33244a;
-webkit-box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
z-index: 1;
border-radius: 100%
}
.marvel-device.note8 .more-sensors:before {
content: '';
height: 11px;
width: 11px;
left: 40px;
position: absolute;
top: 4px;
background: #214a61;
z-index: 1;
border-radius: 100%
}
.marvel-device.note8 .sleep {
width: 2px;
height: 56px;
background: black;
position: absolute;
top: 288px;
right: -2px
}
.marvel-device.note8 .volume {
width: 2px;
height: 120px;
background: black;
position: absolute;
top: 168px;
left: -2px
}
.marvel-device.note8 .volume:before {
content: '';
top: 168px;
width: 2px;
position: absolute;
left: 0;
background: black;
height: 56px
}
.marvel-device.note8 .inner {
width: 100%;
height: calc(100% - 8px);
position: absolute;
top: 2px;
content: '';
left: 0px;
border-radius: 34px;
border-top: 2px solid #9fa0a2;
border-bottom: 2px solid #9fa0a2;
background: black;
z-index: 1;
-webkit-box-shadow: inset 0 0 6px 0 rgba(255, 255, 255, 0.5);
box-shadow: inset 0 0 6px 0 rgba(255, 255, 255, 0.5)
}
.marvel-device.note8 .shadow {
-webkit-box-shadow: inset 0 0 60px 0 white, inset 0 0 30px 0 rgba(255, 255, 255, 0.5), 0 0 20px 0 white, 0 0 20px 0 rgba(255, 255, 255, 0.5);
box-shadow: inset 0 0 60px 0 white, inset 0 0 30px 0 rgba(255, 255, 255, 0.5), 0 0 20px 0 white, 0 0 20px 0 rgba(255, 255, 255, 0.5);
height: 101%;
position: absolute;
top: -0.5%;
content: '';
width: calc(100% - 20px);
left: 10px;
border-radius: 38px;
z-index: 5;
pointer-events: none
}
.marvel-device.note8 .screen {
border-radius: 14px;
-webkit-box-shadow: none;
box-shadow: none
}
.marvel-device.note8.landscape {
height: 400px;
width: 822px;
padding: 10px 45px
}
.marvel-device.note8.landscape .speaker {
height: 56px;
width: 8px;
top: 50%;
margin-top: -28px;
margin-left: 0;
right: 25px;
left: auto
}
.marvel-device.note8.landscape .camera {
top: 86px;
right: 18px;
left: auto
}
.marvel-device.note8.landscape .camera:before {
top: -22px;
left: 5px
}
.marvel-device.note8.landscape .sensors {
top: 120px;
right: 22px;
left: auto
}
.marvel-device.note8.landscape .sensors:before {
top: 18px;
left: 0
}
.marvel-device.note8.landscape .more-sensors {
top: 285px;
right: 18px;
left: auto
}
.marvel-device.note8.landscape .more-sensors:before {
top: 40px;
left: 4px
}
.marvel-device.note8.landscape .sleep {
bottom: -2px;
top: auto;
right: 288px;
width: 56px;
height: 2px
}
.marvel-device.note8.landscape .volume {
width: 120px;
height: 2px;
top: -2px;
right: 168px;
left: auto
}
.marvel-device.note8.landscape .volume:before {
right: 168px;
left: auto;
top: 0;
width: 56px;
height: 2px
}
.marvel-device.note8.landscape .inner {
height: 100%;
width: calc(100% - 8px);
left: 2px;
top: 0;
border-top: 0;
border-bottom: 0;
border-left: 2px solid #9fa0a2;
border-right: 2px solid #9fa0a2
}
.marvel-device.note8.landscape .shadow {
width: 101%;
height: calc(100% - 20px);
left: -0.5%;
top: 10px
}

View file

@ -22,11 +22,157 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="shortcut icon" type="image/png" href="/img/favicon.png?v=2">
<link rel="apple-touch-icon" type="image/png" href="/img/favicon.png?v=2">
<link href="{{ mix('css/app.css') }}" rel="stylesheet" data-stylesheet="light">
<link href="{{ mix('css/landing.css') }}" rel="stylesheet">
</head>
<body class="">
<main id="content">
<landing-page></landing-page>
<section class="container">
<div class="row py-5 mb-5">
<div class="col-12 col-md-6 d-none d-md-block">
<div class="m-md-4" style="position: absolute; transform: scale(0.66)">
<div class="marvel-device note8" style="position: absolute;z-index:10;">
<div class="inner"></div>
<div class="overflow">
<div class="shadow"></div>
</div>
<div class="speaker"></div>
<div class="sensors"></div>
<div class="more-sensors"></div>
<div class="sleep"></div>
<div class="volume"></div>
<div class="camera"></div>
<div class="screen">
<img src="/img/landing/android_1.jpg" class="img-fluid">
</div>
</div>
<div class="marvel-device iphone-x" style="position: absolute;z-index: 20;margin: 99px 0 0 151px;">
<div class="notch">
<div class="camera"></div>
<div class="speaker"></div>
</div>
<div class="top-bar"></div>
<div class="sleep"></div>
<div class="bottom-bar"></div>
<div class="volume"></div>
<div class="overflow">
<div class="shadow shadow--tr"></div>
<div class="shadow shadow--tl"></div>
<div class="shadow shadow--br"></div>
<div class="shadow shadow--bl"></div>
</div>
<div class="inner-shadow"></div>
<div class="screen">
<div id="iosDevice">
<img v-if="!loading" src="/img/landing/ios_4.jpg" class="img-fluid">
<img v-if="!loading" src="/img/landing/ios_3.jpg" class="img-fluid">
<img v-if="!loading" src="/img/landing/ios_2.jpg" class="img-fluid">
<img src="/img/landing/ios_1.jpg" class="img-fluid">
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-5 offset-md-1">
<div>
<div class="card my-4">
<div class="card-body px-lg-5">
<div class="text-center pt-3">
<img src="/img/pixelfed-icon-color.svg">
</div>
<div class="py-3 text-center">
<h3 class="font-weight-bold">Pixelfed</h3>
<p class="mb-0 lead">Photo sharing for everyone</p>
</div>
<div>
@if(true === config('pixelfed.open_registration'))
<form class="px-1" method="POST" action="{{ route('register') }}">
@csrf
<div class="form-group row">
<div class="col-md-12">
<input id="name" type="text" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" name="name" value="{{ old('name') }}" placeholder="{{ __('Name') }}" required autofocus>
@if ($errors->has('name'))
<span class="invalid-feedback">
<strong>{{ $errors->first('name') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group row">
<div class="col-md-12">
<input id="username" type="text" class="form-control{{ $errors->has('username') ? ' is-invalid' : '' }}" name="username" value="{{ old('username') }}" placeholder="{{ __('Username') }}" required>
@if ($errors->has('username'))
<span class="invalid-feedback">
<strong>{{ $errors->first('username') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group row">
<div class="col-md-12">
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" placeholder="{{ __('E-Mail Address') }}" required>
@if ($errors->has('email'))
<span class="invalid-feedback">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group row">
<div class="col-md-12">
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" placeholder="{{ __('Password') }}" required>
@if ($errors->has('password'))
<span class="invalid-feedback">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group row">
<div class="col-md-12">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" placeholder="{{ __('Confirm Password') }}" required>
</div>
</div>
@if(config('pixelfed.recaptcha'))
<div class="row my-3">
{!! Recaptcha::render() !!}
</div>
@endif
<div class="form-group row">
<div class="col-md-12">
<button type="submit" class="btn btn-primary btn-block py-0 font-weight-bold">
{{ __('Register') }}
</button>
</div>
</div>
<p class="mb-0 font-weight-bold text-lighter small">By signing up, you agree to our <a href="/site/terms" class="text-muted">Terms of Use</a> and <a href="/site/privacy" class="text-muted">Privacy Policy</a>.</p>
</form>
@else
<div style="min-height: 350px" class="d-flex justify-content-center align-items-center">
<div class="text-center">
<p class="lead">Registrations are closed.</p>
<p class="text-lighter small">You can find a list of other instances on <a href="https://the-federation.info/pixelfed" class="text-muted font-weight-bold">the-federation.info/pixelfed</a> or <a href="https://fediverse.network/pixelfed" class="text-muted font-weight-bold">fediverse.network/pixelfed</a></p>
</div>
</div>
@endif
</div>
</div>
</div>
<div class="card card-body">
<p class="text-center mb-0 font-weight-bold">Have an account? <a href="/login">Log in</a></p>
</div>
</div>
</div>
</div>
</section>
</main>
<footer>
<div class="container py-3">
@ -38,13 +184,9 @@
<a href="{{route('site.privacy')}}" class="text-primary pr-3">{{__('site.privacy')}}</a>
<a href="{{route('site.platform')}}" class="text-primary pr-3">API</a>
<a href="{{route('site.language')}}" class="text-primary pr-3">{{__('site.language')}}</a>
<a href="https://pixelfed.org" class="text-muted float-right" rel="noopener" title="version {{config('pixelfed.version')}}" data-toggle="tooltip">Powered by PixelFed</a>
<a href="https://pixelfed.org" class="text-muted float-right" rel="noopener" title="version {{config('pixelfed.version')}}" data-toggle="tooltip">Powered by Pixelfed</a>
</p>
</div>
</footer>
</body>
<script type="text/javascript" src="{{mix('js/app.js')}}"></script>
<script type="text/javascript" src="{{mix('js/landing.js')}}"></script>
</html>

6
webpack.mix.js vendored
View file

@ -28,9 +28,6 @@ mix.js('resources/assets/js/app.js', 'public/js')
// Timeline component
.js('resources/assets/js/timeline.js', 'public/js')
// LandingPage component
.js('resources/assets/js/landing.js', 'public/js')
// ComposeModal component
.js('resources/assets/js/compose.js', 'public/js')
@ -43,4 +40,7 @@ mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/appdark.scss', 'public/css', {
implementation: require('node-sass')
})
.sass('resources/assets/sass/landing.scss', 'public/css', {
implementation: require('node-sass')
})
.version();