first commit
This commit is contained in:
commit
3d20b857ee
11 changed files with 1284 additions and 0 deletions
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
node_modules/
|
||||||
|
ios/
|
||||||
|
android/
|
||||||
|
.git/
|
||||||
43
README.md
Normal file
43
README.md
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
# Mac Folder con Capacitor
|
||||||
|
|
||||||
|
installa capacitor
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install @capacitor/core @capacitor/cli
|
||||||
|
```
|
||||||
|
|
||||||
|
inizializza capacitor
|
||||||
|
|
||||||
|
```
|
||||||
|
npx cap init "Mac Folder" com.mac.folder --web-dir=web
|
||||||
|
```
|
||||||
|
|
||||||
|
aggiungi Android
|
||||||
|
```
|
||||||
|
npm install @capacitor/android
|
||||||
|
npx cap add android
|
||||||
|
```
|
||||||
|
|
||||||
|
aggiungi ios
|
||||||
|
```
|
||||||
|
npm install @capacitor/ios
|
||||||
|
npx cap add ios
|
||||||
|
```
|
||||||
|
|
||||||
|
sincronizza
|
||||||
|
```
|
||||||
|
npx cap sync
|
||||||
|
```
|
||||||
|
|
||||||
|
apri il progetto android studio
|
||||||
|
```
|
||||||
|
npx cap open android
|
||||||
|
```
|
||||||
|
|
||||||
|
test rapido
|
||||||
|
```
|
||||||
|
cd web
|
||||||
|
python3 -m http.server 8080
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
5
capacitor.config.json
Normal file
5
capacitor.config.json
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"appId": "com.mac.folder",
|
||||||
|
"appName": "Mac Folder",
|
||||||
|
"webDir": "web"
|
||||||
|
}
|
||||||
1129
package-lock.json
generated
Normal file
1129
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
18
package.json
Normal file
18
package.json
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"name": "mac-folder-capacitor1",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"@capacitor/android": "^8.0.0",
|
||||||
|
"@capacitor/cli": "^8.0.0",
|
||||||
|
"@capacitor/core": "^8.0.0",
|
||||||
|
"@capacitor/ios": "^8.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
19
web/app.js
Normal file
19
web/app.js
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
async function loadApps() {
|
||||||
|
const container = document.getElementById("folder");
|
||||||
|
const apps = await fetch("apps.json").then(r => r.json());
|
||||||
|
|
||||||
|
apps.forEach(app => {
|
||||||
|
const div = document.createElement("div");
|
||||||
|
div.className = "app-icon";
|
||||||
|
div.onclick = () => window.open(app.url, "_blank", "noopener,noreferrer");
|
||||||
|
|
||||||
|
div.innerHTML = `
|
||||||
|
<img src="${app.icon}" alt="${app.name}">
|
||||||
|
<span>${app.name}</span>
|
||||||
|
`;
|
||||||
|
|
||||||
|
container.appendChild(div);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
loadApps();
|
||||||
12
web/apps.json
Normal file
12
web/apps.json
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "Google",
|
||||||
|
"icon": "icons/google.png",
|
||||||
|
"url": "https://google.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "GitHub",
|
||||||
|
"icon": "icons/github.png",
|
||||||
|
"url": "https://github.com"
|
||||||
|
}
|
||||||
|
]
|
||||||
BIN
web/icons/github.png
Normal file
BIN
web/icons/github.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
web/icons/google.png
Normal file
BIN
web/icons/google.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
12
web/index.html
Normal file
12
web/index.html
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="it">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Folder style macOS</title>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="folder" id="folder"></div>
|
||||||
|
<script src="app.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
42
web/style.css
Normal file
42
web/style.css
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
body {
|
||||||
|
background: #1e1e1e;
|
||||||
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
|
||||||
|
color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, 100px);
|
||||||
|
gap: 24px;
|
||||||
|
padding: 32px;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-icon {
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
transition: transform 0.15s ease, box-shadow 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-icon img {
|
||||||
|
width: 72px;
|
||||||
|
height: 72px;
|
||||||
|
border-radius: 20px;
|
||||||
|
box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-icon span {
|
||||||
|
display: block;
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-icon:hover {
|
||||||
|
transform: scale(1.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-icon:active {
|
||||||
|
transform: scale(0.97);
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue