Skip to content

Commit

Permalink
replace font awesome by svg
Browse files Browse the repository at this point in the history
  • Loading branch information
msuesskraut committed Nov 7, 2020
1 parent 800afea commit 6a4a8fb
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
3 changes: 3 additions & 0 deletions assets/icons/dot-opt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/o-opt.svg
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 assets/icons/x-opt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@

<link rel="icon" type="image/png" href="./favicon.png">

<!-- Bootstrap 4.4.1 -->
<!-- Bootstrap 4.5.3 -->
<link rel="stylesheet" href="bootstrap.min.css">

<!-- Font Awesome 5 -->
<script src="https://kit.fontawesome.com/8d3c6246d3.js"></script>

<link rel="stylesheet" type="text/css" href="./main.css">

<title>Binoxxo</title>
Expand All @@ -22,7 +19,7 @@
<body>
<section id="app"></section>

<!-- Bootstrap 4.4.1 -->
<!-- Bootstrap 4.5.3 -->
<script src="jquery-3.5.1.slim.min.js"></script>
<script src="bootstrap.bundle.min.js"></script>

Expand Down
21 changes: 6 additions & 15 deletions src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,12 @@ impl<'a> ViewBuilder<'a> {
self.tr_with_args(id, None)
}

fn view_field(&self, field: Field) -> Node<Message> {
let classes = match field {
Field::Empty => "fas fa-circle",
Field::X => "fas fa-times",
Field::O => "far fa-circle",
};

let mut field_view = i![C![classes]];
if Field::Empty == field {
field_view.add_style(St::FontSize, unit!(20, %));
fn view_field(&self, field: Field) -> Vec<Node<Message>> {
match field {
Field::Empty => Node::<Message>::from_html(include_str!("../assets/icons/dot-opt.svg")),
Field::X => Node::<Message>::from_html(include_str!("../assets/icons/x-opt.svg")),
Field::O => Node::<Message>::from_html(include_str!("../assets/icons/o-opt.svg")),
}
field_view
}

fn view_cell(&self, col: usize, row: usize) -> Node<Message> {
Expand Down Expand Up @@ -271,10 +265,7 @@ impl<'a> ViewBuilder<'a> {
h1![self.tr("header")],
]
];
let board = div![
C!["cl-xs-8 col-sm-8 col-md-8 col-lg-8"],
self.view_game()
];
let board = div![C!["cl-xs-8 col-sm-8 col-md-8 col-lg-8"], self.view_game()];
let controls = div![
C!["col-xs-4 col-sm-4 col-md-4 col-lg-4"],
button![
Expand Down

0 comments on commit 6a4a8fb

Please sign in to comment.