Skip to content

Commit

Permalink
Deploy oreyes1991/prettyComponents to github.com/oreyes1991/prettyCom…
Browse files Browse the repository at this point in the history
…ponents.git:gh-pages
  • Loading branch information
traviscibot committed Nov 3, 2019
0 parents commit 880f495
Show file tree
Hide file tree
Showing 5 changed files with 1,353 additions and 0 deletions.
62 changes: 62 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.demo-box {
max-width: 400px;
border: 1px solid #d3d3d3;
padding: 1em;
border-radius: 3px;
background-color: #ffffff;
}

.props {
margin-top: .5em;
color: #666;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
}

.props > h4 {
border-bottom: 1px solid sandybrown;
grid-area: 1 / 1 / span 1 / span 4;
}

.props > div > h5 {
padding: 10px 0;
}

.props > div > div {
margin: 5px 1px;
padding: .2em .4em;
font-size: .9em;
background: #f2f4f5;
border: 1px solid #eee;
border-radius: 3px;
width: fit-content;
}


body {
height: 100vh;
background: #303030;
}

h1 {
font-style: italic;
padding: .5em;
color: #ffffff;
background: #e91e63;
margin-bottom: 10px;
}

.demo-layout {
display: grid;
grid-template-columns: 1fr 1fr;
padding: 1em 0;
margin: 0 1em;
border-radius: 0 0 4px 0;
}
.demo-layout > *{
justify-self: center;
}

.basic-dropdown .props {
grid-template-columns: 1fr 1fr;
}
6 changes: 6 additions & 0 deletions css/responsive.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@media only screen and (max-width: 600px) {
.demo-layout {
grid-template-columns: 1fr;
grid-row-gap: 20px;
}
}
135 changes: 135 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>pComponents</title>
<script>
function myFunction(e) {
const type = e.target.parentNode.getAttribute('type');
alert('you press: '+ type + ' Button');
}
function changeFunc(e) {
alert('click on ' + e.innerHTML);
}
function placement(e, ...params) {
const el = params[1]; // dropdown
el.setAttribute('placement', e.innerHTML);
}
</script>
<link rel="stylesheet" href="./css/main.css">
<link rel="stylesheet" href="./css/responsive.css">
<script src="https://kit.fontawesome.com/f4734fa782.js"></script>
</head>
<body>
<h1> pComponents </h1>
<div class="demo-layout">
<div class="basic-buttons demo-box">
<h3> Basic Buttons </h3>
<pretty-button
value="Primary"
type="primary"
onclick="myFunction"
>
</pretty-button>
<pretty-button
value="Danger"
type="danger"
onclick="myFunction"
>
</pretty-button>
<pretty-button
value="Default"
type="default"
onclick="myFunction"
>
</pretty-button>
<pretty-button
value="Dashed"
type="dashed"
onclick="myFunction"
>
</pretty-button>
<pretty-button
value="Link"
type="link"
onclick="myFunction"
>
</pretty-button>
<div class="props">
<h4> Attributes </h4>
<div>
<h5> Type </h5>
<div> primary </div>
<div> danger </div>
<div> default </div>
<div> dashed </div>
<div> link </div>
</div>
<div>
<h5> onclick </h5>
<div> myFunction </div>
<p> Callback function will be trigger on click </p>
</div>
<div>
<h5> value </h5>
<div> buttonName </div>
<p> value that would be display in the button </p>
</div>
<div>
<h5> size </h5>
<div> small </div>
<div> large </div>
<div> default </div>
</div>
</div>
<div>
<i class="fab fa-codepen"></i>
</div>
</div>
<div class="basic-dropdown demo-box">
<h3> Basic DropDown </h3>
<pretty-button value="DropDown" id="my-target">

</pretty-button>
<pretty-button type="dashed" value="Placement" id="placement">

</pretty-button>
<pretty-dropdown target="my-target" onchange="changeFunc">
<div class="p-menu-item">
1st Menu Item
</div>
<div class="p-menu-divider"></div>
<div class="p-menu-item">
2nd Menu Item
</div>
<div class="p-menu-item" disabled>
3nd Menu Item
</div>
</pretty-dropdown>
<pretty-dropdown target="placement" onchange="placement">
<div class="p-menu-item">bottom-left</div>
<div class="p-menu-item">bottom-center</div>
<div class="p-menu-item" >bottom-right</div>
<div class="p-menu-divider"></div>
<div class="p-menu-item">top-left</div>
<div class="p-menu-item">top-center</div>
<div class="p-menu-item">top-right</div>
</pretty-dropdown>
<div class="props">
<h4> Attributes </h4>
<div>
<h5> target </h5>
<div> id-target </div>
</div>
<div>
<h5> onchange </h5>
<div> functionName </div>
<p> Callback function will be trigger on change </p>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="main.js"></script></body>
</html>
1,149 changes: 1,149 additions & 0 deletions main.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions main.js.map

Large diffs are not rendered by default.

0 comments on commit 880f495

Please sign in to comment.