Skip to content

Commit 3f49cf9

Browse files
committed
add windows install dialog and sponsorship prompt
1 parent 719f257 commit 3f49cf9

7 files changed

Lines changed: 55 additions & 27 deletions

File tree

downloadButton.js

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,59 @@
1-
function showMacDialog () {
1+
function showDialogBackdrop () {
22
var backdrop = document.createElement('div')
33
backdrop.className = 'backdrop'
44
document.body.appendChild(backdrop)
5+
backdrop.addEventListener('click', function () {
6+
backdrop.parentNode.removeChild(backdrop)
7+
var dialog = document.querySelector('.dialog')
8+
dialog.parentNode.removeChild(dialog)
9+
})
10+
}
11+
12+
var sponsorMessage = '\
13+
<div\
14+
style="box-shadow: 1px 0 10px 0 rgba(0,0,0,0.3);padding: 1em 3em;margin-left: -0.75em;margin-right: -0.75em;margin-top: 2em;border-radius: 6px;">\
15+
<h2 style="margin-bottom: 0.25em;margin-top: 0;"><i class="i carbon:favorite"\
16+
style="color: #ff0759;margin-left: -38px;margin-right: 12px;vertical-align: text-top;"></i>Help support Min\
17+
</h2>Sponsor this project to help it continue.<br><a style="margin-top: 1em; display: inline-block;"\
18+
href="https://github.com/sponsors/PalmerAL" target="_blank">Sponsor on GitHub <i class="i carbon:caret-right"\
19+
style="font-size: 1.3em;vertical-align: text-top;margin-top: -2px;display: inline-block;margin-left: -2px;"></i></a>\
20+
</div>\
21+
'
22+
23+
function showMacDialog () {
24+
showDialogBackdrop()
525

626
var dialog = document.createElement('div')
727
dialog.className = 'dialog centered'
8-
dialog.innerHTML = '<h1>How to install Min</h1>\
28+
dialog.innerHTML = '<h2>How to install</h2>\
929
<ul>\
1030
<li>Drag Min from your Downloads folder to the Applications folder.</li>\
1131
<li>Right click on Min.</li>\
1232
<li>Choose "Open".</li>\
1333
<li>If a warning dialog is shown, choose "Open".</li>\
14-
</ul>'
15-
16-
var dialogButton = document.createElement('button')
17-
dialogButton.className = 'button outlined-button outlined-button-white'
18-
dialogButton.setAttribute('style', 'display: block; margin: auto')
19-
dialogButton.textContent = 'Done'
20-
dialog.appendChild(dialogButton)
21-
dialogButton.addEventListener('click', function () {
22-
backdrop.parentNode.removeChild(backdrop)
23-
dialog.parentNode.removeChild(dialog)
24-
})
34+
</ul>' + sponsorMessage
35+
36+
document.body.appendChild(dialog)
37+
}
38+
39+
function showWindowsDialog () {
40+
showDialogBackdrop();
41+
42+
var dialog = document.createElement('div')
43+
dialog.className = 'dialog centered'
44+
dialog.innerHTML = '<h2>How to install</h2>\
45+
<ul>\
46+
<li>Start the installer.</li>\
47+
<li>If a warning dialog is shown, choose "More Info".</li>\
48+
<li>Choose "Run Anyway".</li>\
49+
<li>Wait for Min to open.</li>\
50+
</ul>' + sponsorMessage
2551

2652
document.body.appendChild(dialog)
2753
}
2854

2955
function showLinuxDialog (downloadLinks) {
30-
var backdrop = document.createElement('div')
31-
backdrop.className = 'backdrop'
32-
document.body.appendChild(backdrop)
33-
backdrop.addEventListener('click', function () {
34-
backdrop.parentNode.removeChild(backdrop)
35-
dialog.parentNode.removeChild(dialog)
36-
})
56+
showDialogBackdrop()
3757

3858
var dialog = document.createElement('div')
3959
dialog.className = 'dialog centered'
@@ -44,7 +64,7 @@ function showLinuxDialog (downloadLinks) {
4464
<h3> For RPM-based distributions:</h3>\
4565
<a id="download-rpm-link"><button id="download-rpm-button" class="button outlined-button outlined-button-white" style="display: block; margin: auto">Download .rpm</button></a>\
4666
<div>Install with <pre style="display: inline-block; margin-left: 0.5em">sudo rpm -i /path/to/download --ignoreos</pre> </div>\
47-
'
67+
' + sponsorMessage
4868

4969
dialog.querySelector('#download-deb-link').href = downloadLinks.deb
5070
dialog.querySelector('#download-rpm-link').href = downloadLinks.rpm
@@ -123,6 +143,10 @@ function setupDownloadButton (button) {
123143
button.addEventListener('click', function () {
124144
setTimeout(showMacDialog, 500)
125145
}, false)
146+
} else if (navigator.platform === 'Win32') {
147+
button.addEventListener('click', function () {
148+
setTimeout(showWindowsDialog, 500)
149+
}, false)
126150
}
127151
} else {
128152
button.parentElement.href = 'https://github.com/minbrowser/min/releases/latest'

ext/icons/iconfont.css

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

ext/icons/iconfont.woff2

88.2 KB
Binary file not shown.

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<link rel="canonical" href="https://minbrowser.org/" />
88
<link rel="stylesheet" href="splash/splash.css" />
99
<link rel="stylesheet" href="shared.css" />
10+
<link rel="stylesheet" href="ext/icons/iconfont.css"/>
1011
<meta name="viewport" content="width=device-width, initial-scale=1">
1112
<meta name="google-site-verification" content="7PAWDFl9SbEAc30K3yGSRE92L7SCpcAKDIWQKAVH7Q0" />
1213
</head>

releases/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<link rel="stylesheet" href="../shared.css" />
1313
<link rel="stylesheet" href="../markdown.css" />
1414
<link rel="stylesheet" href="releases.css" />
15-
<link rel="stylesheet" href="../ext/font-awesome-4.5.0/css/font-awesome.min.css" />
15+
<link rel="stylesheet" href="../ext/icons/iconfont.css"/>
1616
</head>
1717

1818
<body>
@@ -30,7 +30,7 @@ <h1 class="color-white">
3030
<div id="releases" class="markdown">
3131
</div>
3232
<a id="releases-older-link" href="https://github.com/minbrowser/min/releases">
33-
<i class="fa fa-angle-left"></i>
33+
<i class="i carbon:chevron-left"></i>
3434
Older releases
3535
</a>
3636

releases/releases.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
}
1717

1818
#releases-older-link i {
19-
font-size: 1.25em;
20-
margin-right: 0.25em;
19+
font-size: 1.1em;
2120
vertical-align: middle;
22-
margin-bottom: 0.2em;
21+
margin-top: -0.15em;
22+
display: inline-block;
2323
}

shared.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,10 @@ button.disabled {
238238
.dialog {
239239
position: fixed;
240240
background: #fff;
241-
padding: 1em 2em 2em 2em;
241+
padding: 1.25em 3em 2.5em 3em;
242242
overflow: auto;
243+
width: 60%;
244+
max-width: 600px;
243245
}
244246
.dialog h1,
245247
.dialog h2 {

0 commit comments

Comments
 (0)