Login para ModerNBB
2 participantes
Fórum dos Fóruns :: Ajuda e atendimento ao utilizador :: Questões sobre códigos :: Questões resolvidas sobre códigos Javascript e jQuery
Página 1 de 1
Login para ModerNBB
Detalhes da questão
Endereço do fórum: http://www.ultimatelife.forumeiros.com
Versão do fórum: PunBB
Descrição
Gostaria de mudar esse código do PuNBB para ModerNBB:
Código:
- Código:
/*globals jQuery, _userdata*/
(function ($) {
'use strict';
var $loginPopover;
$(function () {
if (_userdata["session_logged_in"] !== 0) {
return;
}
$('a[href="/login"]').on('click', function (event) {
event.preventDefault();
event.stopPropagation();
if ($('.fa-popover-login').length > 0) {
$loginPopover.slideUp(300, function () {
$loginPopover.remove();
});
return;
}
var $this = $(this);
/**
* Variáveis de posição:
*/
var pos = $this.offset();
var posY = pos.top;
var posX = pos.left;
var mgnL = $this.innerWidth() / 2;
var mgnT = $this.innerHeight();
$loginPopover = $([
'<div class="fa-popover-login">',
' <div class="fa-popover-intro">',
' <span class="h3">Login</span>',
' </div>',
' <form action="/login" method="post" name="form_login">',
' <div class="input-group">',
' <label for="username">Usuário:</label>',
' <input type="text" name="username" id="username" maxlength="40" />',
' <label for="password">Senha:</label>',
' <input type="password" id="password" name="password" maxlength="25" />',
' </div>',
' <input type="checkbox" name="autologin" id="autologin" checked="checked" />',
' <label for="autologin">Conexão automática.</label>',
' <footer>',
' <input type="submit" name="login" value="Conectar-se" class="submit-btn" />',
' <a href="/profile?mode=sendpassword">Esqueci a senha</a>',
' </footer>',
' </form>',
'</div>',
].join('\n'))
.hide()
.appendTo('body')
.slideDown(300)
.css({
top: posY + 'px',
left: posX + 'px',
marginLeft: mgnL + 'px',
marginTop: mgnT + 'px',
position: 'absolute',
transform: 'translateX(-50%)'
})
.on('click', function (event) {
event.stopPropagation();
})
;
});
$(document).on('click', function (event) {
if ($('.fa-popover-login').length > 0) {
$loginPopover.slideUp(300, function () {
$loginPopover.remove();
});
}
});
var styles = [
'.fa-popover-login {',
' background-color: #333;',
' -webkit-box-shadow: rgba(93,97,102,0.25) 0px 0px 0px 1px, 0px 7px 10px rgba(0, 0, 0, 0.2), 0px 5px 20px rgba(0,0,0,0.1);',
' -moz-box-shadow: rgba(93,97,102,0.25) 0px 0px 0px 1px, 0px 7px 10px rgba(0, 0, 0, 0.2), 0px 5px 20px rgba(0,0,0,0.1);',
' -ms-box-shadow: rgba(93,97,102,0.25) 0px 0px 0px 1px, 0px 7px 10px rgba(0, 0, 0, 0.2), 0px 5px 20px rgba(0,0,0,0.1);',
' -o-box-shadow: rgba(93,97,102,0.25) 0px 0px 0px 1px, 0px 7px 10px rgba(0, 0, 0, 0.2), 0px 5px 20px rgba(0,0,0,0.1);',
' box-shadow: rgba(93,97,102,0.25) 0px 0px 0px 1px, 0px 7px 10px rgba(0, 0, 0, 0.2), 0px 5px 20px rgba(0,0,0,0.1);',
' width: 265px;',
' border-radius: 2px;',
' padding: 15px;',
' font-size: 16px;',
' z-index: 999999999999999999999999;',
' font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',
'}',
'',
'.fa-popover-login,',
'.fa-popover-login * {',
' box-sizing: border-box;',
'}',
'',
'.fa-popover-intro .h3 {',
' font-family: "Trebuchet MS", "Segoe UI", Helvetica, "Helvetica Neue", Arial, "Open Sans", Lato, sans-serif;',
' font-size: 20px;',
' color: #fff;',
' border-bottom: solid 0px;',
' width: 100%;',
' display: block;',
' margin: 0px;',
'}',
'',
'.fa-popover-login form {',
' margin: 10px -15px;',
' padding: 15px;',
' margin-bottom: 0px;',
' padding-bottom: 0px;',
' border-top: solid 1px #ddd;',
'}',
'',
'.fa-popover-login form div.input-group label {',
' display: block;',
' margin-bottom: 5px;',
' color: #656565;',
' font-size: 14px;',
'}',
'',
'.fa-popover-login form div.input-group label[for="password"] {',
' margin-top: 14px;',
'}',
'',
'.fa-popover-login form div.input-group input {',
' display: block;',
' width: 100%;',
' padding: 6px 10px;',
' font-size: 12px;',
' line-height: 1.70;',
' color: #464a4c;',
' background-color: #fff;',
' background-image: none;',
' -webkit-background-clip: padding-box;',
' background-clip: padding-box;',
' border: 1px solid rgba(0,0,0,.15);',
' border-radius: 2px;',
' -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;',
' transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;',
' -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;',
' transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;',
' transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;',
'}',
'',
'.fa-popover-login form div.input-group input:focus {',
' color: #464a4c;',
' background-color: #fff;',
' border-color: #5cb3fd;',
' outline: 0;',
'}',
'',
'.fa-popover-login label[for="autologin"] {',
' margin-top: 15px;',
' display: inline-block;',
'}',
'',
'.fa-popover-login footer {',
' background-color: #ddd;',
' padding: 10px;',
' margin: -15px;',
' margin-top: 15px;',
' position: relative;',
'}',
'',
'.fa-popover-login footer a {',
' color: #fff;',
' position: absolute;',
' right: 11px;',
' top: 47%;',
' -webkit-transform: translateY(-50%);',
' -moz-transform: translateY(-50%);',
' -ms-transform: translateY(-50%);',
' -o-transform: translateY(-50%);',
' transform: translateY(-50%);',
'}',
'',
'.fa-popover-login footer a:hover {',
' border-color: #39c;',
'}',
'',
'.fa-popover-login footer input {',
' border: none;',
' background-color: #2196F3;',
' color: #fff;',
' cursor: pointer;',
' padding: 4px 8px;',
'}',
'',
'.fa-popover-login footer input:hover {',
' background-color: #444;',
'}',
'',
'.fa-popover-login::before {',
' content: "";',
' position: absolute;',
' height: 15px;',
' width: 15px;',
' background-color: #333;',
' top: -2px;',
' left: 50%;',
' -webkit-transform: rotate(45deg) translateX(-50%);',
' -moz-transform: rotate(45deg) translateX(-50%);',
' -ms-transform: rotate(45deg) translateX(-50%);',
' -o-transform: rotate(45deg) translateX(-50%);',
' transform: rotate(45deg) translateX(-50%);',
' border: solid 1px transparent;',
'}',
].join('\n');
$(['<style type="text/css">', styles, '</style>'].join('\n')).insertBefore('head > link[rel="stylesheet"]:first');
});
}(jQuery));
Última edição por iScroll em 08.10.17 18:04, editado 1 vez(es)
Re: Login para ModerNBB
Eu testei o código em meu fórum e funcionou perfeitamente. O senhor poderia me dizer exatamente qual é o problema que está enfrentando? o/
Re: Login para ModerNBB
Funcionar ele funciona, mas veja:
A caixa é assim: http://prntscr.com/guts3n
Ele está assim: http://prntscr.com/guts86
Sendo que todo o CSS já está nela..
A caixa é assim: http://prntscr.com/guts3n
Ele está assim: http://prntscr.com/guts86
Sendo que todo o CSS já está nela..
Re: Login para ModerNBB
Troque por:
- Código:
/*globals jQuery, _userdata*/
(function ($) {
'use strict';
var $loginPopover;
$(function () {
if (_userdata["session_logged_in"] !== 0) {
return;
}
$('a[href="/login"]').on('click', function (event) {
event.preventDefault();
event.stopPropagation();
if ($('.fa-popover-login').length > 0) {
$loginPopover.slideUp(300, function () {
$loginPopover.remove();
});
return;
}
var $this = $(this);
/**
* Variáveis de posição:
*/
var pos = $this.offset();
var posY = pos.top;
var posX = pos.left;
var mgnL = $this.innerWidth() / 2;
var mgnT = $this.innerHeight();
$loginPopover = $([
'<div class="fa-popover-login">',
' <div class="fa-popover-intro">',
' <span class="h3">Login</span>',
' </div>',
' <form action="/login" method="post" name="form_login">',
' <div class="input-group">',
' <label for="username">Usuário:</label>',
' <input type="text" name="username" id="username" maxlength="40" /></div><div class="input-group">',
' <label for="password">Senha:</label>',
' <input type="password" id="password" name="password" maxlength="25" />',
' </div>',
' <input type="checkbox" name="autologin" id="autologin" checked="checked" />',
' <label for="autologin" style="color: #fff !important;">Conexão automática.</label>',
' <footer>',
' <input type="submit" name="login" value="Conectar-se" class="submit-btn" />',
' <a href="/profile?mode=sendpassword">Esqueci a senha</a>',
' </footer>',
' </form>',
'</div>',
].join('\n'))
.hide()
.appendTo('body')
.slideDown(300)
.css({
top: posY + 'px',
left: posX + 'px',
marginLeft: mgnL + 'px',
marginTop: mgnT + 'px',
position: 'absolute',
transform: 'translateX(-50%)'
})
.on('click', function (event) {
event.stopPropagation();
})
;
});
$(document).on('click', function (event) {
if ($('.fa-popover-login').length > 0) {
$loginPopover.slideUp(300, function () {
$loginPopover.remove();
});
}
});
var styles = [
'.fa-popover-login {',
' background-color: #333;',
' -webkit-box-shadow: rgba(93,97,102,0.25) 0px 0px 0px 1px, 0px 7px 10px rgba(0, 0, 0, 0.2), 0px 5px 20px rgba(0,0,0,0.1);',
' -moz-box-shadow: rgba(93,97,102,0.25) 0px 0px 0px 1px, 0px 7px 10px rgba(0, 0, 0, 0.2), 0px 5px 20px rgba(0,0,0,0.1);',
' -ms-box-shadow: rgba(93,97,102,0.25) 0px 0px 0px 1px, 0px 7px 10px rgba(0, 0, 0, 0.2), 0px 5px 20px rgba(0,0,0,0.1);',
' -o-box-shadow: rgba(93,97,102,0.25) 0px 0px 0px 1px, 0px 7px 10px rgba(0, 0, 0, 0.2), 0px 5px 20px rgba(0,0,0,0.1);',
' box-shadow: rgba(93,97,102,0.25) 0px 0px 0px 1px, 0px 7px 10px rgba(0, 0, 0, 0.2), 0px 5px 20px rgba(0,0,0,0.1);',
' width: 265px;',
' border-radius: 2px;',
' padding: 15px;',
' font-size: 16px;',
' z-index: 999999999999999999999999;',
' font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',
'}',
'',
'.fa-popover-login,',
'.fa-popover-login * {',
' box-sizing: border-box;',
'}',
'',
'.fa-popover-intro .h3 {',
' font-family: "Trebuchet MS", "Segoe UI", Helvetica, "Helvetica Neue", Arial, "Open Sans", Lato, sans-serif;',
' font-size: 20px;',
' color: #fff;',
' border-bottom: solid 0px;',
' width: 100%;',
' display: block;',
' margin: 0px;',
'}',
'',
'.fa-popover-login form {',
' margin: 10px -15px;',
' padding: 15px;',
' margin-bottom: 0px;',
' padding-bottom: 0px;',
' border-top: solid 1px #ddd;',
'}',
'',
'.fa-popover-login form div.input-group label {',
' display: block;',
' margin-bottom: 5px;',
' color: #656565;',
' font-size: 14px;',
'}',
'',
'.fa-popover-login form div.input-group label[for="password"] {',
' margin-top: 14px;',
'}',
'',
'.fa-popover-login form div.input-group input {',
' display: block;',
' width: 100%;',
' padding: 6px 10px;',
' font-size: 12px;',
' line-height: 1.70;',
' color: #464a4c;',
' background-color: #fff;',
' background-image: none;',
' -webkit-background-clip: padding-box;',
' background-clip: padding-box;',
' border: 1px solid rgba(0,0,0,.15);',
' border-radius: 2px;',
' -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;',
' transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;',
' -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;',
' transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;',
' transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;',
'}',
'',
'.fa-popover-login form div.input-group input:focus {',
' color: #464a4c;',
' background-color: #fff;',
' border-color: #5cb3fd;',
' outline: 0;',
'}',
'',
'.fa-popover-login label[for="autologin"] {',
' margin-top: 15px;',
' display: inline-block;',
'}',
'',
'.fa-popover-login footer {',
' background-color: #ddd;',
' padding: 10px;',
' margin: -15px;',
' margin-top: 15px;',
' position: relative;',
'}',
'',
'.fa-popover-login footer a {',
' color: #fff;',
' position: absolute;',
' right: 11px;',
' top: 47%;',
' -webkit-transform: translateY(-50%);',
' -moz-transform: translateY(-50%);',
' -ms-transform: translateY(-50%);',
' -o-transform: translateY(-50%);',
' transform: translateY(-50%);',
'}',
'',
'.fa-popover-login footer a:hover {',
' border-color: #39c;',
'}',
'',
'.fa-popover-login footer input {',
' border: none;',
' background-color: #2196F3;',
' color: #fff;',
' cursor: pointer;',
' padding: 4px 8px;',
'}',
'',
'.fa-popover-login footer input:hover {',
' background-color: #444;',
'}',
'',
'.fa-popover-login::before {',
' content: "";',
' position: absolute;',
' height: 15px;',
' width: 15px;',
' background-color: #333;',
' top: -2px;',
' left: 50%;',
' -webkit-transform: rotate(45deg) translateX(-50%);',
' -moz-transform: rotate(45deg) translateX(-50%);',
' -ms-transform: rotate(45deg) translateX(-50%);',
' -o-transform: rotate(45deg) translateX(-50%);',
' transform: rotate(45deg) translateX(-50%);',
' border: solid 1px transparent;',
'}',
'.input-group {',
' display: flex;',
' align-items: center;',
' margin-bottom: 6px;',
'}',
'',
'body .fa-popover-login > form > div.input-group > label, body .fa-popover-login > form > div.input-group > input {',
' margin: 0 !important;',
'}',
].join('\n');
$(['<style type="text/css">', styles, '</style>'].join('\n')).insertBefore('head > link[rel="stylesheet"]:first');
});
}(jQuery));
Re: Login para ModerNBB
Resultou, só mais uma coisa.
O
Veja o original: http://prntscr.com/gutxqa
O
- Código:
:before
Veja o original: http://prntscr.com/gutxqa
Re: Login para ModerNBB
Adicione mais este código em sua Folha de Estilos:
- Código:
body .fa-popover-login {
overflow: visible !important;
margin-top: 15px !important;
}
Re: Login para ModerNBB
Questão marcada como Resolvida ou o Autor solicitou que ela fosse arquivada. Tópico marcado como Resolvido e movido para Questões resolvidas. |
Tópicos semelhantes
» Conversão de código para ModernBB
» Perfil para ModerNBB
» Neve para ModerNBB
» Caixa de Mensagem para ModerNBB
» Transferir código para ModerNBB
» Perfil para ModerNBB
» Neve para ModerNBB
» Caixa de Mensagem para ModerNBB
» Transferir código para ModerNBB
Fórum dos Fóruns :: Ajuda e atendimento ao utilizador :: Questões sobre códigos :: Questões resolvidas sobre códigos Javascript e jQuery
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos