Skip to content

Commit

Permalink
Merge pull request #145 from manualdousuario/VoteFogo
Browse files Browse the repository at this point in the history
Altera botão de votar e exibição de traduzir e sem paywall
  • Loading branch information
Gabriel Nunes authored Jun 7, 2024
2 parents bbb65b0 + 90731ff commit 4758745
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 30 deletions.
1 change: 1 addition & 0 deletions assets/fogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions assets/vote.svg

This file was deleted.

10 changes: 5 additions & 5 deletions orbita.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Órbita
* Plugin URI: https://gnun.es
* Description: Órbita é o plugin para criar um sistema Hacker News-like para o Manual do Usuário
* Version: 1.13.1
* Version: 1.14
* Author: Gabriel Nunes
* Author URI: https://gnun.es
* License: GPL v3
Expand Down Expand Up @@ -40,7 +40,7 @@
/**
* Define plugin version constant
*/
define( 'ORBITA_VERSION', '1.13.1' );
define( 'ORBITA_VERSION', '1.14' );
define( 'ORBITA_IMAGE_MAX_SIZE', '10' ); // MB

/**
Expand Down Expand Up @@ -256,7 +256,7 @@ function orbita_get_vote_html( $post_id ) {
}

$html = '<button title="' . $title . '" class="orbita-vote-button ' . $additional_class . '" data-post-id="' . $post_id . '">';
$html .= ' <img loading="lazy" src="' . plugin_dir_url(__FILE__) . 'assets/vote.svg" alt="Votar" width="17" height="17" />';
$html .= ' <img loading="lazy" src="' . plugin_dir_url(__FILE__) . 'assets/fogo.svg" alt="Votar" width="17" height="17" />';
$html .= '</button>';

return $html;
Expand Down Expand Up @@ -635,10 +635,10 @@ function orbita_link_options( $url = '', $title = '' ) {

if ( $options ) {
if( isset( $options['paywall'] ) ) {
$html .= '<a href="' . $options['paywall'] . '">[sem&nbsp;paywall]</a>&nbsp;';
$html .= '<a href="' . $options['paywall'] . '" class="sem-paywall">sem&nbsp;paywall</a>&nbsp;';
}
if( isset( $options['translate'] ) ) {
$html .= '<a href="' . $options['translate'] . '">[traduzir]</a>&nbsp;';
$html .= '<a href="' . $options['translate'] . '" class="traduzir">traduzir</a>&nbsp;';
}
}

Expand Down
25 changes: 23 additions & 2 deletions public/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/main.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/main.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 38 additions & 18 deletions src/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ $desktop: "only screen and (min-width : 700px)";
max-width: inherit;
list-style: none;
margin: 0 0 1.5rem;
line-height: 1.5;
display: grid;
grid-template-columns: auto 1fr;
gap: 0px 12px;
gap: 0 1rem;
grid-template-areas:
"vote meta";
"vote meta";

}

.vote {
grid-area: vote;
text-align: center;
align-self: center;
min-width: 1.5rem;

button {
z-index: 2;
Expand All @@ -70,8 +70,8 @@ $desktop: "only screen and (min-width : 700px)";
grid-area: meta;
.title {
.link {
display: inline;
margin-bottom: 0;
display: inline;
margin-bottom: 0;
}
.domain {
color: #535353;
Expand All @@ -97,6 +97,22 @@ $desktop: "only screen and (min-width : 700px)";
}
}

a.traduzir,
a.sem-paywall {
padding: 2px 4px;
margin: 0 .5rem;
text-decoration: none;
border: 1px solid var(--cor-bordas);
border-radius: var(--med-borda);
background-color: var(--cor-destaques);
font-family: var(--ff-monospace);
font-size: var(--fs-0);
}
a.traduzir:hover,
a.sem-paywall:hover {
background-color: var(--cor-bordas);
}

.orbita-vote-can-vote {
cursor: pointer;
&:hover {
Expand All @@ -114,24 +130,28 @@ $desktop: "only screen and (min-width : 700px)";
color: #535353;
display: inline-block;
}
a.traduzir,
a.sem-paywall {
font-size: var(--fs-2);
}
}

.orbita-comment {
margin: 0 0 1.5rem;
line-height: 1.2;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);

@media #{$desktop} {
padding-bottom: 0;
border-bottom: 0;
}
&-content {
font-size: 95%;
font-family: var(--ff-monospace);
padding: 0 21px;
display: block;
}
padding-bottom: 0;
border-bottom: 0;
}

&-content {
font-size: 95%;
font-family: var(--ff-monospace);
padding: 0 21px;
display: block;
}
}

.orbita-header {
Expand All @@ -156,7 +176,7 @@ $desktop: "only screen and (min-width : 700px)";
&:visited {
color: var(--cor-link-ori);
}

&:hover {
color: var(--cor-link-est);
}
Expand Down

0 comments on commit 4758745

Please sign in to comment.