Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0a4df31
cardのcssを変更
nihei-shunsuke Jan 29, 2021
157f6de
Cardコンポーネントを作成
nihei-shunsuke Jan 29, 2021
ca1591f
Cardコンポーネントを表示
nihei-shunsuke Jan 29, 2021
a50868a
Cardコンポーネントを中央に揃えた
nihei-shunsuke Jan 29, 2021
e5e0ea2
カードを二列にする試行錯誤をしました
nihei-shunsuke Jan 31, 2021
22eea75
反映させるCSSを変更した後元に戻したので変わりなし
nihei-shunsuke Jan 31, 2021
a40b494
カードを二列にする試行錯誤をしましたが変わりなし
nihei-shunsuke Jan 31, 2021
71a2550
imgフォルダの追加
nihei-shunsuke Jan 31, 2021
ef56c8a
containerクラスをmap関数の外に移動しました
nihei-shunsuke Jan 31, 2021
9e20b47
不要なコメントを排除&containerクラスのwidthを変更
nihei-shunsuke Jan 31, 2021
49cf396
divが1つ多かったので削除&余計な改行の削除、必要な改行の追加
nihei-shunsuke Jan 31, 2021
8e2abb3
インデントのずれを修正
nihei-shunsuke Jan 31, 2021
cac22fc
必要な改行の追加
nihei-shunsuke Jan 31, 2021
0897337
不要な改行の削除
nihei-shunsuke Jan 31, 2021
41b3324
インデントの修正
nihei-shunsuke Feb 1, 2021
f41110f
インデントの修正
nihei-shunsuke Feb 1, 2021
1f9a943
App.cssのimportを削除
nihei-shunsuke Feb 1, 2021
4227ce4
インデントの修正
nihei-shunsuke Feb 2, 2021
3b5c551
App.cssの削除
nihei-shunsuke Feb 2, 2021
0593ea4
コンフリクトの解消
nihei-shunsuke Feb 2, 2021
56a023c
Merge branch 'main' into shunsuke
nihei-shunsuke Feb 2, 2021
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
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

17 changes: 8 additions & 9 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from 'react'
import './App.css'
import Card from './component/Card';

function App () {
return (
<div className="App">

</div>
)
function App() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nits]
import文の後に1行改行があると見やすいね

return (
<div>
<Card />
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nice]
ナイスリファクタ

</div>
);
}

export default App
export default App
49 changes: 49 additions & 0 deletions src/component/Card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React, { Component } from 'react';
import './card.css';
import Matsuya from './img/matsuya.gif';
import Donut from './img/donut.jpg';
import Bookoff from './img/bookoff.jpg';
import Second from './img/second.jpg';
import Uniqlo from './img/uniqlo.png';
import Sukiya from './img/sukiya.png';
import Wego from './img/wego.png';
import Earth from './img/earth.jpg';
import GU from './img/GU.png';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nits]
ここも1行改行あると見やすいね


let data = [
{img: Matsuya, alt:'matsuya', shop:'松屋金沢工大前店', distance:0.3},
{img: Donut, alt:'donut', shop:'ミスタードーナツ野々市ショップ', distance:1.9},
{img: Bookoff, alt:'bookoff', shop:'BOOKOFF野々市若松店', distance:1.9},
{img: Second, alt:'second', shop:'セカンドストリート野々市本町店', distance:2.4},
{img: Uniqlo, alt:'uniqlo', shop:'ユニクロ野々市店', distance:4.0},
{img: Sukiya, alt:'sukiya', shop:'すき家野々市新庄店', distance:4.3},
{img: Wego, alt:'wego', shop:'WEGO 金沢フォーラス店', distance:6.7},
{img: Earth, alt:'earth', shop:'アースミュージック&エコロジー 金沢フォーラス店', distance:6.7},
{img: GU, alt:'GU', shop:'GU イオンタウン金沢示野店', distance:8.3}
];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

[Nits]
意図がなければ削除しても🙆‍♂️

class Card extends Component {
render() {
return (
<div className="container">
{data.map((value) =>(
<div className="card-wrapper">
<a href="#">
<div className="card">
<div className="card__img">
<img src={value.img} alt={value.alt} />
</div>
<div className="card__text">
<p className="card__text__shop">{value.shop}</p>
<p className="card__text__distance">{value.distance}km</p>
</div>
</div>
</a>
</div>
))}
</div>
)
}
}

export default Card;
85 changes: 85 additions & 0 deletions src/component/card.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
.card-wrapper {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 2.8125rem 0 0 4.375rem;
}
.card-wrapper a {
color: #000;
text-decoration: none;
}

.card {
display: -webkit-box;
display: -ms-flexbox;
/* img,shop,distanceをよこならびにする */
display: flex;
width: 40rem;
height: 13.4375rem;
cursor: pointer;
background-color: #fff;
border-radius: 10px;
-webkit-box-shadow: rgba(0, 0, 0, 0.25) 5px 5px 25px;
box-shadow: rgba(0, 0, 0, 0.25) 5px 5px 25px;
-webkit-transition: opacity 0.3s;
transition: opacity 0.3s;
}

/* マウスが乗った時のアクション */
.card:hover {
opacity: 0.7;
}

/*画像のサイズを調整*/
.card__img {
width: 13.4375rem;
}

.card__img img {
width: 100%;
height: 100%;
border-radius: 10px 0 0 10px;
/*余白なく縦横比を維持して中央にトリミング*/
/*-o-のようにベンダー接頭辞ありとなしを用意することによって様々なブラウザに対して互換性を保証する*/
-o-object-fit: cover;
object-fit: cover;
-o-object-position: center;
object-position: center;
}

.card__text {
width: calc(40rem - 13.4375rem);
}

.card__text__shop {
width: calc(40rem - 13.4375rem);
overflow: hidden;
font-size: 2.5rem;
line-height: 9rem;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
}

.card__text__distance {
position: relative;
top: -5rem;
left: 20rem;
display: inline-block;
font-size: 1.875rem;
color: #696969;
}

.container {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nits]
ここも改行入れていいね

display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-ms-flex-line-pack: start;
align-content: flex-start;
width: 100%;
max-width: 1500px;
padding-top: 100px;
margin: 0 auto;
}
Binary file added src/component/img/GU.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/component/img/bookoff.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/component/img/donut.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/component/img/earth.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/component/img/hot-sale.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/component/img/matsuya.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/component/img/second.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/component/img/sukiya.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/component/img/uniqlo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/component/img/vdrug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/component/img/wego.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.