@esavoretti/flexmenu 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -2
- package/.github/workflows/publish.yaml +0 -26
- package/favicon.ico +0 -0
- package/index.html +0 -54
- package/index.js +0 -23
- package/runserver.py +0 -25
package/package.json
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esavoretti/flexmenu",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Menu web component with built-in flexibility to accommodate itself to mobile screens",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"web-components",
|
|
7
|
+
"custom-elements",
|
|
8
|
+
"flexmenu",
|
|
9
|
+
"responsive-menu",
|
|
10
|
+
"vanilla-js",
|
|
11
|
+
"mobile-menu",
|
|
12
|
+
"hamburger-menu"
|
|
13
|
+
],
|
|
5
14
|
"main": "flexmenu.js",
|
|
6
15
|
"type": "module",
|
|
7
16
|
"scripts": {
|
|
8
17
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
18
|
},
|
|
10
|
-
"keywords": [],
|
|
11
19
|
"author": "Domingo E. Savoretti <esavoretti@gmail.com> (https://sandy98.github.io/flexmenu)",
|
|
12
20
|
"repository": {
|
|
13
21
|
"type": "git",
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
name: Publish Package to NPM
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types: [published]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
publish:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
steps:
|
|
11
|
-
- name: Checkout repository code
|
|
12
|
-
uses: actions/checkout@v4
|
|
13
|
-
|
|
14
|
-
- name: Setup Node.js environment
|
|
15
|
-
uses: actions/setup-node@v4
|
|
16
|
-
with:
|
|
17
|
-
node-version: '20'
|
|
18
|
-
registry-url: 'https://npmjs.org'
|
|
19
|
-
|
|
20
|
-
- name: Install dependencies
|
|
21
|
-
run: npm install
|
|
22
|
-
|
|
23
|
-
- name: Publish to NPM
|
|
24
|
-
run: npm publish --access public
|
|
25
|
-
env:
|
|
26
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/favicon.ico
DELETED
|
Binary file
|
package/index.html
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>Flexible Menu Test</title>
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
|
7
|
-
<!--[if lt IE 9]><script src="js/html5shiv-printshiv.js" media="all"></script><![endif]-->
|
|
8
|
-
<link rel="stylesheet" href="styles.css" />
|
|
9
|
-
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
10
|
-
<script src="flexmenu.js"></script>
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
<!-- <hamburger-button></hamburger-button> -->
|
|
14
|
-
<flex-menu bg-color="teal">
|
|
15
|
-
<!-- <nav> -->
|
|
16
|
-
<menu-list menu-title="Sites">
|
|
17
|
-
<menu-item use-default-handler href="#home">Home</menu-item>
|
|
18
|
-
<div>River Plate, el más grande, lejos!</div>
|
|
19
|
-
<menu-item use-default-handler href="#contact">Contact</menu-item>
|
|
20
|
-
<span></span>
|
|
21
|
-
<menu-item use-default-handler href="#about">About</menu-item>
|
|
22
|
-
</menu-list>
|
|
23
|
-
<menu-list menu-title="Teams">
|
|
24
|
-
<menu-item use-default-handler href="#river">River Plate</menu-item>
|
|
25
|
-
<menu-item use-default-handler href="#boca">Boca Juniors</menu-item>
|
|
26
|
-
<menu-item use-default-handler href="#racing">Racing Club</menu-item>
|
|
27
|
-
<span></span>
|
|
28
|
-
<menu-list menu-title="2nd Division">
|
|
29
|
-
<menu-item use-default-handler href="#centralCordoba">Central Cordoba</menu-item>
|
|
30
|
-
<menu-item use-default-handler href="#argentino">Argentino</menu-item>
|
|
31
|
-
<menu-item use-default-handler href="#leonesRosario">Leones Rosario</menu-item>
|
|
32
|
-
</menu-list>
|
|
33
|
-
</menu-list>
|
|
34
|
-
<!-- </nav> -->
|
|
35
|
-
</flex-menu>
|
|
36
|
-
<div class="main">
|
|
37
|
-
<!-- <div class="stack"> -->
|
|
38
|
-
<!-- </div> -->
|
|
39
|
-
<hr>
|
|
40
|
-
<h3 class="title-header">
|
|
41
|
-
Flexible Menu Test Page
|
|
42
|
-
</h3>
|
|
43
|
-
<hr>
|
|
44
|
-
<!-- <p>
|
|
45
|
-
<button>Toggle Menu Item</button>
|
|
46
|
-
</p> -->
|
|
47
|
-
<div class="row centered">
|
|
48
|
-
<label for="loc-hash">Location: </label>
|
|
49
|
-
<span class="purple big cornered" id="loc-hash"></span>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
<script src="index.js"></script>
|
|
53
|
-
</body>
|
|
54
|
-
</html>
|
package/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
let flexmenu, hambutton;
|
|
3
|
-
|
|
4
|
-
document.addEventListener("DOMContentLoaded", () => {
|
|
5
|
-
console.log("Document loaded.");
|
|
6
|
-
flexmenu = document.querySelector('flex-menu');
|
|
7
|
-
hambutton = flexmenu.shadowRoot.querySelector('hamburger-button');
|
|
8
|
-
menuitem = document.querySelectorAll('menu-item')[0];
|
|
9
|
-
hambutton.addEventListener('hamburger-toggle', () => console.info(`Hamburger toggled: ${hambutton.isopen ? "open" : "closed"}`));
|
|
10
|
-
document.querySelectorAll('menu-item').forEach(mi => mi.addEventListener('click', ev => {
|
|
11
|
-
console.info(`Click on '${ev.currentTarget.textContent}'`);
|
|
12
|
-
}));
|
|
13
|
-
const hashChange = () => {
|
|
14
|
-
const content = location.hash.length > 1 ?
|
|
15
|
-
`${location.hash[1].toUpperCase()}${location.hash.slice(2)}` : "#";
|
|
16
|
-
document.querySelector('#loc-hash').textContent = content;
|
|
17
|
-
// document.querySelector('menu-item').unselect();
|
|
18
|
-
// if (content === "#") document.querySelectorAll('menu-item').forEach(mi => mi.unselect());
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
window.addEventListener('hashchange', hashChange);
|
|
22
|
-
hashChange();
|
|
23
|
-
});
|
package/runserver.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
import sys, http.server
|
|
5
|
-
|
|
6
|
-
def main():
|
|
7
|
-
HOST, PORT = '', 8086
|
|
8
|
-
print(f"Serving web content at ({HOST}, {PORT})")
|
|
9
|
-
server = http.server.ThreadingHTTPServer((HOST, PORT), http.server.SimpleHTTPRequestHandler)
|
|
10
|
-
try:
|
|
11
|
-
server.serve_forever()
|
|
12
|
-
except KeyboardInterrupt:
|
|
13
|
-
print("\nKeyboard interrupt.")
|
|
14
|
-
except Exception as exc:
|
|
15
|
-
print(f"\nUnknown exception: {exc}")
|
|
16
|
-
finally:
|
|
17
|
-
server.server_close()
|
|
18
|
-
print("\nBye")
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if __name__ == '__main__':
|
|
22
|
-
main()
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|