Add a popup explaining what a homeserver is
This commit is contained in:
parent
03ea22f7a8
commit
a5309a81b1
6 changed files with 99 additions and 11 deletions
35
package-lock.json
generated
35
package-lock.json
generated
|
@ -1095,6 +1095,11 @@
|
||||||
"to-fast-properties": "^2.0.0"
|
"to-fast-properties": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@popperjs/core": {
|
||||||
|
"version": "2.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.5.3.tgz",
|
||||||
|
"integrity": "sha512-RFwCobxsvZ6j7twS7dHIZQZituMIDJJNHS/qY6iuthVebxS3zhRY+jaC2roEKiAYaVuTcGmX6Luc6YBcf6zJVg=="
|
||||||
|
},
|
||||||
"@types/color-name": {
|
"@types/color-name": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
|
||||||
|
@ -2092,8 +2097,30 @@
|
||||||
"integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==",
|
"integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"define-properties": "^1.1.3",
|
"define-properties": "^1.1.3",
|
||||||
|
"es-abstract": "^1.18.0-next.0",
|
||||||
"has-symbols": "^1.0.1",
|
"has-symbols": "^1.0.1",
|
||||||
"object-keys": "^1.1.1"
|
"object-keys": "^1.1.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"es-abstract": {
|
||||||
|
"version": "1.18.0-next.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
|
||||||
|
"integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
|
||||||
|
"requires": {
|
||||||
|
"es-to-primitive": "^1.2.1",
|
||||||
|
"function-bind": "^1.1.1",
|
||||||
|
"has": "^1.0.3",
|
||||||
|
"has-symbols": "^1.0.1",
|
||||||
|
"is-callable": "^1.2.2",
|
||||||
|
"is-negative-zero": "^2.0.0",
|
||||||
|
"is-regex": "^1.1.1",
|
||||||
|
"object-inspect": "^1.8.0",
|
||||||
|
"object-keys": "^1.1.1",
|
||||||
|
"object.assign": "^4.1.1",
|
||||||
|
"string.prototype.trimend": "^1.0.1",
|
||||||
|
"string.prototype.trimstart": "^1.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3643,6 +3670,14 @@
|
||||||
"process": "~0.11.0"
|
"process": "~0.11.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"tippy.js": {
|
||||||
|
"version": "6.2.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.2.7.tgz",
|
||||||
|
"integrity": "sha512-k+kWF9AJz5xLQHBi3K/XlmJiyu+p9gsCyc5qZhxxGaJWIW8SMjw1R+C7saUnP33IM8gUhDA2xX//ejRSwqR0tA==",
|
||||||
|
"requires": {
|
||||||
|
"@popperjs/core": "^2.4.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"to-fast-properties": {
|
"to-fast-properties": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"browserify": "^17.0.0"
|
"browserify": "^17.0.0",
|
||||||
|
"tippy.js": "^6.2.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.11.1",
|
"@babel/core": "^7.11.1",
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
const tippy = require("tippy.js");
|
||||||
const {q, ElemJS, ejs} = require("./basic.js")
|
const {q, ElemJS, ejs} = require("./basic.js")
|
||||||
const {S_RE_DOMAIN, S_RE_IPV6, S_RE_IPV4} = require("./re.js")
|
const {S_RE_DOMAIN, S_RE_IPV6, S_RE_IPV4} = require("./re.js")
|
||||||
|
|
||||||
|
@ -52,6 +53,16 @@ class Username extends ElemJS {
|
||||||
class Homeserver extends ElemJS {
|
class Homeserver extends ElemJS {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(q("#homeserver"));
|
super(q("#homeserver"));
|
||||||
|
|
||||||
|
this.tippy = tippy.default(q("#homeserver-question"), {
|
||||||
|
content: q("#homeserver-popup-template").innerHTML,
|
||||||
|
allowHTML: true,
|
||||||
|
interactive: true,
|
||||||
|
interactiveBorder: 10,
|
||||||
|
trigger: "mouseenter",
|
||||||
|
theme: "carbon",
|
||||||
|
arrow: tippy.roundArrow,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
suggest(value) {
|
suggest(value) {
|
||||||
|
|
|
@ -22,11 +22,21 @@ html
|
||||||
input(name="password" autocomplete="current-password" type="password" required)#password
|
input(name="password" autocomplete="current-password" type="password" required)#password
|
||||||
|
|
||||||
.form-input-container
|
.form-input-container
|
||||||
|
.homeserver-label
|
||||||
label(for="homeserver") Homeserver
|
label(for="homeserver") Homeserver
|
||||||
|
span#homeserver-question (What's this?)
|
||||||
input(type="text" name="homeserver" placeholder="matrix.org")#homeserver
|
input(type="text" name="homeserver" placeholder="matrix.org")#homeserver
|
||||||
|
|
||||||
#feedback
|
#feedback
|
||||||
|
|
||||||
.form-input-container
|
.form-input-container
|
||||||
input(type="submit" value="Log in")#submit
|
input(type="submit" value="Log in")#submit
|
||||||
|
template#homeserver-popup-template
|
||||||
|
.homeserver-popup
|
||||||
|
p
|
||||||
|
| Homeserver is the place where your account lives.
|
||||||
|
| It's usually the website where you registered.
|
||||||
|
p
|
||||||
|
| Need help finding a homeserver?
|
||||||
|
a(href='#') Click here
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
@use "./base"
|
@use "./base"
|
||||||
@use "./colors.sass" as c
|
@use "./colors" as c
|
||||||
|
@use "./tippy"
|
||||||
|
|
||||||
.main
|
.main
|
||||||
justify-content: center
|
justify-content: center
|
||||||
|
@ -41,6 +42,27 @@
|
||||||
.form-error
|
.form-error
|
||||||
color: red
|
color: red
|
||||||
|
|
||||||
|
#homeserver-question
|
||||||
|
font-size: 0.6em
|
||||||
|
padding-left: 0.2em
|
||||||
|
|
||||||
|
.homeserver-label
|
||||||
|
display: flex
|
||||||
|
justify-content: space-between
|
||||||
|
align-items: flex-end
|
||||||
|
|
||||||
|
.homeserver-popup
|
||||||
|
p
|
||||||
|
margin: 0.2em
|
||||||
|
a
|
||||||
|
&, &:hover, &:active
|
||||||
|
color: white
|
||||||
|
text-decoration: none
|
||||||
|
&:hover
|
||||||
|
color: #f00 //Placeholder
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@keyframes spin
|
@keyframes spin
|
||||||
0%
|
0%
|
||||||
transform: rotate(0deg)
|
transform: rotate(0deg)
|
||||||
|
|
9
src/sass/tippy.sass
Normal file
9
src/sass/tippy.sass
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
@use "../../node_modules/tippy.js/dist/tippy.css"
|
||||||
|
@use "../../node_modules/tippy.js/dist/svg-arrow.css"
|
||||||
|
@use "./colors.sass" as c
|
||||||
|
|
||||||
|
.tippy-box[data-theme~="carbon"]
|
||||||
|
background-color: c.$milder
|
||||||
|
border: 2px solid c.$divider
|
||||||
|
.tippy-svg-arrow
|
||||||
|
fill: c.$milder
|
Loading…
Reference in a new issue