Back
Input
1 2<label class="file-input-button"> 3 <span class="button__text">Upload</span> 4 <span class="button__icon"> 5 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg"> 6 <path stroke="none" d="M0 0h24v24H0z" fill="none"/> 7 <path d="M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-1" /> 8 <path d="M9 15l3 -3l3 3" /> 9 <path d="M12 12l0 9" />10 </svg>11 </span>12 <input type="file" class="file-input" />13</label>
1 2.file-input-button { 3 --main-focus: #2d8cf0; 4 --font-color: #dedede; 5 --bg-color-sub: #222; 6 --bg-color: #323232; 7 --main-color: #dedede; 8 9 position: relative;10 display: inline-flex;11 align-items: center;12 width: 150px;13 height: 40px;14 cursor: pointer;15 border: 2px solid var(--main-color);16 box-shadow: 4px 4px var(--main-color);17 background-color: var(--bg-color);18 border-radius: 10px;19 overflow: hidden;20 transition: all 0.3s;21}22 23.file-input-button,24.file-input-button .button__icon,25.file-input-button .button__text {26 transition: all 0.3s;27}28 29.file-input-button .button__text {30 transform: translateX(21px);31 color: var(--font-color);32 font-weight: 600;33}34 35.file-input-button .button__icon {36 position: absolute;37 transform: translateX(109px);38 height: 100%;39 width: 39px;40 background-color: var(--bg-color-sub);41 display: flex;42 align-items: center;43 justify-content: center;44}45 46.file-input-button .svg {47 width: 20px;48 height: 20px;49 color: var(--main-color);50}51 52.file-input-button:hover {53 background: var(--bg-color);54}55 56.file-input-button:hover .button__text {57 color: transparent;58}59 60.file-input-button:hover .button__icon {61 width: 148px;62 transform: translateX(0);63}64 65.file-input-button:active {66 transform: translate(3px, 3px);67 box-shadow: 0 0 var(--main-color);68}69 70.file-input {71 position: absolute;72 width: 100%;73 height: 100%;74 top: 0;75 left: 0;76 opacity: 0;77 cursor: pointer;78}
MIT License