mirror of
https://github.com/10h30/full-screen-morphing-search.git
synced 2026-06-05 15:08:32 +09:00
15032e81d8
Remove transition css, change color
383 lines
8.1 KiB
CSS
383 lines
8.1 KiB
CSS
/**
|
|
* Morphing Search Page Styles
|
|
*/
|
|
|
|
/* 1- hide the main div (<div id="morphsearch" class="morphsearch">) containing the Morphing Search Page */
|
|
|
|
.morphsearch:not(.open) {
|
|
overflow: hidden;
|
|
opacity: 0;
|
|
-webkit-transform: scale(0);
|
|
-ms-transform: scale(0);
|
|
transform: scale(0);
|
|
-webkit-transition: 0s;
|
|
-o-transition: 0s;
|
|
transition: 0s;
|
|
}
|
|
|
|
/* 2- Showing the Morphing Search Page once the .open class is added to the main div */
|
|
.morphsearch {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
overflow: hidden;
|
|
border: 0 solid transparent;
|
|
min-height: 50px;
|
|
background-color: rgba(20,20,20,0.95);
|
|
-webkit-transition: 0s;
|
|
-o-transition: 0s;
|
|
transition: 0s;
|
|
-webkit-box-align: center;
|
|
-ms-flex-align: center;
|
|
align-items: center;
|
|
justify-content: start;
|
|
flex-direction: column;
|
|
position: fixed;
|
|
z-index: 9998;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
height: 100vh;
|
|
padding: 50px 10%;
|
|
}
|
|
|
|
/* Morphing Search Page Search Form */
|
|
|
|
.morphsearch-form {
|
|
width: 100%;
|
|
margin: 0 auto;
|
|
position: relative;
|
|
margin-top: 30px;
|
|
}
|
|
|
|
|
|
|
|
/* Morphing Search Page Search Input */
|
|
|
|
.morphsearch-input {
|
|
padding: 0 10px 0 10px !important;
|
|
border-width: 0 0 1px!important;
|
|
background: transparent !important;
|
|
font-size: 5em;
|
|
|
|
}
|
|
|
|
#morphsearch .morphsearch-input {
|
|
width: 100%;
|
|
height: 100%;
|
|
/* font-style: italic; */
|
|
color: #FFF;
|
|
outline: none;
|
|
/* Using ID '#morphsearch' to avoid using !important */
|
|
}
|
|
|
|
.morphsearch-input::-ms-clear {
|
|
/* remove cross in IE */
|
|
display: none;
|
|
}
|
|
|
|
.morphsearch.open .morphsearch-input {
|
|
font-size: 5em;
|
|
}
|
|
|
|
/* Morphing Search Page Search Placeholder */
|
|
|
|
.morphsearch-input::-webkit-input-placeholder {
|
|
color: var(--morphsearch-input-placeholder, #c2c2c2);
|
|
}
|
|
|
|
.morphsearch-input:-moz-placeholder {
|
|
color: var(--morphsearch-input-placeholder, #c2c2c2);
|
|
}
|
|
|
|
.morphsearch-input::-moz-placeholder {
|
|
color: var(--morphsearch-input-placeholder, #c2c2c2);
|
|
}
|
|
|
|
.morphsearch-input:-ms-input-placeholder {
|
|
color: var(--morphsearch-input-placeholder, #c2c2c2);
|
|
}
|
|
|
|
/* hide placeholder when active in Chrome */
|
|
|
|
.gn-search:focus::-webkit-input-placeholder {
|
|
color: transparent;
|
|
}
|
|
|
|
input[type="search"] {
|
|
/* reset normalize */
|
|
-webkit-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
/* Morphing Search Page Submit Button */
|
|
|
|
.morphsearch-input:focus,
|
|
.morphsearch-submit:focus {
|
|
outline: none;
|
|
background: transparent;
|
|
border-color: #FFF!important;
|
|
}
|
|
|
|
.morphsearch-submit {
|
|
display: grid;
|
|
position: absolute;
|
|
width: 80px;
|
|
height: 80px;
|
|
padding: 0;
|
|
text-indent: 100px;
|
|
overflow: hidden;
|
|
right: 0;
|
|
top: 50%;
|
|
background: transparent;
|
|
background-size: 100%;
|
|
border: none;
|
|
pointer-events: none;
|
|
transform-origin: 50% 50%;
|
|
}
|
|
|
|
.morphsearch.open .morphsearch-submit {
|
|
pointer-events: auto;
|
|
opacity: 1;
|
|
-webkit-transform: translate3d(-30px, -50%, 0) scale3d(1, 1, 1);
|
|
transform: translate3d(-30px, -50%, 0) scale3d(1, 1, 1);
|
|
-webkit-transition: opacity 0.3s, -webkit-transform 0s;
|
|
transition: opacity 0.3s, transform 0s;
|
|
}
|
|
|
|
.morphsearch-submit:hover {
|
|
background-color: transparent !important; /* Added !important to remove background-color on button hover for themes like 2017 */
|
|
box-shadow: none;
|
|
background-image: none;
|
|
border: none;
|
|
padding: 0;
|
|
}
|
|
|
|
.morphsearch-submit:active {
|
|
background-color: transparent;
|
|
box-shadow: none;
|
|
background-image: none;
|
|
border: none;
|
|
padding: 0;
|
|
}
|
|
|
|
/* 3- Hidding the Morphing Search Page once the .close class is added to the main div */
|
|
|
|
.morphsearch-close {
|
|
width: 36px;
|
|
height: 36px;
|
|
/* position: absolute; */
|
|
/* right: 2em; */
|
|
/* top: 2em; */
|
|
overflow: hidden;
|
|
text-indent: 100%;
|
|
cursor: pointer;
|
|
pointer-events: none;
|
|
opacity: 0;
|
|
-webkit-transform: scale3d(0, 0, 1);
|
|
transform: scale3d(0, 0, 1);
|
|
align-self: flex-end;
|
|
margin-top: -25px;
|
|
}
|
|
|
|
.morphsearch.open .morphsearch-close {
|
|
opacity: 1;
|
|
pointer-events: auto;
|
|
-webkit-transform: scale3d(1, 1, 1);
|
|
transform: scale3d(1, 1, 1);
|
|
-webkit-transition: opacity 0.3s, -webkit-transform 0s;
|
|
transition: opacity 0.3s, transform 0s;
|
|
}
|
|
|
|
.morphsearch-close::before,
|
|
.morphsearch-close::after {
|
|
content: "";
|
|
position: absolute;
|
|
width: 2px;
|
|
height: 100%;
|
|
top: 0;
|
|
left: 50%;
|
|
border-radius: 3px;
|
|
/* opacity: 0.2; */
|
|
background: #FFF;
|
|
/* @see https://stackoverflow.com/a/49618941/6837428 */
|
|
}
|
|
|
|
.morphsearch-close:hover.morphsearch-close::before,
|
|
.morphsearch-close:hover.morphsearch-close::after {
|
|
opacity: 1;
|
|
}
|
|
|
|
.morphsearch-close::before {
|
|
-webkit-transform: rotate(45deg);
|
|
transform: rotate(45deg);
|
|
}
|
|
|
|
.morphsearch-close::after {
|
|
-webkit-transform: rotate(-45deg);
|
|
transform: rotate(-45deg);
|
|
}
|
|
|
|
.morphsearch-content {
|
|
color: #333;
|
|
margin-top: 4.5em;
|
|
width: 100%;
|
|
/* Firefox: old themes */
|
|
width: -moz-available;
|
|
/* Chrome: old themes */
|
|
width: -webkit-fill-available;
|
|
height: 0;
|
|
overflow: hidden;
|
|
padding: 0 10.5%;
|
|
background: #f1f1f1;
|
|
position: absolute;
|
|
pointer-events: none;
|
|
opacity: 0;
|
|
z-index: -1;
|
|
}
|
|
|
|
/* Morphing Search Page Content */
|
|
|
|
.morphsearch.open .morphsearch-content {
|
|
opacity: 1;
|
|
height: auto;
|
|
overflow: visible;
|
|
/* this breaks the transition of the children in FF: https://bugzilla.mozilla.org/show_bug.cgi?id=625289 */
|
|
pointer-events: auto;
|
|
-webkit-transition: opacity 0.3s 0.5s;
|
|
transition: opacity 0.3s 0.5s;
|
|
}
|
|
|
|
.dummy-column {
|
|
width: 30%;
|
|
padding: 0 0 6em;
|
|
float: left;
|
|
opacity: 0;
|
|
-webkit-transform: translate3d(0, 100px, 0);
|
|
transform: translateY(100px);
|
|
-webkit-transition: -webkit-transform 0.5s, opacity 0.5s;
|
|
transition: transform 0.5s, opacity 0.5s;
|
|
}
|
|
|
|
.morphsearch.open .dummy-column:first-child {
|
|
-webkit-transition-delay: 0.4s;
|
|
transition-delay: 0.4s;
|
|
}
|
|
|
|
.morphsearch.open .dummy-column:nth-child(2) {
|
|
-webkit-transition-delay: 0.45s;
|
|
transition-delay: 0.45s;
|
|
}
|
|
|
|
.morphsearch.open .dummy-column:nth-child(3) {
|
|
-webkit-transition-delay: 0.5s;
|
|
transition-delay: 0.5s;
|
|
}
|
|
|
|
.morphsearch.open .dummy-column {
|
|
opacity: 1;
|
|
-webkit-transform: translate3d(0, 0, 0);
|
|
transform: translate3d(0, 0, 0);
|
|
}
|
|
|
|
.dummy-column:nth-child(2) {
|
|
margin: 0 5%;
|
|
}
|
|
|
|
.dummy-column h2 {
|
|
font-size: 1em;
|
|
letter-spacing: 1px;
|
|
text-transform: uppercase;
|
|
font-weight: 800;
|
|
color: #c2c2c2;
|
|
padding: 0.5em 0;
|
|
}
|
|
|
|
.round {
|
|
border-radius: 50%;
|
|
}
|
|
|
|
.dummy-media-object {
|
|
padding: 0.75em;
|
|
display: block;
|
|
margin: 0.3em 0;
|
|
cursor: pointer;
|
|
border-radius: 5px;
|
|
background: #ebebeb;
|
|
}
|
|
|
|
.dummy-media-object:hover,
|
|
.dummy-media-object:focus {
|
|
background: #e4e4e5;
|
|
}
|
|
|
|
.dummy-media-object img {
|
|
display: inline-block;
|
|
width: 50px !important;
|
|
height: 50px !important;
|
|
margin: 0 10px 0 0;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.dummy-media-object h3 {
|
|
vertical-align: middle;
|
|
font-size: 0.85em;
|
|
display: inline-block;
|
|
font-weight: 700;
|
|
margin: 0 0 0 0;
|
|
width: calc(100% - 70px);
|
|
color: #b2b2b2;
|
|
}
|
|
|
|
.dummy-media-object:hover h3 {
|
|
color: #ec5a62;
|
|
}
|
|
|
|
/* Morphing Search Page Media Queries */
|
|
|
|
@media screen and (max-width: 1024px) {
|
|
.morphsearch {
|
|
padding: 50px 20px;
|
|
}
|
|
.morphsearch-input {
|
|
padding: 0 25% 0 10px;
|
|
font-size: 1.5em;
|
|
}
|
|
.morphsearch.open .morphsearch-input {
|
|
font-size: 1.5em;
|
|
}
|
|
.dummy-column {
|
|
float: none;
|
|
width: auto;
|
|
padding: 0 0 2em;
|
|
}
|
|
.dummy-column:nth-child(2) {
|
|
margin: 0;
|
|
}
|
|
.morphsearch.open .morphsearch-submit {
|
|
-webkit-transform: translate3d(0, -55%, 0) scale3d(0.4, 0.4, 1);
|
|
transform: translate3d(20%, -55%, 0) scale3d(0.4, 0.4, 1);
|
|
}
|
|
}
|
|
|
|
@media screen and (max-width: 80em) {
|
|
.morphsearch-close {
|
|
/* top: 3em; */
|
|
}
|
|
}
|
|
|
|
@media screen and (min-width: 38.75em) {
|
|
body {
|
|
position: relative;
|
|
}
|
|
.morphsearch.open {
|
|
height: 100%;
|
|
}
|
|
}
|
|
|
|
@media screen and (min-height: 71.5625em) {
|
|
.morphsearch.open {
|
|
height: 100% !important;
|
|
}
|
|
} |