Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
form img input lookes better
  • Loading branch information
etl12003 committed Apr 24, 2017
1 parent 952925e commit 393b453
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 28 deletions.
26 changes: 19 additions & 7 deletions Wello/www/css/main.css
Expand Up @@ -330,8 +330,12 @@ main.details {
justify-content: flex-start;
align-items: flex-start;
}
form{

nav.form a{
text-decoration: none;
font-weight: 600;
color: white;
font-size: 1.25rem;
padding: .5rem;
}
main img{
width: 100%;
Expand All @@ -344,13 +348,12 @@ main.details li, main.details p{
}

label[for=well-picture] {
display: flex;
justify-content: center;
align-items: center;
height: 13rem;
margin-top: 60px;
background: lightgray;
}

label[for=well-picture] img {
width: 100%;
}
h2{
width: calc(100% - 2rem);
font-weight: 700;
Expand Down Expand Up @@ -462,6 +465,15 @@ main.list{
margin-bottom: 66px;
}

input[type=file]{
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: absolute;
z-index: -1;
}

/* ==========================================================================
Helper classes
========================================================================== */
Expand Down
9 changes: 4 additions & 5 deletions Wello/www/form.php
Expand Up @@ -195,19 +195,18 @@ if ($result = $mysqli->query($query)) {

<body>

<nav class="top-nav">
<button><a href="map.php">Cancel</a></button>
<button>Save Draft</button>
<nav class="top-nav form">
<a href="map.php">Cancel</a>
</nav>

<?php
echo'<form id="add-well" role="form" action="form.php?Well_ID='.$Well_ID.'" method="post">';
?>
<div class="group">
<label for="well-picture">
<img src="img/add-img-icon.png"/>
<img id="well-pic" src="img/add-img-icon.png"/>
</label>
<input type="file" id="well-picture" accept="image/*">
<input type="file" id="well-picture" accept="image/*" onchange="readURL(this);">
</div>
<div class="group">
<ul class="inputs" id="report-metadata">
Expand Down
Binary file modified Wello/www/img/add-img-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Wello/www/img/add-img-icon1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 12 additions & 16 deletions Wello/www/js/main.js
Expand Up @@ -25,19 +25,15 @@ function showPosition(position) {
//"<br>Longitude: " + position.coords.longitude;
}

//function getLoc() {
// if (navigator.geolocation) {
// navigator.geolocation.getCurrentPosition(showPos);
// } else {
// x.innerHTML = "Geolocation is not supported by this browser.";
// }
//}
//
//function showPos(position) {
// var cur[];
// cur[0] = position.coords.latitude;
// cur [1] = position.coords.longitude;
// return cur;
// //x.innerHTML = "Latitude: " + position.coords.latitude +
// //"<br>Longitude: " + position.coords.longitude;
//}
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();

reader.onload = function (e) {
$('#well-pic')
.attr('src', e.target.result);
};

reader.readAsDataURL(input.files[0]);
}
}

0 comments on commit 393b453

Please sign in to comment.