Skip to content

Commit

Permalink
Demo: Add button press effect and refactor styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
blueimp committed May 14, 2020
1 parent b0c5a3a commit da05026
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
45 changes: 26 additions & 19 deletions css/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,22 @@ textarea {
display: block;
overflow: auto;
}
button {
background: #3c76a7;
background: linear-gradient(180deg, #3c76a7, #225c8d);
border-color: #225c8d;
color: #fff;
}
button[type='submit'] {
background: #6fa349;
background: linear-gradient(180deg, #6fa349, #568a30);
border-color: #568a30;
}
button[type='reset'] {
background: #d79435;
background: linear-gradient(180deg, #d79435, #be7b1c);
border-color: #be7b1c;
}
select {
display: block;
padding-right: 2.25em;
Expand All @@ -116,6 +132,10 @@ select {
border-color: #225c8d;
color: #fff;
}
button:active,
select:active {
box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}
select::-ms-expand {
display: none;
}
Expand Down Expand Up @@ -151,6 +171,9 @@ input[type='file']::-webkit-file-upload-button {
border-radius: 5px;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.07);
}
input[type='file']::-webkit-file-upload-button:active {
box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}
input[type='file']::-ms-browse {
box-sizing: border-box;
margin: 0;
Expand All @@ -164,6 +187,9 @@ input[type='file']::-ms-browse {
border-radius: 5px;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.07);
}
input[type='file']::-ms-browse:active {
box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: light) {
body {
Expand Down Expand Up @@ -195,25 +221,6 @@ input[type='file']::-ms-browse {
}
}

#edit {
background: #3c76a7;
background: linear-gradient(180deg, #3c76a7, #225c8d);
border-color: #225c8d;
color: #fff;
}
#crop {
background: #6fa349;
background: linear-gradient(180deg, #6fa349, #568a30);
border-color: #568a30;
color: #fff;
}
#cancel {
background: #d79435;
background: linear-gradient(180deg, #d79435, #be7b1c);
border-color: #be7b1c;
color: #fff;
}

#result {
display: block;
}
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ <h3>Options</h3>
<h2>Result</h2>
<p id="actions" style="display: none;">
<button type="button" id="edit">Edit</button>
<button type="button" id="crop">Crop</button>
<button type="button" id="cancel">Cancel</button>
<button type="submit" id="crop">Crop</button>
<button type="reset" id="cancel">Cancel</button>
</p>
<figure id="result">
<figcaption style="display: none;">
Expand Down

0 comments on commit da05026

Please sign in to comment.