forked from scratch-bar/asdm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
152 lines (147 loc) · 8.19 KB
/
index.html
File metadata and controls
152 lines (147 loc) · 8.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<html>
<head>
<title>Auto Scratch Desktop Mirror</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" />
<link rel="shortcut icon" href="//www.google.com/s2/favicons?sz=64&domain=scratch.mit.edu">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FD23CNKF3B"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-FD23CNKF3B');
</script>
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@mdi/font@6.x/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
</head>
<body>
<div id="app">
<v-app>
<v-main>
<v-toolbar elevation="4">
<v-app-bar-nav-icon>
<v-icon>mdi-download-box-outline</v-icon>
</v-app-bar-nav-icon>
<v-toolbar-title>Auto Scratch-Desktop Mirror</v-toolbar-title>
</v-toolbar>
<v-container class="d-flex mt-5">
<v-row class="mx-5">
<v-col>
<div class="text-body-1">
Auto Scratch-Desktop Mirror 是一个基于 GitHub Workflow 的开源镜像项目,
它会每周自动从 Scratch 官方网站下载最新的 Scratch 3.0 安装包并上传至 (GitHub)
Release 提供给用户以供下载。
<p class="font-weight-light mt-2 text-caption">
项目开源于 <a href="https://github.com/scratch-bar/asdm">GitHub</a>,本版本由 waterblock79 开发。
<br />
感谢: Scratch Team, GitHub, Vue.js, Vuetify.js, Cnpmjs, FastGit 以及所有为这个项目添砖加瓦的人们!
<br />
友情链接: <a href="https://scratch.cf/">Mirror Scratch</a>
</p>
</div>
</v-col>
<v-col>
<v-card elevation="2">
<v-card-title>下载 Scratch 3.0</v-card-title>
<v-card-text>
未正确加载下载地址?请前往
<a href="https://hub.fastgit.xyz/waterblock79/asdm/releases/latest">FastGit 镜像</a>
或
<a href="https://github.com.cnpmjs.org/waterblock79/asdm/releases/latest">Cnpm
镜像站点</a>
下载。
<br />
同时,您也可以尝试 <a href="https://llk.github.io/scratch-gui/develop/">在线版本的 Scratch 3.0</a>
,或在应用商店中下载 <a
href="https://apps.apple.com/cn/app/scratch-desktop/id1446785996?mt=12">Mac OS
版本</a> 和 <a
href="https://www.microsoft.com/zh-cn/p/scratch-3/9pfgj25jl6x3">Windows 10
以上版本</a> 的 Scratch 桌面版。
<br />
<p class="mt-2 font-weight-bold">
该版本镜像于 {{ release.date }},Scratch 版本为 {{ release.scratch_version }}。
</p>
</v-card-text>
<v-card-actions>
<v-btn color="primary" v-bind:disabled="release.stat == 0"
v-bind:href="`https://${download_source}${release.url.windows}`" text>
<v-icon right>mdi-microsoft-windows</v-icon>
Windows 下载
</v-btn>
<v-btn color="primary" v-bind:disabled="release.stat == 0"
v-bind:href="`https://${download_source}${release.url.macos}`" text>
<v-icon right>mdi-apple</v-icon>
MacOS 下载
</v-btn>
</v-card>
<v-card elevation="2" class="mt-7">
<v-card-title>设置下载源</v-card-title>
<v-card-text>
通常情况下您<b>不需要更改下载源</b>,但如果默认下载源不可用,您可以更改为另外一个,或者自定义下载源。
<v-combobox v-model="download_source"
:items="['hub.fastgit.xyz','github.com']" label=""
dense></v-combobox>
</v-card-text>
</v-card>
</v-col>
</v-row>
</v-container>
</div>
</div>
</v-main>
</v-app>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.js"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script>
new Vue({
el: '#app',
vuetify: new Vuetify(),
data: {
release: {
stat: 0, // 0 => 加载中,1 => 加载成功,其他 => 加载失败:错误信息
url: {
windows: '',
macos: ''
},
date: '一周以内',
scratch_version: '未知'
},
download_source: 'hub.fastgit.xyz',
},
created: function () {
this.release.stat = 0
axios.get('https://api.github.com/repos/waterblock79/asdm/releases/latest')
.then(res => {
this.release.stat = 1
this.release.url.windows = res.data.assets.
filter((element) => { return (element['name'] == "scratch-win.exe") })[0]
.browser_download_url
.replace('https://github.com', '')
this.release.url.macos = res.data.assets.
filter((element) => { return (element['name'] == "scratch-mac.dmg") })[0]
.browser_download_url
.replace('https://github.com', '')
this.release.date = new Date(res.data.published_at).toLocaleString()
this.release.scratch_version = JSON.parse(res.data.body).scratch_version
})
.catch(err => {
this.release.stat = err.response.status
})
},
methods: {
toggle_custom_source: function() {
this.toggle_button_text = this.toggle_button_text == "自定义下载源" ? "选择下载源" : "自定义下载源"
if (this.toggle_button_text == "自定义下载源") { this.download_source = "hub.fastgit.xyz" }
}
}
})
</script>
</body>
</html>