button shortcode added

This commit is contained in:
zzossig 2020-02-02 02:58:22 +09:00
parent 21738fb572
commit a541461db4
14 changed files with 68 additions and 1 deletions

View File

@ -374,6 +374,7 @@ commento = false
matrix = ""
xmpp = ""
dev-to = ""
gitea = ""
[donationOptions]
enable = false # if set, the donation button will show up on the single page.

View File

@ -365,6 +365,7 @@ commento = false
matrix = ""
xmpp = ""
dev-to = ""
gitea = ""
[donationOptions]
enable = false # if set, the donation button will show up on the single page.

View File

@ -42,4 +42,5 @@ socialOptions:
matrix: ""
xmpp: ""
dev-to: ""
gitea: ""
---

View File

@ -0,0 +1,39 @@
.button {
position: relative;
display: inline-block;
padding: 3px 9px;
margin: 0.5rem;
cursor: pointer;
text-decoration: none !important;
border-radius: 0.25rem;
&__text {
margin: auto;
position: absolute;
top: 50%;
left: 50%;
@include translate(-50%, -50%);
}
@include themify($themes) {
&[data-color="default"] {
color: themed('link');
border: 1px solid themed('link');
@include on-event {
color: themed('link-hover');
border: 1px solid themed('link-hover');
}
}
&[data-color="primary"] {
color: themed('button-primary-color');
border: 1px solid themed('button-primary-color');
@include on-event {
color: themed('link-hover');
border: 1px solid themed('link-hover');
}
}
}
}

View File

@ -21,6 +21,12 @@ $theme_hacker_chroma_background: {{ .Site.Data.skin.theme_hacker_chroma_backgrou
$theme_solarized_chroma_background: {{ .Site.Data.skin.theme_solarized_chroma_background }};
$theme_kimbie_chroma_background: {{ .Site.Data.skin.theme_kimbie_chroma_background }};
$button_dark_primary_color: {{ .Site.Data.button.dark_primary_color }};
$button_light_primary_color: {{ .Site.Data.button.light_primary_color }};
$button_hacker_primary_color: {{ .Site.Data.button.hacker_primary_color }};
$button_solarized_primary_color: {{ .Site.Data.button.solarized_primary_color }};
$button_kimbie_primary_color: {{ .Site.Data.button.kimbie_primary_color }};
$title-font: {{ .Site.Data.font.title_font }};
$content-font: {{ .Site.Data.font.content_font }};
$cursive-font: {{ .Site.Data.font.cursive_font }};
@ -71,6 +77,7 @@ $cursive-font: {{ .Site.Data.font.cursive_font }};
@import 'components/codetab';
@import 'components/ie';
@import 'components/tab';
@import 'components/button';
@import 'pages/404';
@import 'pages/about';

View File

@ -106,4 +106,5 @@ $dark: (
share-shadow-color: #888,
share-background-color: lighten(#403E41, 2.5%),
donation-background-color: #525252,
button-primary-color: $button_dark_primary_color,
);

View File

@ -106,4 +106,5 @@ $hacker: (
share-shadow-color: #888,
share-background-color: #383b4c,
donation-background-color: #43454d,
button-primary-color: $button_hacker_primary_color,
);

View File

@ -2,7 +2,7 @@ $kimbie: (
footer-background-color: #423523,
footer-color: #d3af86,
link: #DC322F,
link-hover: #DC322F,
link-hover: #f06431,
title-color: #996329,
meta-color: #889b4a,
body-color: #e3b583,
@ -105,4 +105,5 @@ $kimbie: (
share-shadow-color: #828282,
share-background-color: #403c38,
donation-background-color: #52493c,
button-primary-color: $button_kimbie_primary_color,
);

View File

@ -105,4 +105,5 @@ $light: (
share-shadow-color: #727072,
share-background-color: #90a4ae,
donation-background-color: #eceff1,
button-primary-color: $button_light_primary_color,
);

View File

@ -104,4 +104,5 @@ $solarized: (
share-shadow-color: #727072,
share-background-color: #99907a,
donation-background-color: #c5e0df,
button-primary-color: $button_solarized_primary_color,
);

6
data/button.toml Normal file
View File

@ -0,0 +1,6 @@
# restart hugo after set the values
dark_primary_color = "#82aaff"
light_primary_color = "#728fcb"
hacker_primary_color = "#cddc39"
solarized_primary_color = "#689f38"
kimbie_primary_color = "#8ab1b0"

View File

@ -143,6 +143,7 @@ commento = false
matrix = ""
xmpp = ""
dev-to = ""
gitea = ""
[donationOptions]
enable = false

View File

@ -0,0 +1 @@
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" width="{{ .width }}" height="{{ .height }}"><path fill="currentColor" d="M4.186 5.421C2.341 5.417-.13 6.59.006 9.531c.213 4.594 4.92 5.02 6.801 5.057.206.862 2.42 3.834 4.059 3.99h7.18c4.306-.286 7.53-13.022 5.14-13.07-3.953.186-6.296.28-8.305.296v3.975l-.626-.277-.004-3.696c-2.306-.001-4.336-.108-8.189-.298-.482-.003-1.154-.085-1.876-.087zm.261 1.625h.22c.262 2.355.688 3.732 1.55 5.836-2.2-.26-4.072-.899-4.416-3.285-.178-1.235.422-2.524 2.646-2.552zm8.557 2.315c.15.002.303.03.447.096l.749.323-.537.979a.672.597 0 0 0-.241.038.672.597 0 0 0-.405.764.672.597 0 0 0 .112.174l-.926 1.686a.672.597 0 0 0-.222.038.672.597 0 0 0-.405.764.672.597 0 0 0 .86.36.672.597 0 0 0 .404-.765.672.597 0 0 0-.158-.22l.902-1.642a.672.597 0 0 0 .293-.03.672.597 0 0 0 .213-.112c.348.146.633.265.838.366.308.152.417.253.45.365.033.11-.003.322-.177.694-.13.277-.345.67-.599 1.133a.672.597 0 0 0-.251.038.672.597 0 0 0-.405.764.672.597 0 0 0 .86.36.672.597 0 0 0 .404-.764.672.597 0 0 0-.137-.202c.251-.458.467-.852.606-1.148.188-.402.286-.701.2-.99-.086-.289-.35-.477-.7-.65-.23-.113-.517-.233-.86-.377a.672.597 0 0 0-.038-.239.672.597 0 0 0-.145-.209l.528-.963 2.924 1.263c.528.229.746.79.49 1.26l-2.01 3.68c-.257.469-.888.663-1.416.435l-4.137-1.788c-.528-.228-.747-.79-.49-1.26l2.01-3.679c.176-.323.53-.515.905-.53h.064z"/></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,5 @@
<a href="{{ .Get "href" | default "#" }}" class="button" style="width: {{ .Get "width" | default "72px" }}; height: {{ .Get "height" | default "30px" }};" data-color="{{ .Get "color" | default "default" }}" target="_blank" rel="noreferrer">
<span class="button__text">
{{ .Inner | markdownify }}
</span>
</a>