Merge pull request #3574 from thelounge/xpaw/normalize.css

Remove bootstrap.css, use flexbox
This commit is contained in:
Pavel Djundik 2019-12-14 22:37:37 +02:00 committed by GitHub
commit ead372e6e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 694 additions and 1887 deletions

View File

@ -1,6 +1,6 @@
<template>
<div ref="chat" class="chat" tabindex="-1">
<div :class="['show-more', {show: channel.moreHistoryAvailable}]">
<div v-show="channel.moreHistoryAvailable" class="show-more">
<button
ref="loadMoreButton"
:disabled="channel.historyLoading || !$store.state.isConnected"

View File

@ -4,8 +4,6 @@
<SidebarToggle />
</div>
<form class="container" method="post" action="" @submit.prevent="onSubmit">
<div class="row">
<div class="col-sm-12">
<h1 class="title">
<template v-if="defaults.uuid">
<input type="hidden" name="uuid" :value="defaults.uuid" />
@ -15,22 +13,14 @@
<template v-if="config.public">The Lounge - </template>
Connect
<template v-if="!config.displayNetwork">
<template v-if="config.lockNetwork">
to {{ defaults.name }}
</template>
<template v-if="config.lockNetwork"> to {{ defaults.name }} </template>
</template>
</template>
</h1>
</div>
<template v-if="config.displayNetwork">
<div>
<div class="col-sm-12">
<h2>Network settings</h2>
</div>
<div class="col-sm-3">
<div class="connect-row">
<label for="connect:name">Name</label>
</div>
<div class="col-sm-9">
<input
id="connect:name"
class="input"
@ -39,10 +29,9 @@
maxlength="100"
/>
</div>
<div class="col-sm-3">
<div class="connect-row">
<label for="connect:host">Server</label>
</div>
<div class="col-sm-6 col-xs-8">
<div class="input-wrap">
<input
id="connect:host"
class="input"
@ -53,10 +42,9 @@
required
:disabled="config.lockNetwork ? true : false"
/>
</div>
<div class="col-sm-3 col-xs-4">
<div class="port">
<span id="connect:portseparator">:</span>
<input
id="connect:port"
class="input"
type="number"
min="1"
@ -68,8 +56,9 @@
/>
</div>
</div>
<div class="clearfix" />
<div class="col-sm-9 col-sm-offset-3">
<div class="connect-row">
<label></label>
<div class="input-wrap">
<label class="tls">
<input
type="checkbox"
@ -79,8 +68,6 @@
/>
Use secure connection (TLS)
</label>
</div>
<div class="col-sm-9 col-sm-offset-3">
<label class="tls">
<input
type="checkbox"
@ -91,16 +78,12 @@
Only allow trusted certificates
</label>
</div>
<div class="clearfix" />
</div>
</template>
<div class="col-sm-12">
<h2>User preferences</h2>
</div>
<div class="col-sm-3">
<div class="connect-row">
<label for="connect:nick">Nick</label>
</div>
<div class="col-sm-9">
<input
id="connect:nick"
class="input nick"
@ -112,10 +95,8 @@
/>
</div>
<template v-if="!config.useHexIp">
<div class="col-sm-3">
<div class="connect-row">
<label for="connect:username">Username</label>
</div>
<div class="col-sm-9">
<input
id="connect:username"
ref="usernameInput"
@ -126,11 +107,9 @@
/>
</div>
</template>
<div class="col-sm-3">
<div class="connect-row">
<label for="connect:password">Password</label>
</div>
<div class="col-sm-9 password-container">
<RevealPassword v-slot:default="slotProps">
<RevealPassword v-slot:default="slotProps" class="input-wrap password-container">
<input
id="connect:password"
v-model="defaults.password"
@ -141,10 +120,8 @@
/>
</RevealPassword>
</div>
<div class="col-sm-3">
<div class="connect-row">
<label for="connect:realname">Real name</label>
</div>
<div class="col-sm-9">
<input
id="connect:realname"
class="input"
@ -154,10 +131,8 @@
/>
</div>
<template v-if="defaults.uuid">
<div class="col-sm-3">
<div class="connect-row">
<label for="connect:commands">Commands</label>
</div>
<div class="col-sm-9">
<textarea
id="connect:commands"
class="input"
@ -166,31 +141,23 @@
:value="defaults.commands ? defaults.commands.join('\n') : ''"
/>
</div>
<div class="col-sm-9 col-sm-offset-3">
<div>
<button type="submit" class="btn" :disabled="disabled ? true : false">
Save
</button>
</div>
</template>
<template v-else>
<div class="col-sm-3">
<div class="connect-row">
<label for="connect:channels">Channels</label>
<input id="connect:channels" class="input" name="join" :value="defaults.join" />
</div>
<div class="col-sm-9">
<input
id="connect:channels"
class="input"
name="join"
:value="defaults.join"
/>
</div>
<div class="col-sm-9 col-sm-offset-3">
<div>
<button type="submit" class="btn" :disabled="disabled ? true : false">
Connect
</button>
</div>
</template>
</div>
</form>
</div>
</template>

View File

@ -1,14 +1,6 @@
<template>
<p>
<button class="btn pull-right remove-session" @click.prevent="signOut">
<template v-if="session.current">
Sign out
</template>
<template v-else>
Revoke
</template>
</button>
<div class="session-item">
<div class="session-item-info">
<strong>{{ session.agent }}</strong>
<a :href="'https://ipinfo.io/' + session.ip" target="_blank" rel="noopener">{{
@ -16,15 +8,21 @@
}}</a>
<template v-if="!session.current">
<br />
<template v-if="session.active">
<p v-if="session.active">
<em>Currently active</em>
</template>
<template v-else>
Last used on <time>{{ session.lastUse | localetime }}</time>
</template>
</template>
</p>
<p v-else>
Last used on <time>{{ session.lastUse | localetime }}</time>
</p>
</template>
</div>
<div class="session-item-btn">
<button class="btn" @click.prevent="signOut">
<template v-if="session.current">Sign out</template>
<template v-else>Revoke</template>
</button>
</div>
</div>
</template>
<script>

View File

@ -6,15 +6,15 @@
<div class="container">
<h1 class="title">Help</h1>
<h2>
<small class="pull-right">
<h2 class="help-version-title">
<span>About The Lounge</span>
<small>
v{{ $store.state.serverConfiguration.version }} (<router-link
id="view-changelog"
to="/changelog"
>release notes</router-link
>)
</small>
About The Lounge
</h2>
<div class="about">

View File

@ -6,8 +6,7 @@
<form ref="settingsForm" class="container" @change="onChange" @submit.prevent>
<h1 class="title">Settings</h1>
<div class="row">
<div class="col-sm-6">
<div>
<label class="opt">
<input
:checked="$store.state.settings.advanced"
@ -17,10 +16,8 @@
Advanced settings
</label>
</div>
</div>
<div class="row">
<div v-if="canRegisterProtocol || hasInstallPromptEvent" class="col-sm-12">
<div v-if="canRegisterProtocol || hasInstallPromptEvent">
<h2>Native app</h2>
<button
v-if="hasInstallPromptEvent"
@ -40,24 +37,8 @@
</button>
</div>
<div
v-if="
!$store.state.serverConfiguration.public && $store.state.settings.advanced
"
class="col-sm-12"
>
<h2>
Settings synchronisation
<span
class="tooltipped tooltipped-n tooltipped-no-delay"
aria-label="Note: This is an experimental feature and may change in future releases."
>
<button
class="extra-experimental"
aria-label="Note: This is an experimental feature and may change in future releases."
/>
</span>
</h2>
<div v-if="!$store.state.serverConfiguration.public && $store.state.settings.advanced">
<h2>Settings synchronisation</h2>
<label class="opt">
<input
:checked="$store.state.settings.syncSettings"
@ -69,8 +50,8 @@
<template v-if="!$store.state.settings.syncSettings">
<div v-if="$store.state.serverHasSettings" class="settings-sync-panel">
<p>
<strong>Warning:</strong> Checking this box will override the
settings of this client with those stored on the server.
<strong>Warning:</strong> Checking this box will override the settings
of this client with those stored on the server.
</p>
<p>
Use the button below to enable synchronization, and override any
@ -82,24 +63,22 @@
</div>
<div v-else class="settings-sync-panel">
<p>
<strong>Warning:</strong> No settings have been synced before.
Enabling this will sync all settings of this client as the base for
other clients.
<strong>Warning:</strong> No settings have been synced before. Enabling
this will sync all settings of this client as the base for other
clients.
</p>
</div>
</template>
</div>
<div class="col-sm-12">
<h2>Messages</h2>
</div>
<div class="col-sm-6">
<div>
<label class="opt">
<input :checked="$store.state.settings.motd" type="checkbox" name="motd" />
Show <abbr title="Message Of The Day">MOTD</abbr>
</label>
</div>
<div class="col-sm-6">
<div>
<label class="opt">
<input
:checked="$store.state.settings.showSeconds"
@ -109,7 +88,7 @@
Show seconds in timestamp
</label>
</div>
<div v-if="$store.state.settings.advanced" class="col-sm-12">
<div v-if="$store.state.settings.advanced">
<h2>Automatic away message</h2>
<label class="opt">
@ -124,7 +103,6 @@
/>
</label>
</div>
<div class="col-sm-12">
<h2>
Status messages
<span
@ -137,8 +115,7 @@
/>
</span>
</h2>
</div>
<div class="col-sm-12">
<div>
<label class="opt">
<input
:checked="$store.state.settings.statusMessages === 'shown'"
@ -167,10 +144,8 @@
Hide all status messages
</label>
</div>
<div class="col-sm-12">
<h2>Visual Aids</h2>
</div>
<div class="col-sm-12">
<div>
<label class="opt">
<input
:checked="$store.state.settings.coloredNicks"
@ -188,7 +163,7 @@
Enable autocomplete
</label>
</div>
<div v-if="$store.state.settings.advanced" class="col-sm-12">
<div v-if="$store.state.settings.advanced">
<label class="opt">
<label for="nickPostfix" class="sr-only">
Nick autocomplete postfix (e.g. <code>, </code>)
@ -204,10 +179,8 @@
</label>
</div>
<div class="col-sm-12">
<h2>Theme</h2>
</div>
<div class="col-sm-12">
<div>
<label for="theme-select" class="sr-only">Theme</label>
<select
id="theme-select"
@ -226,10 +199,8 @@
</div>
<template v-if="$store.state.serverConfiguration.prefetch">
<div class="col-sm-12">
<h2>Link previews</h2>
</div>
<div class="col-sm-6">
<div>
<label class="opt">
<input
:checked="$store.state.settings.media"
@ -239,7 +210,7 @@
Auto-expand media
</label>
</div>
<div class="col-sm-6">
<div>
<label class="opt">
<input
:checked="$store.state.settings.links"
@ -252,10 +223,8 @@
</template>
<template v-if="!$store.state.serverConfiguration.public">
<div class="col-sm-12">
<h2>Push Notifications</h2>
</div>
<div class="col-sm-12">
<div>
<button
id="pushNotifications"
type="button"
@ -277,23 +246,18 @@
</template>
</button>
<div v-if="$store.state.pushNotificationState === 'nohttps'" class="error">
<strong>Warning</strong>: Push notifications are only supported over
HTTPS connections.
<strong>Warning</strong>: Push notifications are only supported over HTTPS
connections.
</div>
<div
v-if="$store.state.pushNotificationState === 'unsupported'"
class="error"
>
<div v-if="$store.state.pushNotificationState === 'unsupported'" class="error">
<strong>Warning</strong>:
<span>Push notifications are not supported by your browser.</span>
</div>
</div>
</template>
<div class="col-sm-12">
<h2>Browser Notifications</h2>
</div>
<div class="col-sm-12">
<div>
<label class="opt">
<input
id="desktopNotifications"
@ -306,8 +270,7 @@
v-if="$store.state.desktopNotificationState === 'unsupported'"
class="error"
>
<strong>Warning</strong>: Notifications are not supported by your
browser.
<strong>Warning</strong>: Notifications are not supported by your browser.
</div>
<div
v-if="$store.state.desktopNotificationState === 'blocked'"
@ -318,7 +281,7 @@
</div>
</label>
</div>
<div class="col-sm-12">
<div>
<label class="opt">
<input
:checked="$store.state.settings.notification"
@ -328,13 +291,13 @@
Enable notification sound
</label>
</div>
<div class="col-sm-12">
<div>
<div class="opt">
<button id="play" @click.prevent="playNotification">Play sound</button>
</div>
</div>
<div v-if="$store.state.settings.advanced" class="col-sm-12">
<div v-if="$store.state.settings.advanced">
<label class="opt">
<input
:checked="$store.state.settings.notifyAllMessages"
@ -345,7 +308,7 @@
</label>
</div>
<div v-if="$store.state.settings.advanced" class="col-sm-12">
<div v-if="$store.state.settings.advanced">
<label class="opt">
<label for="highlights" class="sr-only">
Custom highlights (comma-separated keywords)
@ -368,10 +331,8 @@
"
id="change-password"
>
<div class="col-sm-12">
<h2>Change password</h2>
</div>
<div class="col-sm-12 password-container">
<div class="password-container">
<label for="old_password_input" class="sr-only">
Enter current password
</label>
@ -385,7 +346,7 @@
/>
</RevealPassword>
</div>
<div class="col-sm-12 password-container">
<div class="password-container">
<label for="new_password_input" class="sr-only">
Enter desired new password
</label>
@ -399,7 +360,7 @@
/>
</RevealPassword>
</div>
<div class="col-sm-12 password-container">
<div class="password-container">
<label for="verify_password_input" class="sr-only">
Repeat new password
</label>
@ -415,27 +376,25 @@
</div>
<div
v-if="passwordChangeStatus && passwordChangeStatus.success"
class="col-sm-12 feedback success"
class="feedback success"
>
Successfully updated your password
</div>
<div
v-else-if="passwordChangeStatus && passwordChangeStatus.error"
class="col-sm-12 feedback error"
class="feedback error"
>
{{ passwordErrors[passwordChangeStatus.error] }}
</div>
<div class="col-sm-12">
<div>
<button type="submit" class="btn" @click.prevent="changePassword">
Change password
</button>
</div>
</div>
<div v-if="$store.state.settings.advanced" class="col-sm-12">
<div v-if="$store.state.settings.advanced">
<h2>Custom Stylesheet</h2>
</div>
<div v-if="$store.state.settings.advanced" class="col-sm-12">
<label for="user-specified-css-input" class="sr-only">
Custom stylesheet. You can override any style with CSS here.
</label>
@ -447,30 +406,27 @@
placeholder="/* You can override any style with CSS here */"
/>
</div>
</div>
<div v-if="!$store.state.serverConfiguration.public" class="session-list">
<h2>Sessions</h2>
<h3>Current session</h3>
<div v-if="$store.getters.currentSession" id="session-current">
<Session :session="$store.getters.currentSession" />
</div>
<Session
v-if="$store.getters.currentSession"
:session="$store.getters.currentSession"
/>
<h3>Other sessions</h3>
<div id="session-list">
<p v-if="$store.state.sessions.length == 0">Loading</p>
<p v-else-if="$store.getters.otherSessions.length == 0">
<p v-if="$store.state.sessions.length === 0">Loading</p>
<p v-else-if="$store.getters.otherSessions.length === 0">
<em>You are not currently logged in to any other device.</em>
</p>
<template v-else>
<Session
v-for="session in $store.getters.otherSessions"
v-else
:key="session.token"
:session="session"
/>
</template>
</div>
</div>
</form>
</div>

1189
client/css/bootstrap.css vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
@import "../../node_modules/normalize.css/normalize.css";
@import "fontawesome.css";
@import "bootstrap.css";
@import "../../node_modules/primer-tooltips/build/build.css";
:root {
@ -47,6 +47,43 @@
opacity: 1; /* fix opacity in Firefox */
}
html {
box-sizing: border-box;
}
*,
*::before,
*::after {
box-sizing: inherit;
}
input,
button,
select,
textarea {
font: inherit;
color: inherit;
}
img {
vertical-align: middle;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
abbr[title] {
cursor: help;
}
html,
body {
height: 100%;
@ -73,22 +110,17 @@ a,
a:hover,
a:focus {
color: var(--link-color);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/**
* From Normalize. See https://github.com/thelounge/thelounge/pull/1217
* 1. Remove the bottom border in Chrome 57- and Firefox 39-.
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
a:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
h1,
@ -106,6 +138,7 @@ button {
outline: none;
padding: 0;
user-select: inherit;
cursor: pointer;
}
code,
@ -155,6 +188,10 @@ kbd {
box-shadow: 0 2px 0 #bbb, inset 0 1px 1px #fff, inset 0 -1px 3px #ccc;
}
p {
margin: 0 0 10px;
}
.btn {
border: 2px solid var(--button-color);
border-radius: 3px;
@ -207,8 +244,10 @@ kbd {
}
.container {
padding: 0 15px;
margin-bottom: 20px;
max-width: 480px;
width: 480px;
align-self: center;
touch-action: pan-y;
}
@ -247,7 +286,6 @@ kbd {
.channel-list-item::before,
#footer .icon,
#chat .count::before,
#settings .extra-experimental,
#settings .extra-help,
#settings #play::before,
#form #upload::before,
@ -357,12 +395,19 @@ kbd {
#help .documentation-link::before { content: "\f19d"; /* http://fontawesome.io/icon/graduation-cap/ */ }
#help .report-issue-link::before { content: "\f188"; /* http://fontawesome.io/icon/bug/ */ }
.session-list strong {
display: block;
.session-list .session-item {
display: flex;
font-size: 14px;
}
.session-list p {
margin-bottom: 10px;
.session-list .session-item-info {
display: flex;
flex-direction: column;
flex-grow: 1;
}
.session-list .session-item-btn {
flex-shrink: 0;
}
#chat .invite .from::before {
@ -461,10 +506,6 @@ kbd {
line-height: 45px;
}
#settings .extra-experimental::before {
content: "\f0c3"; /* https://fontawesome.com/icons/flask?style=solid */
}
#settings .extra-help::before {
content: "\f059"; /* http://fontawesome.io/icon/question-circle/ */
}
@ -881,9 +922,10 @@ background on hover (unless active) */
border-color: #84ce88;
}
#user-specified-css-input {
textarea.input {
resize: vertical;
height: 10em;
height: 100px;
min-height: 35px;
padding: 6px 10px;
line-height: 1.5;
}
@ -924,7 +966,7 @@ background on hover (unless active) */
}
.window h2 small {
color: inherit;
font-size: 16px;
line-height: 30px;
}
@ -1110,7 +1152,6 @@ background on hover (unless active) */
padding-top: 15px;
padding-bottom: 0;
width: 100%;
display: none;
}
#chat .show-more .btn {
@ -1205,10 +1246,6 @@ background on hover (unless active) */
padding: 0 10px;
}
#chat .unread-marker:last-child {
display: none;
}
#chat .date-marker {
position: relative;
text-align: center;
@ -1733,30 +1770,48 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
width: 100%;
}
#connect .connect-row {
display: flex;
}
#connect .connect-row > .input,
#connect .connect-row > .input-wrap {
flex-grow: 1;
}
#connect label {
display: block;
width: 25%;
flex-shrink: 0;
margin-top: 11px;
}
#connect .port::before {
content: ":";
margin: 9px 0 0 -17px;
position: absolute;
}
#connect .tls {
float: left;
width: 100%;
display: block;
margin-top: 6px;
}
#connect .tls input {
float: left;
margin: 3px 10px 0 0;
}
#connect\:host {
width: 70%;
}
#connect\:port {
width: 25%;
}
#connect\:portseparator {
width: 5%;
text-align: center;
display: inline-block;
}
#connect .btn {
float: left;
margin-top: 30px;
margin-left: 25%;
margin-top: 15px;
}
#settings .settings-sync-panel {
@ -1797,16 +1852,10 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
margin-right: 6px;
}
#settings .extra-experimental {
color: #84ce88;
}
#settings .extra-experimental,
#settings .extra-help {
cursor: help;
}
#settings .extra-experimental,
#settings h2 .extra-help {
font-size: 0.8em;
}
@ -1853,13 +1902,13 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
#sign-in .password-container .reveal-password {
top: 31px;
right: 0;
}
.password-container .reveal-password {
position: absolute;
top: 2px;
right: 15px;
right: 0;
appearance: none;
}
.password-container .reveal-password span {
@ -1887,6 +1936,11 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
color: #ff4136;
}
#help .help-version-title {
display: flex;
justify-content: space-between;
}
#help .help-item {
display: table-row;
font-size: 14px;
@ -2522,6 +2576,7 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
@media (max-width: 479px) {
.container {
max-width: 100%;
margin: 0;
}
@ -2529,14 +2584,28 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
width: 100%;
}
#connect .tls {
margin: 20px 0;
}
.input {
margin-bottom: 2px;
}
#connect .connect-row {
flex-direction: column;
}
#connect .connect-row > .input,
#connect .connect-row > .input-wrap {
flex-grow: 1;
}
#connect .btn {
margin-left: 0;
width: 100%;
}
#help .help-version-title {
flex-direction: column;
}
#chat .messages {
display: block;
padding: 5px 0;

View File

@ -96,6 +96,7 @@
"mocha": "6.2.2",
"mochapack": "1.1.13",
"mousetrap": "1.6.3",
"normalize.css": "8.0.1",
"npm-run-all": "4.1.5",
"nyc": "14.1.1",
"postcss-import": "12.0.1",

View File

@ -5835,6 +5835,11 @@ normalize-url@^4.1.0:
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129"
integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==
normalize.css@8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/normalize.css/-/normalize.css-8.0.1.tgz#9b98a208738b9cc2634caacbc42d131c97487bf3"
integrity sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg==
npm-bundled@^1.0.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.1.tgz#1edd570865a94cdb1bc8220775e29466c9fb234b"