fix currency in UI, remove extra USD

This commit is contained in:
Megan O'Keefe 2020-04-23 09:20:08 -04:00
parent 25486dda33
commit f1e33783d7
7 changed files with 69 additions and 150 deletions

View file

@ -2,7 +2,7 @@
<defs> <defs>
<style> <style>
.cls-1 { .cls-1 {
fill: #b4b2bb; fill: #605f64;
} }
</style> </style>
</defs> </defs>

Before

Width:  |  Height:  |  Size: 693 B

After

Width:  |  Height:  |  Size: 693 B

Before After
Before After

View file

@ -1,12 +1,19 @@
/* general */ /* general */
html, body {
height: 100%;
}
body { body {
color: #111111; color: #111111;
font-family: 'Roboto', sans-serif; font-family: 'Roboto', sans-serif;
display: flex;
flex-direction: column;
} }
hr {
border-top: 1px solid #b4b2bb;
}
.text-muted { .text-muted {
color: #707070; color: #707070;
@ -14,20 +21,20 @@ body {
.badge { .badge {
display: inline-block !important; display: inline-block !important;
width: 15px; width: 18px;
height: 15px; height: 18px;
color: #111111; color: #111111;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 11px; font-size: 10px;
margin-left: 7px;
border-radius: 50%; border-radius: 50%;
padding-left: 3px;
} }
.badge.badge-blue { .badge.badge-blue {
background-color: #4bc7c7; background-color: #4bc7c7;
padding-bottom: 2px; padding-top: 5px;
} }
/*header*/ /*header*/
@ -62,23 +69,20 @@ header .h-controls {
header .h-control { header .h-control {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 14px; font-size: 12px;
position: relative; position: relative;
margin-left: 40px; margin-left: 40px;
color: #b4b2bb; color: #605f64;
outline:none !important;
} }
header .h-control:first-child { header .h-control:first-child {
margin-left: 0; margin-left: 0;
outline:none !important;
} }
header .h-control img { header .h-control img {
width: 20px; width: 20px;
height: 20px; height: 20px;
margin-right: 8px; margin-right: 8px;
outline:none !important;
} }
header .h-control input { header .h-control input {
@ -87,16 +91,15 @@ header .h-control input {
width: 250px; width: 250px;
height: 24px; height: 24px;
flex-shrink: 0; flex-shrink: 0;
background-color: #b4b2bb; background-color: #f2f2f2;
display: flex; display: flex;
align-items: center; align-items: center;
outline:none !important;
} }
header .h-control input:focus { header .h-control input:focus {
outline: 0;
border: 0; border: 0;
box-shadow: 0; box-shadow: 0;
outline:none !important;
} }
header .icon { header .icon {
@ -121,43 +124,40 @@ header .icon.search-icon {
header .h-control select { header .h-control select {
background: transparent; background: transparent;
border-radius: 0; border-radius: 0;
border: none; border: 1px solid #acacac;
width: 100px; width: 100px;
height: 20px; height: 20px;
flex-shrink: 0; flex-shrink: 0;
padding: 0 7px; padding: 0 7px;
display: flex; display: flex;
align-items: center; align-items: center;
outline:none !important;
} }
header .h-control::-webkit-input-placeholder { header .h-control::-webkit-input-placeholder {
/* Chrome/Opera/Safari */ /* Chrome/Opera/Safari */
font-size: 14px; font-size: 12px;
color: #b4b2bb; color: #605f64;
} }
header .h-control::-moz-placeholder { header .h-control::-moz-placeholder {
/* Firefox 19+ */ /* Firefox 19+ */
font-size: 14px; font-size: 12px;
color: #b4b2bb; color: #605f64;
} }
header .h-control :-ms-input-placeholder { header .h-control :-ms-input-placeholder {
/* IE 10+ */ /* IE 10+ */
font-size: 14px; font-size: 12px;
color: #b4b2bb; color: #605f64;
} }
header .h-control :-moz-placeholder { header .h-control :-moz-placeholder {
/* Firefox 18- */ /* Firefox 18- */
font-size: 14px; font-size: 12px;
color: #b4b2bb; color: #605f64;
} }
header .navbar.sub-navbar { header .navbar.sub-navbar {
height: 60px; height: 60px;
background-color: #111111; background-color: #111111;
@ -185,8 +185,7 @@ header .navbar.sub-navbar nav a {
} }
header .navbar.sub-navbar .controls { header .navbar.sub-navbar .controls {
display: inline-block; display: flex;
text-align: center;
height: 60px; height: 60px;
} }
@ -200,30 +199,6 @@ header .navbar.sub-navbar .controls a {
justify-content: center; justify-content: center;
} }
header .navbar.sub-navbar .controls-div {
display: block;
width: 120px;
border-left: 1px solid #b4b2bb;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
}
header .navbar.sub-navbar form .controls-form {
background-color: #111111;
display: block;
width: 120px;
border-left: 1px solid #b4b2bb;
display: inline-block;
flex-flow: column;
align-items: center;
justify-content: center;
text-align: center;
}
header .navbar.sub-navbar .controls a img { header .navbar.sub-navbar .controls a img {
width: 20px; width: 20px;
height: 20px; height: 20px;
@ -234,52 +209,10 @@ header .navbar.sub-navbar .controls a:last-child {
border-right: 1px solid #b4b2bb; border-right: 1px solid #b4b2bb;
} }
form .currency {
height: auto;
background-color: #111111;
font-size: 15px;
color: #b4b2bb;
padding-top: 5px;
padding-bottom: 0;
padding-right: 30px;
align-items: center;
display: flex;
border: none;
}
span .currency-icon {
padding-bottom: 2px;
padding-top: 20px;
display: inline-block;
}
span.buffer {
padding-top: 3px;
display: inline-block;
}
select .currency {
padding-left: 10px;
padding-top: 2px;
align-items: center;
background-color: #111111;
padding-right: 30px;
border: none;
}
option .currency {
padding-left: 10px;
align-items: center;
background-color: #111111;
padding-right: 30px;
border: none;
}
/*footer*/ /*footer*/
footer.py-5 { footer.py-5 {
flex-shrink: 0;
padding: 0 !important; padding: 0 !important;
} }
@ -308,6 +241,9 @@ footer .footer-top .footer-social div {
width: 50%; width: 50%;
} }
.footer-top .social {
border-right: 1px solid #b4b2bb;
}
.footer-top .social h4 { .footer-top .social h4 {
font-size: 24px; font-size: 24px;
@ -326,7 +262,6 @@ footer .footer-top .footer-social div {
.footer-top .app { .footer-top .app {
justify-content: flex-end; justify-content: flex-end;
padding-left: 100px;
} }
.footer-top .app h4 { .footer-top .app h4 {
@ -401,6 +336,10 @@ footer .footer-bottom p:first-child {
/*Home*/ /*Home*/
main {
flex: 1 0 auto;
}
main.home { main.home {
background-color: white; background-color: white;
} }
@ -594,7 +533,6 @@ main.home {
.aws-platform, .aws-platform,
.onprem-platform, .onprem-platform,
.azure-platform,
.gcp-platform { .gcp-platform {
position: fixed; position: fixed;
top: 0; top: 0;
@ -609,6 +547,7 @@ main.home {
.aws-platform, .aws-platform,
.aws-platform .platform-flag { .aws-platform .platform-flag {
background-color: #ff9900; background-color: #ff9900;
color: #000000;
} }
.onprem-platform, .onprem-platform,
@ -621,11 +560,6 @@ main.home {
background-color: #4285f4; background-color: #4285f4;
} }
.azure-platform,
.azure-platform .platform-flag {
background-color: #f35426;
}
.platform-flag { .platform-flag {
position: absolute; position: absolute;
top: 98px; top: 98px;
@ -670,4 +604,4 @@ main.home {
select { select {
-webkit-appearance: none; -webkit-appearance: none;
-webkit-border-radius: 0px; -webkit-border-radius: 0px;
} }

View file

@ -18,7 +18,7 @@
<div class="col"> <div class="col">
<h3>{{ len $.items }} item <h3>{{ len $.items }} item
{{- if gt (len $.items) 1}}s{{end}} {{- if gt (len $.items) 1}}s{{end}}
in your Shopping Cart</h3> in your cart</h3>
</div> </div>
<div class="col text-right"> <div class="col text-right">
<form method="POST" action="/cart/empty"> <form method="POST" action="/cart/empty">
@ -43,7 +43,7 @@
<div class="details"> <div class="details">
Quantity: {{.Quantity}}<br/> Quantity: {{.Quantity}}<br/>
<strong> <strong>
USD {{ renderMoney .Price}} {{ renderMoney .Price}}
</strong> </strong>
</div> </div>
</div> </div>
@ -52,8 +52,8 @@
{{ end }} <!-- range $.items--> {{ end }} <!-- range $.items-->
<div class="row pt-2 my-3"> <div class="row pt-2 my-3">
<div class="col text-center order-summary"> <div class="col text-center order-summary">
<p class="text-muted my-0">Shipping Cost: <strong>USD {{ renderMoney .shipping_cost }}</strong></p> <p class="text-muted my-0">Shipping Cost: <strong>{{ renderMoney .shipping_cost }}</strong></p>
Total Cost: <strong>USD {{ renderMoney .total_cost }}</strong> Total Cost: <strong>{{ renderMoney .total_cost }}</strong>
</div> </div>
</div> </div>
@ -156,6 +156,5 @@
{{ end }} {{ end }}
</div> </div>
</main> </main>
{{ template "footer" . }} {{ template "footer" . }}
{{ end }} {{ end }}

View file

@ -21,4 +21,4 @@
</main> </main>
{{ template "footer" . }} {{ template "footer" . }}
{{ end }} {{ end }}

View file

@ -3,8 +3,8 @@
<footer class="py-5"> <footer class="py-5">
<div class="footer-top"> <div class="footer-top">
<div class="container footer-social"> <div class="container footer-social">
<p>© 2020 Google Inc (<a href="https://github.com/GoogleCloudPlatform/microservices-demo">Source Code</a>) — </p> <p class="footer-text">© 2020 Google Inc (<a href="https://github.com/GoogleCloudPlatform/microservices-demo">Source Code</a>) — </p>
<p class="footer-disclaimer"> This website is hosted for demo purposes only. It is not an actual shop. This is not a Google product.</p> <p class="footer-text"> This website is hosted for demo purposes only. It is not an actual shop. This is not a Google product.</p>
</div> </div>
</div> </div>

View file

@ -17,46 +17,34 @@
</head> </head>
<body> <body>
<header> <header>
<div class="navbar">
<div class="container d-flex justify-content-between">
<div class="h-free-shipping">Free shipping with $75 purchase! &nbsp;&nbsp;</div>
<div class="h-controls">
<div class="h-control">
<img src="/static/icons/Hipster_CurrencyIcon.svg" alt="icon" class="icon" />
<form method="POST" class="controls-form" action="/setCurrency" id="currency_form" >
<select name="currency_code" onchange="document.getElementById('currency_form').submit();">
{{range $.currencies}}
<option value="{{.}}" {{if eq . $.user_currency}}selected="selected"{{end}}>{{.}}</option>
{{end}}
</select>
</form>
<img src="/static/icons/Hipster_DownArrow.svg" alt="icon" class="icon arrow" />
</div>
</div>
</div>
</div>
<div class="navbar sub-navbar"> <div class="navbar sub-navbar">
<div class="container d-flex justify-content-between"> <div class="container d-flex justify-content-between">
<a href="/" class="navbar-brand d-flex align-items-center"> <a href="/" class="navbar-brand d-flex align-items-center">
<img src="/static/icons/Hipster_NavLogo.svg" alt="logo" class="logo" /> <img src="/static/icons/Hipster_NavLogo.svg" alt="logo" class="logo" />
</a> </a>
<nav>
</nav>
<div class="controls"> <div class="controls">
{{ if $.currencies }}
<span> <form method="POST" class="controls-form" action="/setCurrency" id="currency_form" >
<span class="buffer"></span>
<span class="currency-icon"><img src="/static/icons/Hipster_CurrencyIcon.svg" alt="currency-icon" class="icon" /></span>
<select class="currency" name="currency_code"
onchange="document.getElementById('currency_form').submit();">
{{range $.currencies}}
<option class="currency" value="{{.}}" {{if eq . $.user_currency}}selected="selected"{{end}}>{{.}}</option>
{{end}}
</select>
</form>
</span>
{{ end }}
<a href="/cart"> <a href="/cart">
<img src="/static/icons/Hipster_CheckOutIcon.svg" alt="cart-icon" class="logo" /> <img src="/static/icons/Hipster_CartIcon.svg" alt="cart-icon" class="logo" />
<span>View Cart <span>Cart
{{ if $.cart_size }} {{ if $.cart_size }}
<span class="badge badge-blue">{{$.cart_size}}</span> <span class="badge badge-blue">{{$.cart_size}}</span>
{{ end }} {{ end }}
@ -66,6 +54,4 @@
</div> </div>
</div> </div>
</header> </header>
{{end}} {{end}}

View file

@ -19,9 +19,9 @@
<p>Shipping Tracking ID</p> <p>Shipping Tracking ID</p>
<p class="mg-bt"><strong>{{.order.ShippingTrackingId}}</strong></p> <p class="mg-bt"><strong>{{.order.ShippingTrackingId}}</strong></p>
<p>Shipping Cost</p> <p>Shipping Cost</p>
<p class="mg-bt"><strong>USD {{renderMoney .order.ShippingCost}}</strong></p> <p class="mg-bt"><strong>{{renderMoney .order.ShippingCost}}</strong></p>
<p>Total Paid</p> <p>Total Paid</p>
<p class="mg-bt"><strong>USD {{renderMoney .total_paid}}</strong></p> <p class="mg-bt"><strong>{{renderMoney .total_paid}}</strong></p>
</div> </div>
</div> </div>
@ -38,4 +38,4 @@
</main> </main>
{{ template "footer" . }} {{ template "footer" . }}
{{ end }} {{ end }}