do some revisions? ¯(°_o)/¯

This commit is contained in:
Amolith 2019-03-09 12:20:59 -05:00
parent c6830ad4c1
commit f26d231492
Signed by: Amolith
GPG Key ID: 51FD40936DB0065B
3 changed files with 23 additions and 16 deletions

View File

@ -198,6 +198,26 @@ div.crypto-card p {
background-color: #4f4f4fff; background-color: #4f4f4fff;
color: #FFFFFF; color: #FFFFFF;
} }
.tor {
border-radius: 8px;
border: 0px;
color: #4f4f4fff;
background-color: #7D4699;
padding: 16px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
cursor: pointer;
border: 2px solid #7D4699;
}
.tor:hover {
background-color: #4f4f4fff;
color: #7D4699;
}
.contact-card { .contact-card {
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.3); box-shadow: 0 4px 8px 0 rgba(0,0,0,0.3);
background: #4f4f4fff; background: #4f4f4fff;

17
app.js
View File

@ -4,10 +4,8 @@ $(function(){
var model = { var model = {
// renomear // renomear
dat: [ dat: [
], ],
read_json: function() { read_json: function() {
$.ajax({ $.ajax({
url: "/cards.json", url: "/cards.json",
dataType: 'json', dataType: 'json',
@ -19,7 +17,6 @@ $(function(){
}); });
} }
}); });
}, },
set_data: function(d) { set_data: function(d) {
model.dat.push(d); model.dat.push(d);
@ -40,15 +37,12 @@ $(function(){
$filter.push($d[i]); $filter.push($d[i]);
} }
}); });
return $filter; return $filter;
}, },
init: function() { init: function() {
model.read_json(); model.read_json();
} }
}; };
var octopus = { var octopus = {
init: function() { init: function() {
model.init(); model.init();
@ -57,13 +51,13 @@ $(function(){
}, },
create_card: function(d) { create_card: function(d) {
$.each(d, function(i){ $.each(d, function(i){
view.create_card(d[i].name, d[i].description, d[i].button_text, d[i].link); view.create_card(d[i].name, d[i].description, d[i].button_text, d[i].link, d[i].tor);
}); });
}, },
filter_data: function(c) { filter_data: function(c) {
var d = model.filter_data(c); var d = model.filter_data(c);
$.each(d, function(i){ $.each(d, function(i){
view.create_card(d[i].name, d[i].description, d[i].button_text, d[i].link); view.create_card(d[i].name, d[i].description, d[i].button_text, d[i].link, d[i].tor);
}); });
}, },
recreate_cards: function() { recreate_cards: function() {
@ -82,14 +76,11 @@ $(function(){
this.search_field.on('input',function(){ this.search_field.on('input',function(){
var $conteudo = $(this).val(); var $conteudo = $(this).val();
view.clean_cards(); view.clean_cards();
if($conteudo.length == 0){ if($conteudo.length == 0){
octopus.recreate_cards(); octopus.recreate_cards();
}else { }else {
octopus.filter_data($conteudo); octopus.filter_data($conteudo);
} }
}); });
}, },
create_card: function(name, desc, bt_txt, link){ create_card: function(name, desc, bt_txt, link){
@ -98,8 +89,6 @@ $(function(){
var $desc = $("<p>").text(desc); var $desc = $("<p>").text(desc);
var $button = $("<button>").addClass("button").text(bt_txt); var $button = $("<button>").addClass("button").text(bt_txt);
var $a = $("<a>").attr("href", link); var $a = $("<a>").attr("href", link);
$a.append($button); $a.append($button);
$card.append($h1).append($desc).append($a); $card.append($h1).append($desc).append($a);
this.container.append($card); this.container.append($card);
@ -108,7 +97,5 @@ $(function(){
this.container.empty(); this.container.empty();
} }
}; };
octopus.init(); octopus.init();
}); });

View File

@ -23,6 +23,6 @@ priority: 0.9
<!-- JS cards here --> <!-- JS cards here -->
</div> </div>
</div> </div>
<center><h1><u><a href="https://wiki.nixnet.xyz/shelves/nixnet" target="_blank">Technical information about NixNet</a></u></h1></center> <center><h1><u><a href="https://git.nixnet.xyz/NixNet/" target="_blank">Technical information about NixNet</a></u></h1></center>
<script src="/jquery-3.3.1.min.js" charset="utf-8"></script> <script src="/jquery-3.3.1.min.js" charset="utf-8"></script>
<script src="/app.js" charset="utf-8"></script> <script src="/app.js" charset="utf-8"></script>