66 lines
1.7 KiB
HTML
66 lines
1.7 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<title>electron-tabs-demo</title>
|
|
</head>
|
|
<body style="margin:0">
|
|
|
|
<tab-group new-tab-button="true" sortable="true">
|
|
<style>
|
|
/* If you use a custom titlebar, add drag ability to navigation bar */
|
|
/* Electron Documentation: https://www.electronjs.org/docs/latest/tutorial/custom-window-interactions#custom-draggable-regions */
|
|
.nav {-webkit-app-region: drag} /* Apply to navigation bar */
|
|
.tab {-webkit-app-region: no-drag} /* Unapply it from the tabs */
|
|
button {-webkit-app-region: no-drag} /* Unapply it from the buttons */
|
|
|
|
/* Add custom styles */
|
|
.my-badge {
|
|
background-color: #327BB1;
|
|
}
|
|
.my-custom-tab {
|
|
color: #d135d1;
|
|
font-style: italic;
|
|
font-weight: bold;
|
|
}
|
|
</style>
|
|
</tab-group>
|
|
|
|
<script src="../dist/electron-tabs.js"></script>
|
|
<script>
|
|
const tabGroup = document.querySelector("tab-group");
|
|
tabGroup.on("ready", () => console.info("TabGroup is ready"));
|
|
|
|
tabGroup.setDefaultTab({
|
|
title: "Opengist",
|
|
src: "https://gist.sudovanilla.org/all",
|
|
active: true,
|
|
ready: () => console.info("New Tab is ready")
|
|
});
|
|
|
|
tabGroup.addTab({
|
|
title: "electron-tabs | SudoVanilla Ark",
|
|
src: "https://ark.sudovanilla.org/Korbs/electron-tabs/",
|
|
badge: {
|
|
text: "5",
|
|
classname: "my-badge"
|
|
}
|
|
});
|
|
|
|
tabGroup.addTab({
|
|
title: "electron-tabs | SudoVanilla Registry",
|
|
src: "https://registry.sudovanilla.org/-/web/detail/@sudovanilla/electron-tabs",
|
|
iconURL: "mark-github.svg",
|
|
active: true
|
|
});
|
|
|
|
tabGroup.addTab({
|
|
title: "My Custom Tab",
|
|
src: "page.html",
|
|
ready: function(tab) {
|
|
tab.element.classList.add("my-custom-tab");
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|