Skip to content

Commit

Permalink
Merge pull request #39 from virtual-labs/dev
Browse files Browse the repository at this point in the history
updated
  • Loading branch information
dsnvlab authored Nov 13, 2024
2 parents 4704b5b + 361e68a commit e342378
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 34 deletions.
73 changes: 40 additions & 33 deletions experiment/simulation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,16 @@
100% { background-color: #B20000; box-shadow: 0 0 3px #B20000; }
}


.btn1 {
margin-left:10px;
margin-right: 10px;
margin-top:7px;
float:right;
margin-bottom:10px;
padding: 7px;
border:none;
border-radius: 5px;
}
</style>

<body >
Expand All @@ -86,46 +95,37 @@

</header>

<div class="row container" style="">
<div class="col-sm-10" >
</div>
<div class="col-sm-2" >
<button type="button" class="btn btn-danger" style="margin-top:7px;margin-bottom:5px;" id = "pdfDownload" hidden>
Download Report

</button>
</div>
</div>


<div class="row">
<div class="row container-fluid">

<div class="col-sm-2" id="materialType" style="margin-top:5px;margin-bottom:5px;" hidden>
<div class="col-sm-2" id="materialType" style="margin-top:10px;margin-bottom:5px;" hidden>
<label class="labelstyle" id="labelType" >Select Material type: </label>
</div>
<div class="col-sm-4">
<select class="form-control selectConf" id="material" style="margin-top:5px;margin-bottom:5px;" hidden>
<select class="form-control selectConf" id="material" style="margin-top:10px;margin-bottom:5px;" hidden>
<option value="0">--- Select the Material --- </option>'
<option value="10" id="BariumTitanate" >Barium titanate </option>
<option value="20" id="Quartz">Quartz</option>

</select>
</div>
<div class="col-sm-6">

<button type="button" class="btn btn-danger" data-toggle="modal" style="margin-top:5px;margin-bottom:5px;" data-target="#readProcedureModal1" id = "simDemo">
Simulation Demo
</button>




<button type="button" class="btn btn-danger btnMarin button1" data-toggle="modal" style="margin-top:5px;margin-bottom:5px;" data-target="#exampleModal1" id = "btnForModal">
Procedure
</button>

<button type="button" class="btn btn-danger" id="nextLevelChar" style="margin-top: 5px;margin-bottom:5px;" hidden>Next Level</button>
<div class="col-sm-6">
<button type="button" class="btn btn-danger btn1" id = "pdfDownload" hidden>
Download Report
</button>
<button type="button" class="btn btn-danger btn1" id="nextLevelChar" hidden>Next Level</button>

<button type="button" class="btn btn-danger btnMarin button1 btn1" data-toggle="modal" data-target="#exampleModal1" id = "btnForModal">
Procedure
</button>

<button type="button" class="btn btn-danger btn1" data-toggle="modal" data-target="#readProcedureModal1" id = "simDemo">
Simulation Demo
</button>

</div>
</div>

</div>

Expand Down Expand Up @@ -298,9 +298,12 @@ <h5 class="modal-title1" id="exampleModalLabel">Procedure</h5>
<script type="text/javascript" src="src/result.js"></script>

<script>
$('#readProcedureModal1').click(function(){
$('video').each(function(){
$(this).get(0).pause();
})
})


// Play the video after the page loads
$("#simDemo").on("click", function(){

var video = document.getElementById("simVideo");
Expand All @@ -309,7 +312,7 @@ <h5 class="modal-title1" id="exampleModalLabel">Procedure</h5>
var skipStart = 0; // Skip the first 5 seconds
var skipEnd = 0; // Skip the last 5 seconds

// video.onloadedmetadata = function() {
// video.onloadedmetadata = function() {
// Get the duration of the video
var videoDuration = video.duration;

Expand All @@ -320,6 +323,7 @@ <h5 class="modal-title1" id="exampleModalLabel">Procedure</h5>
video.ontimeupdate = function() {
if (video.currentTime >= videoDuration - skipEnd) {
video.pause();
video.currentTime = skipStart;
}
};

Expand All @@ -329,13 +333,16 @@ <h5 class="modal-title1" id="exampleModalLabel">Procedure</h5>
if (video.currentTime < skipStart) {
video.currentTime = skipStart;
} else if (video.currentTime > videoDuration - skipEnd) {
video.currentTime = videoDuration - skipEnd;
//video.currentTime = videoDuration - skipEnd;
video.currentTime = skipStart;
}
});
// };
// };

video.play();
})


</script>

<script>
Expand Down
2 changes: 1 addition & 1 deletion experiment/simulation/src/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ var htm = ''
// + '<label class=""><b>Thickness : mm</b></label>'
+ '</div>'
+ '<div class="col-sm-2">'
+ '<label class=""><b>Material : '+counterMasterJson.testingParameters.material+' mm</b></label>'
+ '<label class=""><b>Material : '+counterMasterJson.testingParameters.material+' </b></label>'
+ '</div>'

+ '<div class="col-sm-2">'
Expand Down

0 comments on commit e342378

Please sign in to comment.