<html>
<head>
<script defer src="https://cdn.formli.com/html-forms/os-forms-v1.min.js?workspace-id=4694"></script>
<script defer src="https://avala-test-html-form-script.s3.us-east-2.amazonaws.com/elements/os-custom-elements-v1.min.js?workspace-id=4694"></script>
</head>
<body>
<div class="relative">
<form data-os-uuid="ake3jlgk1o" data-os-element="form" action="https://app.formli.com/api/v1/data_responses" method="post">
<h3>Upload field loading state</h3>
<input data-os-element="parent-session" data-os-default="urlparam" data-os-urlparam="parent_session_id" type="hidden" />
<div>
<div class="flex">
<div class="file-upload">
<os-file-upload data-os-element="upload" data-os-uuid="dfo1lwxlvxe"></os-file-upload>
</div>
<div class="loading-wrapper">
<div data-os-element="loading" data-os-for="dfo1lwxlvxe" class="os-hidden"><div class="lds-dual-ring"></div></div>
<div data-os-element="upload-success" data-os-for="dfo1lwxlvxe" class="os-hidden">✅</div>
</div>
</div>
<button type="button" data-os-element="reset" data-os-for="dfo1lwxlvxe" class="os-hidden">Reset</button>
<div data-os-element="field-error" data-os-for="dfo1lwxlvxe" class="os-hidden"></div>
</div>
<input type="submit" value="Submit" data-os-wait="Please wait..." />
</form>
<div class="os-hidden" data-os-element="form-success">
<div>Thank you! Your submission has been received!</div>
</div>
<div class="os-hidden" data-os-element="form-error">
<div>Oops! Something went wrong while submitting the form.</div>
</div>
</div>
</body>
</html>
body {
font-family: 'Arial', sans-serif;
background-color: #000; /* Dark background */
color: #fff; /* White text for contrast */
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
form {
background-color: #333; /* Dark form background */
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0,0,0,0.5);
width: 300px;
}
.file-upload {
margin: 10px 0;
border: 2px dashed #8A2BE2; /* Purple gradient color */
padding: 10px;
text-align: center;
}
h3 {
color: #fff;
text-align: center;
}
label {
display: block;
margin-bottom: 10px;
}
input[type="text"] {
width: 290px;
height: 35px;
border: 5px solid grey;
}
input[type="text"].field-loading {
border-color: orange;
}
input[type="submit"] {
background: linear-gradient(45deg, #FFC107, #FF5722); /* Gradient button */
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
width: 100%;
transition: background-color 0.3s;
}
input[type="submit"]:hover {
background: linear-gradient(45deg, #FF9800, #F44336); /* Darker gradient on hover */
}
.lds-ripple {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.lds-ripple div {
position: absolute;
border: 4px solid #fff;
opacity: 1;
border-radius: 50%;
animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.lds-ripple div:nth-child(2) {
animation-delay: -0.5s;
}
@keyframes lds-ripple {
0% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 0;
}
4.9% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 0;
}
5% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 1;
}
100% {
top: 0px;
left: 0px;
width: 72px;
height: 72px;
opacity: 0;
}
}
.lds-dual-ring {
display: inline-block;
width: 25px;
height: 25px;
}
.lds-dual-ring:after {
content: " ";
display: block;
width: 15px;
height: 15px;
margin: 4px;
border-radius: 50%;
border: 3px solid #fff;
border-color: #fff transparent #fff transparent;
animation: lds-dual-ring 1.2s linear infinite;
}
@keyframes lds-dual-ring {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.os-hidden {
display: none;
}
form > div {
margin-bottom: 15px;
}
.flex {
display: flex;
gap: 10px;
align-items: center;
}
.absolute {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.relative {
position: relative;
}
.cover {
width: 100%;
height: 100%;
background: black;
opacity: 0.5;
}
.loading-wrapper {
display: flex;
align-items: center;
justify-content: center;
width: 25px;
height: 35px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.