Skip to content

Commit 786ffc4

Browse files
committed
chore: update demo, fix messagebox and notification
1 parent 0aa548f commit 786ffc4

10 files changed

Lines changed: 49 additions & 21 deletions

File tree

Logo.png

625 KB
Loading

Logo.sketch

241 KB
Binary file not shown.

demo/index.html

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="cn">
2+
<html lang="zh">
33

44
<head>
55
<meta charset="UTF-8">
@@ -43,6 +43,14 @@
4343
<p>Checkbox</p>
4444
<swift-checkbox state="on">Checkbox</swift-checkbox>
4545
</div>
46+
<div class="row middle">
47+
<p>Messagebox</p>
48+
<swift-button primary onclick="summon_messagebox()">Show</swift-button>
49+
</div>
50+
<div class="row middle">
51+
<p>Notification</p>
52+
<swift-button primary onclick="summon_notification()">Show</swift-button>
53+
</div>
4654
<div class="row last" style="margin-bottom: 40px">
4755
<p>Progress</p>
4856
<div style="display: flex; flex-direction: column; gap: 25px;">
@@ -54,6 +62,23 @@
5462

5563
<!-- <script src="https://cdn.jsdelivr.net/gh/mengobs/webintosh-desktop/src/javascripts/ui/webswift.js"></script> -->
5664
<script src="../webswift.js"></script>
65+
<script>
66+
function summon_messagebox() {
67+
document.body.insertAdjacentHTML("beforeend", `<swift-messagebox iconpath="../Logo.png">
68+
<p slot="title">Messagebox</p>
69+
<p slot="text">This message box is part of WebSwift, designed with reference to Apple Design Resources.</p>
70+
<swift-button primary slot="button" onclick="this.parentNode.remove()">OK</swift-button>
71+
</swift-messagebox>`);
72+
}
73+
74+
function summon_notification() {
75+
document.body.insertAdjacentHTML("beforeend", `<swift-notification iconpath="../Logo.png">
76+
<p slot="title">Notification</p>
77+
<p slot="text">This notification is part of WebSwift, designed with reference to Apple Design Resources.</p>
78+
<p slot="time">now</p>
79+
</swift-notification>`);
80+
}
81+
</script>
5782
</body>
5883

5984
</html>

demo/style.css

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ body {
4040
src: url(./sf-pro-display_semibold.woff2);
4141
/* (C) 2019 Apple Inc. All rights reserved. */
4242
}
43-
p {
44-
margin: 0;
45-
}
46-
4743
div.overlay {
4844
position: fixed;
4945
inset: 0;
@@ -68,6 +64,9 @@ body > swift-window .row {
6864
display: inline-flex;
6965
justify-content: space-between;
7066
}
67+
body > swift-window .row p {
68+
margin: 0;
69+
}
7170
body > swift-window .row.first {
7271
margin-top: 20px;
7372
border-radius: 6px 6px 0 0;

demo/style.css.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.

demo/style.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ body {
4646
/* (C) 2019 Apple Inc. All rights reserved. */
4747
}
4848

49-
p {
50-
margin: 0;
51-
}
52-
5349
div.overlay {
5450
position: fixed;
5551
inset: 0;
@@ -75,6 +71,10 @@ body>swift-window {
7571
// align-items: center;
7672
justify-content: space-between;
7773

74+
p {
75+
margin: 0;
76+
}
77+
7878
&.first {
7979
margin-top: 20px;
8080
border-radius: 6px 6px 0 0;

docs/overrides/js/webswift.js

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

0 commit comments

Comments
 (0)