Refactor about page

This commit is contained in:
RobinLinus 2018-09-22 05:55:09 +02:00
parent 04415ef28f
commit 891859680a
2 changed files with 102 additions and 107 deletions

View file

@ -36,6 +36,18 @@
</head> </head>
<body> <body>
<header class="row-reverse">
<a href="#about" class="icon-button" title="About Snapdrop">
<svg class="icon">
<use xlink:href="#info-outline" />
</svg>
</a>
<a href="#" id="notification" class="icon-button" title="Enable Notifications" hidden>
<svg class="icon">
<use xlink:href="#notifications" />
</svg>
</a>
</header>
<!-- Peers --> <!-- Peers -->
<x-peers class="center"></x-peers> <x-peers class="center"></x-peers>
<x-no-peers> <x-no-peers>
@ -97,13 +109,16 @@
<div class="toast-container full center"> <div class="toast-container full center">
<x-toast class="row" shadow="1" id="toast">File Transfer Completed</x-toast> <x-toast class="row" shadow="1" id="toast">File Transfer Completed</x-toast>
</div> </div>
<!-- Info Page --> <!-- About Page -->
<div id="info" class="full center column"> <x-about id="about" class="full center column">
<section class="center column fade-in">
<header class="row-reverse">
<a href="#" class="close icon-button"> <a href="#" class="close icon-button">
<svg class="icon"> <svg class="icon">
<use xlink:href="#close" /> <use xlink:href="#close" />
</svg> </svg>
</a> </a>
</header>
<svg class="icon logo"> <svg class="icon logo">
<use xlink:href="#wifi-tethering" /> <use xlink:href="#wifi-tethering" />
</svg> </svg>
@ -115,29 +130,20 @@
<use xlink:href="#github" /> <use xlink:href="#github" />
</svg> </svg>
</a> </a>
<a class="icon-button" target="_blank" href="https://twitter.com/intent/tweet?text=https://snapdrop.net%20by%20@robin_linus%20&" title="tweet about Snapdrop"> <a class="icon-button" target="_blank" href="https://twitter.com/intent/tweet?text=https://snapdrop.net%20by%20@robin_linus%20&" title="Tweet about Snapdrop">
<svg class="icon"> <svg class="icon">
<use xlink:href="#twitter" /> <use xlink:href="#twitter" />
</svg> </svg>
</a> </a>
<a class="icon-button" target="_blank" href="https://github.com/RobinLinus/snapdrop#frequently-asked-questions" title="frequently asked questions"> <a class="icon-button" target="_blank" href="https://github.com/RobinLinus/snapdrop#frequently-asked-questions" title="Frequently asked questions">
<svg class="icon"> <svg class="icon">
<use xlink:href="#help-outline" /> <use xlink:href="#help-outline" />
</svg> </svg>
</a> </a>
</div> </div>
</div> </section>
<a href="#info" class="icon-button" title="about Snapdrop"> <x-background></x-background>
<svg class="icon"> </x-about>
<use xlink:href="#info-outline" />
</svg>
<div class="info-background"></div>
</a>
<a id="notification" class="icon-button" hidden title="enable Notifications">
<svg class="icon">
<use xlink:href="#notifications" />
</svg>
</a>
<!-- SVG Icon Library --> <!-- SVG Icon Library -->
<svg style="display: none;"> <svg style="display: none;">
<symbol id=wifi-tethering viewBox="0 0 24 24"> <symbol id=wifi-tethering viewBox="0 0 24 24">
@ -172,8 +178,8 @@
</g> </g>
</svg> </svg>
<!-- Scripts --> <!-- Scripts -->
<script type="text/javascript" src="scripts/network.js"></script> <script src="scripts/network.js"></script>
<script type="text/javascript" src="scripts/ui.js"></script> <script src="scripts/ui.js"></script>
<!-- Sounds --> <!-- Sounds -->
<audio id="blop" preload="auto" autobuffer="true"> <audio id="blop" preload="auto" autobuffer="true">
<source src="/sounds/blop.mp3" type="audio/mpeg"> <source src="/sounds/blop.mp3" type="audio/mpeg">

View file

@ -6,6 +6,7 @@
--peer-width: 120px; --peer-width: 120px;
} }
/* Layout */ /* Layout */
html { html {
@ -57,10 +58,22 @@ body {
bottom: 0; bottom: 0;
} }
header {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 56px;
align-items: center;
padding: 16px;
box-sizing: border-box;
}
[hidden] { [hidden] {
display: none !important; display: none !important;
} }
/* Typography */ /* Typography */
body { body {
@ -112,7 +125,7 @@ body {
a { a {
text-decoration: none; text-decoration: none;
color: var(--primary-color); color: currentColor;
cursor: pointer; cursor: pointer;
} }
@ -153,7 +166,11 @@ a {
} }
} }
/* Main Header */
body>header a {
margin-left: 8px;
}
/* Peers List */ /* Peers List */
@ -164,8 +181,6 @@ x-peers {
z-index: 2; z-index: 2;
} }
/* Empty Peers List */ /* Empty Peers List */
x-no-peers { x-no-peers {
@ -177,7 +192,8 @@ x-no-peers {
animation-fill-mode: backwards; animation-fill-mode: backwards;
} }
x-no-peers h2 { x-no-peers h2,
x-no-peers a {
color: var(--primary-color); color: var(--primary-color);
} }
@ -266,6 +282,8 @@ x-peer[drop] x-icon {
transform: scale(1.1); transform: scale(1.1);
} }
/* Footer */ /* Footer */
footer { footer {
@ -294,7 +312,6 @@ footer .font-body2 {
} }
/* Dialog */ /* Dialog */
x-dialog x-background { x-dialog x-background {
@ -335,7 +352,6 @@ x-dialog .row-reverse>.button {
} }
/* Receive Dialog */ /* Receive Dialog */
#receiveTextDialog #text { #receiveTextDialog #text {
@ -351,15 +367,12 @@ x-dialog .row-reverse>.button {
/* Button */ /* Button */
.button { .button {
padding: 0 16px; padding: 0 16px;
box-sizing: border-box; box-sizing: border-box;
min-height: 36px; min-height: 36px;
border: none;
outline: none;
min-width: 100px; min-width: 100px;
font-size: 14px; font-size: 14px;
line-height: 24px; line-height: 24px;
@ -381,6 +394,8 @@ x-dialog .row-reverse>.button {
justify-content: center; justify-content: center;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
touch-action: manipulation; touch-action: manipulation;
border: none;
outline: none;
} }
.button:before, .button:before,
@ -405,16 +420,18 @@ x-dialog .row-reverse>.button {
border-radius: 8px; border-radius: 8px;
} }
.button:focus:before { .button:focus:before,
.icon-button:focus:before {
opacity: 0.2; opacity: 0.2;
} }
button::-moz-focus-inner { button::-moz-focus-inner {
border: 0; border: 0;
} }
/* Icon Button */ /* Icon Button */
.icon-button { .icon-button {
@ -444,74 +461,56 @@ input {
} }
/* Info Animation */ /* Info Animation */
#info { #about {
text-align: center;
color: white; color: white;
transition: opacity 300ms;
will-change: opacity;
z-index: 11; z-index: 11;
transition-delay: 300ms; overflow: hidden;
pointer-events: none;
} }
#info:not(:target) { #about .fade-in {
transition: opacity 300ms;
will-change: opacity;
transition-delay: 300ms;
z-index: 11;
pointer-events: all;
}
#about:not(:target) .fade-in {
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
transition-delay: 0; transition-delay: 0;
} }
#info .logo { #about .logo {
--icon-size: 96px; --icon-size: 96px;
} }
#info .close { #about x-background {
position: absolute; position: absolute;
top: 12px; top: calc(32px - 200px);
right: 12px; right: calc(32px - 200px);
color: white; width: 400px;
border-radius: 50%; height: 400px;
}
.info-background {
position: relative;
}
.info-background:before {
content: '';
position: absolute;
width: 40px;
height: 40px;
top: -20px;
left: -32px;
border-radius: 50%; border-radius: 50%;
background: var(--primary-color); background: var(--primary-color);
transform: scale(0); transform: scale(0);
transition: transform 800ms cubic-bezier(0.77, 0, 0.175, 1);
will-change: transform; will-change: transform;
transition: transform 800ms cubic-bezier(0.77, 0, 0.175, 1);
z-index: -1;
} }
#info:target+a>.info-background:before { #about:target x-background {
transform: scale(100); transform: scale(10);
} }
a[href="#info"] { #about .row a {
position: absolute;
top: 12px;
right: 12px;
color: #333;
z-index: 10;
}
#info .row a {
color: currentColor;
margin: 8px 8px -16px; margin: 8px 8px -16px;
} }
/* Loading Indicator */ /* Loading Indicator */
.progress { .progress {
@ -544,7 +543,6 @@ a[href="#info"] {
} }
/* Toast */ /* Toast */
.toast-container { .toast-container {
@ -559,7 +557,6 @@ x-toast {
bottom: 24px; bottom: 24px;
width: 100%; width: 100%;
max-width: 344px; max-width: 344px;
border-radius: 8px;
background-color: #323232; background-color: #323232;
color: rgba(255, 255, 255, 0.95); color: rgba(255, 255, 255, 0.95);
align-items: center; align-items: center;
@ -569,7 +566,7 @@ x-toast {
transition: opacity 200ms, transform 300ms ease-out; transition: opacity 200ms, transform 300ms ease-out;
cursor: default; cursor: default;
line-height: 24px; line-height: 24px;
border-radius: 6px; border-radius: 8px;
pointer-events: all; pointer-events: all;
} }
@ -578,12 +575,6 @@ x-toast:not([show]):not(:hover) {
transform: translateY(100px); transform: translateY(100px);
} }
#notification {
position: absolute;
right: 56px;
top: 12px;
color: #333;
}
/* Instructions */ /* Instructions */
@ -603,12 +594,10 @@ x-peers:empty~x-instructions {
opacity: 0; opacity: 0;
} }
/* Responsive Styles */ /* Responsive Styles */
@media (min-height: 800px) { @media (min-height: 800px) {
x-toast {
right: 24px;
}
footer { footer {
margin-bottom: 16px; margin-bottom: 16px;
} }