-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlauncher.html
More file actions
176 lines (158 loc) · 5.2 KB
/
Copy pathlauncher.html
File metadata and controls
176 lines (158 loc) · 5.2 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html>
<!--
G A P P S L A U N C H E R
Reading the source? Good — you're probably an embedder.
This is the page you iframe. It runs entirely in your visitor's browser.
No server. No phone-home. No third-party requests. No cookies. No analytics.
Three query params (tile, text, hover) re-skin it for your site. Optional
`texthover` for contrast-aware themes. Optional postMessage for live re-theming.
Reports its rendered height back to the parent so you can size the iframe.
── Drop-in (always latest) ────────────────────────────────────────────────
<iframe src="https://gapps.benchkit-labs.dev/launcher.html?apps=mail,drive,docs"
style="border:none; width:100%; height:600px;"></iframe>
── Production pin (frozen at a tagged version via CDN) ─────────────────────
<iframe src="https://cdn.jsdelivr.net/gh/benchkit-labs/gapps@v1.0.0/gapps-launcher.html?apps=mail,drive,docs"
style="border:none; width:100%; height:600px;"></iframe>
── Live re-theme from the parent ──────────────────────────────────────────
iframe.contentWindow.postMessage({
type: 'gapps-embed-theme',
tileBg: '#ffffff',
textColor: '#202124',
hoverBg: '#f1f3f4',
textColorHover: '#202124' // optional — for contrast-aware themes
}, '*');
── Listen for height changes ──────────────────────────────────────────────
window.addEventListener('message', e => {
if (e.data.type === 'gapps-embed-height')
iframe.style.height = e.data.height + 'px';
});
That's the entire API surface. Full docs, configurator, and source:
github.com/benchkit-labs/gapps · MIT-licensed
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light">
<title>Gapps Embed Launcher</title>
<link rel="stylesheet" href="src/sprite.css">
<style>
:root {
--tile-bg: transparent;
--label-color: #3c4043;
--label-color-hover: var(--label-color);
--hover-bg: #f1f3f4;
}
body {
margin: 0;
padding: 0;
overflow-x: hidden;
background-color: transparent;
}
.app-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(var(--item-width), 1fr));
gap: 15px;
padding: 15px;
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
text-align: center;
--item-width: 100px;
width: 100%;
box-sizing: border-box;
}
.app-item {
text-decoration: none;
color: var(--label-color);
background-color: var(--tile-bg);
padding: 12px 5px;
border-radius: 8px;
transition: background 0.2s, box-shadow 0.2s, color 0.2s;
display: flex;
flex-direction: column;
align-items: center;
}
.app-item:hover {
background-color: var(--hover-bg);
color: var(--label-color-hover);
box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
transform: translateY(-1px);
}
.app-item:active {
background-color: color-mix(in srgb, var(--hover-bg) 96%, #000);
transition: background 0.05s, box-shadow 0.05s, transform 0.05s;
transform: translateY(0);
}
.app-item:focus {
outline: 2px solid #1f73e6;
outline-offset: 2px;
}
.app-item:focus:not(:focus-visible) {
outline: none;
}
.app-item:focus-visible {
outline: 2px solid #1f73e6;
outline-offset: 2px;
}
.app-name {
font-size: 13px;
font-weight: 400;
line-height: 1.4;
margin-top: 2px;
}
@media (max-width: 900px) {
.app-grid {
--item-width: 90px;
gap: 12px;
padding: 12px;
}
}
@media (max-width: 600px) {
.app-grid {
--item-width: 75px;
gap: 8px;
padding: 10px;
}
.app-item {
padding: 8px 4px;
min-height: 80px;
}
.sprite-icon {
transform: scale(0.7);
margin-bottom: -5px;
margin-top: -5px;
}
.app-name {
font-size: 11px;
word-wrap: break-word;
}
}
</style>
<script src="src/apps.js"></script>
<script src="src/filter.js"></script>
<script src="src/theme.js"></script>
</head>
<body>
<div id="grid"></div>
<script>
const { apps } = GAPPS.filter(location.search);
const grid = document.getElementById('grid');
grid.className = 'app-grid';
for (const a of apps) {
const el = document.createElement('a');
el.className = 'app-item';
el.target = '_blank';
el.rel = 'noopener noreferrer';
el.dataset.key = a.key;
el.dataset.continue = a.url;
if (a.shortcutHost) el.dataset.shortcutHost = a.shortcutHost;
el.href = a.url;
el.innerHTML = `<div class="sprite-icon icon-${a.key}"></div>
<div class="app-name">${a.name}</div>`;
grid.appendChild(el);
}
GAPPS.theme.applyDomainRewrites('#grid .app-item');
GAPPS.theme.applyQueryColors();
GAPPS.theme.startPostMessageListeners();
</script>
</body>
</html>