Skip to content

Commit cc0eaa5

Browse files
committed
Add github ribbon.
1 parent 819f835 commit cc0eaa5

File tree

10 files changed

+1192
-938
lines changed

10 files changed

+1192
-938
lines changed

docs/css/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/chunk-vendors.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/chunk-vendors.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package-lock.json

Lines changed: 1087 additions & 914 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"serve": "11.2.0",
1313
"vue": "^2.6.10",
1414
"vue-class-component": "^7.1.0",
15-
"vue-property-decorator": "^8.1.0"
15+
"vue-property-decorator": "^8.1.0",
16+
"vue-simple-alert": "1.1.1"
1617
},
1718
"devDependencies": {
1819
"@vue/cli-plugin-babel": "^3.12.0",

example/src/App.vue

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
<template>
22
<div id="app">
3+
<GithubRibbon url="https://github.com/constkhi/vue-simple-alert" />
4+
35
<header id="header">
4-
<img id="logo" alt="Vue logo" src="./assets/logo.png" />
5-
<h1>
6-
vue-simple-alert examples
7-
<small>({{ v }})</small>
8-
</h1>
6+
<div id="logo">
7+
<img id="logo-image" alt="Vue logo" src="./assets/logo.png" />
8+
</div>
9+
<div id="title">
10+
<h1>
11+
vue-simple-alert examples
12+
<small>({{ v }})</small>
13+
<h3>({{ des }})</h3>
14+
</h1>
15+
</div>
916
</header>
1017
<h2>Alert examples</h2>
1118
<div id="examples">
@@ -127,11 +134,15 @@
127134
<script lang="ts">
128135
import { Vue, Component } from "vue-property-decorator";
129136
import { SweetAlertOptions, SweetAlertResult } from "sweetalert2";
130-
import { version } from "vue-simple-alert/package.json";
137+
import { version, description } from "vue-simple-alert/package.json";
138+
import GithubRibbon from "@/components/GithubRibbon.vue";
131139
132-
@Component
140+
@Component({
141+
components: { GithubRibbon }
142+
})
133143
export default class App extends Vue {
134144
readonly v: string = version;
145+
readonly des: string = description;
135146
136147
alertExample0() {
137148
window.alert("This is normal alert.");
@@ -310,14 +321,21 @@ body {
310321
311322
h1 {
312323
font-weight: 500;
313-
font-size: 3em;
324+
font-size: 3rem;
314325
}
315326
h1 small {
316-
font-size: 0.5em;
327+
font-size: 1.25rem;
317328
}
318329
319330
h2 {
320331
font-weight: 500;
332+
font-size: 2rem;
321333
margin: 0 0 10px;
322334
}
335+
336+
h3 {
337+
font-weight: 200;
338+
font-size: 1.5rem;
339+
text-align: left;
340+
}
323341
</style>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<template>
2+
<a :href="url" class="github-corner" aria-label="View source on GitHub"
3+
><svg
4+
width="80"
5+
height="80"
6+
viewBox="0 0 250 250"
7+
style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;"
8+
aria-hidden="true"
9+
>
10+
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
11+
<path
12+
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
13+
fill="currentColor"
14+
style="transform-origin: 130px 106px;"
15+
class="octo-arm"
16+
></path>
17+
<path
18+
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
19+
fill="currentColor"
20+
class="octo-body"
21+
></path></svg
22+
></a>
23+
</template>
24+
25+
<script lang="ts">
26+
import { Vue, Component, Prop } from "vue-property-decorator";
27+
28+
@Component
29+
export default class App extends Vue {
30+
// props:
31+
@Prop({ type: String, required: true })
32+
private readonly url!: string;
33+
}
34+
</script>
35+
36+
<style>
37+
.github-corner:hover .octo-arm {
38+
animation: octocat-wave 560ms ease-in-out;
39+
}
40+
@keyframes octocat-wave {
41+
0%,
42+
100% {
43+
transform: rotate(0);
44+
}
45+
20%,
46+
60% {
47+
transform: rotate(-25deg);
48+
}
49+
40%,
50+
80% {
51+
transform: rotate(10deg);
52+
}
53+
}
54+
@media (max-width: 500px) {
55+
.github-corner:hover .octo-arm {
56+
animation: none;
57+
}
58+
.github-corner .octo-arm {
59+
animation: octocat-wave 560ms ease-in-out;
60+
}
61+
}
62+
</style>

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import Swal, {
66
} from "sweetalert2";
77

88
export class VueSimpleAlert {
9-
static globalOptions: SweetAlertOptions;
9+
public static globalOptions: SweetAlertOptions;
1010

11-
static alert(
11+
public static alert(
1212
message?: string,
1313
title?: string,
1414
type?: SweetAlertType,
@@ -33,7 +33,7 @@ export class VueSimpleAlert {
3333
});
3434
}
3535

36-
static confirm(
36+
public static confirm(
3737
message?: string,
3838
title?: string,
3939
type?: SweetAlertType,
@@ -60,7 +60,7 @@ export class VueSimpleAlert {
6060
});
6161
}
6262

63-
static prompt(
63+
public static prompt(
6464
message: string,
6565
defaultText?: string,
6666
title?: string,
@@ -92,7 +92,7 @@ export class VueSimpleAlert {
9292
});
9393
}
9494

95-
static fire(options: SweetAlertOptions): Promise<SweetAlertResult> {
95+
public static fire(options: SweetAlertOptions): Promise<SweetAlertResult> {
9696
return Swal.fire(options);
9797
}
9898

0 commit comments

Comments
 (0)