Created
June 29, 2018 19:08
-
-
Save rishavs/c9d49866bdc0c46c3a764374b80f9c53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Cove::Views | |
def self.register | |
html = <<-HTML | |
<article id="register_page"> | |
<form class="ui form" id="register_form" action="/register" method="post"> | |
<div class="field"> | |
<label>Username</label> | |
<input type="text" name="username" id="username" placeholder="Username" /> | |
</div> | |
<div class="field"> | |
<label>Password</label> | |
<div class="ui icon input"> | |
<input type="password" name="password" id="password" placeholder="Password" /> | |
<i class="circular eye slash outline link icon" id="toggle_password" onclick="toggle_password()"></i> | |
</div> | |
</div> | |
<button class="ui button" type="submit" >Submit</button> | |
<div class="ui error message"></div> | |
</form> | |
</article> | |
<script> | |
const toggle_password = () => { | |
var p = document.getElementById("password"); | |
var tp = document.getElementById("toggle_password"); | |
if (p.type === "password") { | |
p.type = "text"; | |
tp.classList.remove("circular", "eye", "slash", "outline", "link", "icon") | |
tp.classList.add("circular", "eye", "link", "icon") | |
} else { | |
p.type = "password"; | |
tp.classList.remove("circular", "eye", "link", "icon") | |
tp.classList.add("circular", "eye", "slash", "outline", "link", "icon") | |
} | |
} | |
</script> | |
HTML | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment