Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 33 additions & 29 deletions assets/styles/user/item.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,34 @@
transition: all;
}

.radio-button input[type="radio"]:checked + label {
.radio-button input[type="radio"]:checked+label {
background-color: var(--primary);
color: var(--text-surface);
}

.radio-button input[type="radio"]:hover + label {
.radio-button input[type="radio"]:hover+label {
background-color: var(--primary);
color: var(--text-surface);
}

.radio-button input[type="radio"]:checked:hover + label {
.radio-button input[type="radio"]:checked:hover+label {
background-color: var(--primary);
color: var(--text-surface);
}
.no-line-height{

.no-line-height {
line-height: 0;
}
.description-container{

.description-container {
display: flex;
flex-direction: column;
gap: 1rem;

width: calc(100% - var(--padding-inner));
max-width: 500px;
}
.description-container span{

.description-container span {
display: flex;
flex-direction: column;
gap: 0.5rem;
Expand All @@ -63,23 +65,24 @@ dialog[open] {
max-width: 600px;

height: 300px;

/* justify-content: center;
align-items: center; */
position: relative;
}
dialog > img{

dialog>img {
max-width: 100%;
min-width: 100%;
}


@media screen and (min-width: 800px) {
main > div{
main>div {
display: space-between;
flex-direction: row !important;
gap: 2rem;

align-items: flex-start !important;
justify-content: center !important;
padding: var(--padding);
Expand All @@ -99,24 +102,24 @@ dialog > img{
border: 1px solid #ccc;
}

.radio-button input[type="radio"]:disabled + label {
.radio-button input[type="radio"]:disabled+label {
background-color: #f0f0f0;
color: #999;
border: 1px solid #ccc;
}

dialog[open]{
dialog[open] {
min-width: unset !important;
max-width: max-content !important;

height: max-content;
}

.size-recommend{
.size-recommend {
overflow: hidden;
}

.size-recommend > form{
.size-recommend>form {
width: 100%;
max-width: 600px;
margin: 0 auto;
Expand All @@ -127,38 +130,38 @@ dialog[open]{
display: flex;
flex-direction: column;
padding: var(--padding);
}
.size-recommend > form > section {
}

.size-recommend>form>section {
display: none;
width: 300px;
transition: transform 0.3s ease-in-out;

}
.size-recommend > form > section.active {
}

.size-recommend>form>section.active {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100%;
flex: 1;
}
}

.size-recommend > form > section > .input-group {
.size-recommend>form>section>.input-group {
display: flex;
flex-direction: column;
}
}

.button-container{
.button-container {
display: flex;
flex-direction: column;
gap: 1rem;
margin-top: 1.2rem;
}
}


/* @media (max-width: 768px) {

/* @media (max-width: 768px) {
.size-recommend > form {
width: 100%;
padding: 0 1rem;
Expand All @@ -169,7 +172,8 @@ dialog[open]{
}
} */

input.invalid, select.invalid {
input.invalid,
select.invalid {
border: 2px solid red;
background-color: #ffe6e6;
}
Expand Down
6 changes: 3 additions & 3 deletions view/user/Item.templ
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ templ Item(product models.Product, stock map[string]int) {
<h1 style="font-weight: 600;" class="no-line-height">{product.Name}</h1>
</span>
<span style="gap: 2px;">
<p style="font-weight: 600;" class="no-line-height">&#8360;. {fmt.Sprintf("%d",product.Price)}</p>
<p style="font-weight: 400; font-size: 2rem;" class="no-line-height">&#8360;. {fmt.Sprintf("%d",product.Price)}</p>
<p>{product.Description}</p>
<p class="no-line-height" onclick={clothingSizeDialog()}>
Size:
<button class="button-secondary" style="margin-left: var(--padding); padding-inline: var(--padding)">help</button>
<button class="button-secondary" style="margin-left: var(--padding); padding: 0; padding-inline: var(--padding); font-size: 0.9rem; ">Recommend Size</button>
<dialog id="clothingSizeDialog">
<div class="size-recommend">
<form onsubmit="event.preventDefault()" novalidate>
Expand Down Expand Up @@ -178,7 +178,7 @@ templ Item(product models.Product, stock map[string]int) {
</div>
}
</div>
<span>
<span style="margin-bottom: 2rem;">
<button
id="buy-button"
class="button-primary"
Expand Down
8 changes: 4 additions & 4 deletions view/user/Item_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 14 additions & 18 deletions view/user/cart-order_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions view/user/order.templ
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ templ Order(product models.Product, size string) {
</div>
<form hx-post={fmt.Sprintf("/order/%s",product.Id)}>
<input type="hidden" name="size" value={size} />
<input type="text" name="name" placeholder="Name"/>
<textarea name="address" placeholder="Adress"></textarea>
<input type="text" name="house" placeholder="House no. or House name"/>
<input type="text" name="pin" placeholder="Pin code"/>
<input type="text" name="city" placeholder="City"/>
<input type="tel" name="phone" placeholder="Phone no."/>
<input type="number" name="quantity" placeholder="Quantity"/>
<select name="payment" placeholder="Delivery method">

<input type="text" name="name" placeholder="Name" required/>
<textarea name="address" placeholder="Adress" required></textarea>
<input type="text" name="house" placeholder="House no. or House name" required/>
<input type="text" name="pin" placeholder="Pin code" pattern="\d{6}" title="Please enter a 6-digit pin code" required/>
<input type="text" name="city" placeholder="City" required/>
<input type="tel" name="phone" placeholder="Phone no. (e.g., +918967439823)" pattern="\+[1-9]{1}[0-9]{1,3}[0-9]{4,14}" title="Please enter a valid phone number with country code (e.g., +911234567890)" required/>
<input type="number" name="quantity" placeholder="Quantity" value="1" min="1" max="20" required/>
<select name="payment" placeholder="Delivery method" required>
<option value="online" selected>Online payment</option>
<option value="cod">Cash on delivery</option>
<option value="online">Credit card</option>
</select>
<button type="submit" class="button-primary" style="margin-top: 2rem;">Place Order</button>
</form>
Expand Down
Loading