Skip to content

Commit bcf4d42

Browse files
authored
Merge pull request #1 from CGWebDev2003/main
RESET
2 parents 82aa154 + c0dedfd commit bcf4d42

File tree

7 files changed

+393
-1
lines changed

7 files changed

+393
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/node_modules/
2+
/dev_example/

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.1.0] - 2023-05-05
11+
12+
### Added
13+
14+
-

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Neptune CSS
3+
Copyright (c) 2023 Neptune CSS contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

javascriptAPI.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/**
2+
*
3+
* @class
4+
*
5+
* @name Neptune_DOMElement
6+
*
7+
* @description Create a new HTML DOM element
8+
*
9+
* @param {string} parentId - ID of the parent element
10+
* @param {string} elementType - Is it a **div** or a **span**
11+
* @param {string} elementId - ID of the new DOM element
12+
*
13+
* @example
14+
* ```
15+
* const myDiv = new Neptune_DOMElement("body", "div", "testid");
16+
* ```
17+
*
18+
*/
19+
export default class Neptune_DOMElement {
20+
constructor(parentId, elementType, elementId) {
21+
this.parentId = parentId;
22+
this.elementType = elementType;
23+
this.elementId = elementId;
24+
25+
this.create();
26+
}
27+
28+
create() {
29+
// Create new element
30+
const newDOMElement = document.createElement(this.elementType);
31+
newDOMElement.id = this.elementId;
32+
33+
// Append new element to parent element
34+
const parentElement = document.getElementById(this.parentId);
35+
parentElement.appendChild(newDOMElement);
36+
}
37+
}
38+
39+
/**
40+
*
41+
* @class
42+
*
43+
* @name Neptune_Button
44+
* @description Create default button
45+
*
46+
* @param {string} parentId - ID of parent element
47+
* @param {string} elementType - Type of element is always ** * button * **
48+
* @param {string} buttonName - Button title
49+
* @param {string} elementId - ID of the new button element
50+
*
51+
* @example
52+
* const defaultButton = new Neptune_Button("body", "Default Button", "buttonID");
53+
*
54+
*/
55+
export class Neptune_Button extends Neptune_DOMElement {
56+
constructor(parentId, elementType, buttonName, elementId) {
57+
super(parentId, elementType = 'button', 'Test 123', elementId);
58+
this.buttonName = buttonName;
59+
this.create();
60+
}
61+
62+
create() {
63+
var newButton = new Neptune_DOMElement(this.parentId, "button", this.elementId);
64+
this.innerHTML = this.buttonName;
65+
}
66+
}

package-lock.json

Lines changed: 275 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)