From 3c6d22573e917e53be6ea84326fae01aa0deea9d Mon Sep 17 00:00:00 2001 From: bad Date: Wed, 8 Dec 2021 00:29:02 +0100 Subject: [PATCH] Style the user/cart page --- .php-cs-fixer.cache | 2 +- resources/scss/user.scss | 21 +++++++++++++++++++++ resources/views/user.blade.php | 25 ++++++++++++++++--------- webpack.mix.js | 5 ++++- 4 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 resources/scss/user.scss diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index 805fc12..d29693a 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.0.13","version":"3.0.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":{"elements":["const","method","property"]},"blank_line_after_namespace":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true},"hashes":{"\/run\/user\/1000\/neoformat\/product.blade.php":1493321553}} \ No newline at end of file +{"php":"8.0.13","version":"3.0.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":{"elements":["const","method","property"]},"blank_line_after_namespace":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true},"hashes":{"\/run\/user\/1000\/neoformat\/product.blade.php":1493321553,"\/tmp\/neoformat\/user.blade.php":2134171036}} \ No newline at end of file diff --git a/resources/scss/user.scss b/resources/scss/user.scss new file mode 100644 index 0000000..afaf82f --- /dev/null +++ b/resources/scss/user.scss @@ -0,0 +1,21 @@ +.cart-item { + display: flex; + align-items: flex-end; + justify-content: space-between; + width: 100%; + padding: 2em; + font-size: 0.8em; + &:nth-child(2n+1) { + background-color: #f0f0b1; + } +} +.product-image { + height: 10rem; +} +.name-price-container { + & > * { + margin: 0.2em 0px; + } + flex-direction: column; + align-items: flex-start; +} diff --git a/resources/views/user.blade.php b/resources/views/user.blade.php index e250c6f..89c5e2f 100644 --- a/resources/views/user.blade.php +++ b/resources/views/user.blade.php @@ -1,3 +1,7 @@ +@push('head') + +@endpush + @extends('layouts.app') @section('title', "Sklep") @@ -12,6 +16,18 @@

Your cart:

+
+ @foreach($user->cart as $product) +
+ +
+ @csrf + +
+
+ @endforeach() +
+
@csrf @foreach($user->cart as $product) @@ -19,15 +35,6 @@ @endforeach()
- @foreach($user->cart as $product) -
- -
-
- @csrf - -
- @endforeach()
@endsection() diff --git a/webpack.mix.js b/webpack.mix.js index 4b251f0..50573e0 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -20,4 +20,7 @@ mix.js("resources/js/app.js", "public/js").sass( ).sass( "resources/scss/product.scss", "public/css" -);; +).sass( + "resources/scss/user.scss", + "public/css" +);