Update some styles

This commit is contained in:
Timothy Warren 2018-08-10 20:09:28 -04:00
parent b4a843e699
commit 787687abf8
15 changed files with 574 additions and 420 deletions

View File

@ -1,4 +1,4 @@
<main>
<main class="media-list">
<?php if ($auth->isAuthenticated()): ?>
<a class="bracketed" href="<?= $url->generate('anime.add.get') ?>">Add Item</a>
<?php endif ?>
@ -24,27 +24,13 @@
<img src="<?= $urlGenerator->assetUrl("images/anime/{$item['anime']['id']}.jpg") ?>" alt="" />
<div class="name">
<a href="<?= $url->generate('anime.details', ['id' => $item['anime']['slug']]); ?>">
<?= $item['anime']['title'] ?>
<span class="canonical"><?= $item['anime']['title'] ?></span>
<?php foreach ($item['anime']['titles'] as $title): ?>
<br /><small><?= $title ?></small>
<?php endforeach ?>
</a>
</div>
<div class="table">
<?php if ($auth->isAuthenticated()): ?>
<div class="row">
<span class="edit">
<a class="bracketed" title="Edit information about this anime" href="<?=
$url->generate('edit', [
'controller' => 'anime',
'id' => $item['id'],
'status' => $item['watching_status']
]);
?>">Edit</a>
</span>
</div>
<?php endif ?>
<?php if ($item['private'] || $item['rewatching']): ?>
<div class="row">
<?php foreach(['private', 'rewatching'] as $attr): ?>
@ -77,6 +63,20 @@
</div>
<?php endif ?>
<?php if ($auth->isAuthenticated()): ?>
<div class="row">
<span class="edit">
<a class="bracketed" title="Edit information about this anime" href="<?=
$url->generate('edit', [
'controller' => 'anime',
'id' => $item['id'],
'status' => $item['watching_status']
]);
?>">Edit</a>
</span>
</div>
<?php endif ?>
<div class="row">
<div class="user_rating">Rating: <?= $item['user_rating'] ?> / 10</div>
<div class="completion">Episodes:

View File

@ -1,4 +1,4 @@
<main>
<main class="media-list">
<?php if ($auth->isAuthenticated()): ?>
<a class="bracketed" href="<?= $url->generate('anime.add.get') ?>">Add Item</a>
<?php endif ?>

View File

@ -0,0 +1,27 @@
<article class="media" id="a-<?= $item['hummingbird_id'] ?>">
<img src="<?= $urlGenerator->assetUrl("images/anime/{$item['hummingbird_id']}.jpg") ?>"
alt="<?= $item['title'] ?> cover image"/>
<div class="name">
<a href="<?= $url->generate('anime.details', ['id' => $item['slug']]) ?>">
<?= $item['title'] ?>
<?= ($item['alternate_title'] != "") ? "<small><br />{$item['alternate_title']}</small>" : ""; ?>
</a>
</div>
<div class="table">
<?php if ($auth->isAuthenticated()): ?>
<div class="row">
<span class="edit">
<a class="bracketed"
href="<?= $url->generate($collection_type . '.collection.edit.get', [
'id' => $item['hummingbird_id']
]) ?>">Edit</a>
</span>
</div>
<?php endif ?>
<div class="row">
<div class="completion">Episodes: <?= $item['episode_count'] ?></div>
<div class="media_type"><?= $item['show_type'] ?></div>
<div class="age_rating"><?= $item['age_rating'] ?></div>
</div>
</div>
</article>

View File

@ -1,4 +1,4 @@
<main>
<main class="media-list">
<?php if ($auth->isAuthenticated()): ?>
<a class="bracketed" href="<?= $url->generate($collection_type . '.collection.add.get') ?>">Add Item</a>
<?php endif ?>
@ -14,33 +14,7 @@
<h2><?= $name ?></h2>
<section class="media-wrap">
<?php foreach ($items as $item): ?>
<article class="media" id="a-<?= $item['hummingbird_id'] ?>">
<img src="<?= $urlGenerator->assetUrl("images/anime/{$item['hummingbird_id']}.jpg") ?>"
alt="<?= $item['title'] ?> cover image"/>
<div class="name">
<a href="<?= $url->generate('anime.details', ['id' => $item['slug']]) ?>">
<?= $item['title'] ?>
<?= ($item['alternate_title'] != "") ? "<small><br />{$item['alternate_title']}</small>" : ""; ?>
</a>
</div>
<div class="table">
<?php if ($auth->isAuthenticated()): ?>
<div class="row">
<span class="edit">
<a class="bracketed"
href="<?= $url->generate($collection_type . '.collection.edit.get', [
'id' => $item['hummingbird_id']
]) ?>">Edit</a>
</span>
</div>
<?php endif ?>
<div class="row">
<div class="completion">Episodes: <?= $item['episode_count'] ?></div>
<div class="media_type"><?= $item['show_type'] ?></div>
<div class="age_rating"><?= $item['age_rating'] ?></div>
</div>
</div>
</article>
<?php include __DIR__ . '/cover-item.php'; ?>
<?php endforeach ?>
</section>
</div>

View File

@ -2,7 +2,7 @@
<main>
<h2>Edit Anime Collection Item</h2>
<form action="<?= $action_url ?>" method="post">
<table class="form">
<table class="invisible form" style="border:0">
<thead>
<tr>
<th>
@ -11,17 +11,17 @@
<h4><?= $item['alternate_title'] ?></h4>
<?php endif ?>
</th>
<th>
<article class="media">
<?= $helper->img($urlGenerator->assetUrl("images/anime/{$item['hummingbird_id']}.jpg")); ?>
</article>
</th>
</tr>
</thead>
<tbody>
<tr>
<td><label for="media_id">Media</label></td>
<td>
<td rowspan="4" class="align_center">
<?= $helper->img($urlGenerator->assetUrl("images/anime/{$item['hummingbird_id']}.jpg")); ?>
</td>
</tr>
<tr>
<td class="align_right"><label for="media_id">Media</label></td>
<td class="align_left" width="100%">
<select name="media_id" id="media_id">
<?php foreach($media_items as $id => $name): ?>
<option <?= $item['media_id'] == $id ? 'selected="selected"' : '' ?> value="<?= $id ?>"><?= $name ?></option>

View File

@ -0,0 +1,19 @@
<tr>
<?php if ($auth->isAuthenticated()): ?>
<td>
<a class="bracketed"
href="<?= $url->generate($collection_type . '.collection.edit.get', ['id' => $item['hummingbird_id']]) ?>">Edit</a>
</td>
<?php endif ?>
<td class="align_left">
<a href="<?= $url->generate('anime.details', ['id' => $item['slug']]) ?>">
<?= $item['title'] ?>
</a>
<?= (!empty($item['alternate_title'])) ? " <br /><small> " . $item['alternate_title'] . "</small>" : "" ?>
</td>
<td><?= $item['episode_count'] ?></td>
<td><?= $item['episode_length'] ?></td>
<td><?= $item['show_type'] ?></td>
<td><?= $item['age_rating'] ?></td>
<td class="align_left"><?= $item['notes'] ?></td>
</tr>

View File

@ -8,7 +8,8 @@
<?php $i = 0; ?>
<div class="tabs">
<?php foreach ($sections as $name => $items): ?>
<input <?= $i === 0 ? 'checked="checked"' : '' ?> type="radio" id="collection-tab-<?= $i ?>" name="collection-tabs" />
<input <?= $i === 0 ? 'checked="checked"' : '' ?> type="radio" id="collection-tab-<?= $i ?>"
name="collection-tabs"/>
<label for="collection-tab-<?= $i ?>"><?= $name ?></label>
<div class="content">
<h2><?= $name ?></h2>
@ -16,7 +17,7 @@
<thead>
<tr>
<?php if ($auth->isAuthenticated()): ?>
<th>Actions</th>
<td>Actions</td>
<?php endif ?>
<th>Title</th>
<th>Episode Count</th>
@ -28,24 +29,7 @@
</thead>
<tbody>
<?php foreach ($items as $item): ?>
<tr>
<?php if($auth->isAuthenticated()): ?>
<td>
<a class="bracketed" href="<?= $url->generate($collection_type . '.collection.edit.get', ['id' => $item['hummingbird_id']]) ?>">Edit</a>
</td>
<?php endif ?>
<td class="align_left">
<a href="<?= $url->generate('anime.details', ['id' => $item['slug']]) ?>">
<?= $item['title'] ?>
</a>
<?= ( ! empty($item['alternate_title'])) ? " <br /><small> " . $item['alternate_title'] . "</small>" : "" ?>
</td>
<td><?= $item['episode_count'] ?></td>
<td><?= $item['episode_length'] ?></td>
<td><?= $item['show_type'] ?></td>
<td><?= $item['age_rating'] ?></td>
<td class="align_left"><?= $item['notes'] ?></td>
</tr>
<?php include __DIR__ . '/list-item.php' ?>
<?php endforeach ?>
</tbody>
</table>

View File

@ -7,7 +7,7 @@ $lastSegment = $urlGenerator->lastSegment();
$extraSegment = $lastSegment === 'list' ? '/list' : '';
?>
<h1 class="flex flex-align-end flex-wrap">
<div id="main-nav" class="flex flex-align-end flex-wrap">
<span class="flex-no-wrap grow-1">
<?php if(strpos($route_path, 'collection') === FALSE): ?>
<?= $helper->a(
@ -67,7 +67,7 @@ $extraSegment = $lastSegment === 'list' ? '/list' : '';
[<?= $helper->a($url->generate('login'), "{$whose} Login") ?>]
<?php endif ?>
</span>
</h1>
</div>
<nav>
<?php if ($container->get('util')->isViewPage()): ?>
<?= $helper->menu($menu_name) ?>

View File

@ -1,4 +1,4 @@
<main>
<main class="media-list">
<?php if ($auth->isAuthenticated()): ?>
<a class="bracketed" href="<?= $url->generate('manga.add.get') ?>">Add Item</a>
<?php endif ?>

View File

@ -1,22 +1,22 @@
<?php if ($auth->isAuthenticated()): ?>
<main>
<h1>
Edit <?= $item['manga']['titles'][0] ?>
</h1>
<h2>
Edit Manga List Item
</h2>
<form action="<?= $action ?>" method="post">
<table class="form">
<thead>
<tr>
<th>
<article class="media">
<?= $helper->img($urlGenerator->assetUrl('images/manga', "{$item['manga']['id']}.jpg")); ?>
</article>
</th>
<th class="align_left">
<h3><?= $escape->html($item['manga']['title']) ?></h3>
<?php foreach($item['manga']['titles'] as $title): ?>
<h4><?= $escape->html($title) ?></h4>
<?php endforeach ?>
</th>
<th>
<article class="media">
<?= $helper->img($urlGenerator->assetUrl('images/manga', "{$item['manga']['id']}.jpg")); ?>
</article>
</th>
</tr>
</thead>

View File

@ -1,4 +1,4 @@
<main>
<main class="media-list">
<?php if ($auth->isAuthenticated()): ?>
<a class="bracketed" href="<?= $url->generate('manga.add.get') ?>">Add Item</a>
<?php endif ?>
@ -14,7 +14,7 @@
<thead>
<tr>
<?php if ($auth->isAuthenticated()): ?>
<th>&nbsp;</th>
<td>&nbsp;</td>
<?php endif ?>
<th>Title</th>
<th>Rating</th>

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,10 @@
@import "./marx.css";
:root {
--blue-link: rgb(18, 113, 219);
--link-shadow: 1px 1px 1px #000;
--shadow: 1px 2px 1px rgba(0, 0, 0, 0.85);
--white-link-shadow: 1px 1px 1px #fff;
--shadow: 2px 2px 2px #000;
--title-overlay: rgba(0, 0, 0, 0.45);
--title-overlay-fallback: #000;
--text-color: #ffffff;
@ -13,9 +15,13 @@
--radius: 5px;
}
template, [hidden="hidden"], .media[hidden] {display:none}
template, [hidden="hidden"], .media[hidden] {
display: none
}
body {margin: 0.5em;}
body {
margin: 0.5em;
}
button {
background: rgba(255, 255, 255, 0.65);
@ -56,40 +62,87 @@ a:hover, a:active {
.bracketed {
color: var(--edit-link-color);
}
.bracketed, h1 a {
.bracketed, #main-nav a {
text-shadow: var(--link-shadow);
}
.bracketed:before {content: '[\00a0'}
.bracketed:after {content: '\00a0]'}
.bracketed:before {
content: '[\00a0'
}
.bracketed:after {
content: '\00a0]'
}
.bracketed:hover, .bracketed:active {
color: var(--edit-link-hover-color)
}
.grow-1 {flex-grow: 1}
.flex-wrap {flex-wrap: wrap}
.flex-no-wrap {flex-wrap: nowrap}
.flex-align-end {align-items: flex-end}
.flex-align-space-around {align-content: space-around}
.flex-justify-space-around {justify-content: space-around}
.flex-self-center {align-self:center}
.flex {display: flex}
.grow-1 {
flex-grow: 1
}
.flex-wrap {
flex-wrap: wrap
}
.flex-no-wrap {
flex-wrap: nowrap
}
.flex-align-end {
align-items: flex-end
}
.flex-align-space-around {
align-content: space-around
}
.flex-justify-space-around {
justify-content: space-around
}
.flex-self-center {
align-self: center
}
.flex {
display: flex
}
.small-font {
font-size: 1.6rem;
}
.justify {text-align:justify}
.align_center {text-align:center !important}
.align_left {text-align:left !important}
.align_right {text-align:right !important}
.justify {
text-align: justify
}
.valign_top {vertical-align:top}
.align_center {
text-align: center !important
}
.no_border {border:none}
.align_left {
text-align: left !important
}
.align_right {
text-align: right !important
}
.valign_top {
vertical-align: top
}
.no_border {
border: none
}
.media-wrap {
text-align: center;
margin: 0 auto;
position: relative;
}
.danger {
@ -111,6 +164,7 @@ a:hover, a:active {
padding: 0 0.5em;
padding: 0 0.5rem;
}
.user-btn:hover, .user-btn:active {
border-color: var(--edit-link-hover-color);
background-color: var(--edit-link-hover-color);
@ -120,6 +174,20 @@ a:hover, a:active {
width: 100%;
}
/* -----------------------------------------------------------------------------
Main Nav
------------------------------------------------------------------------------*/
#main-nav {
font-family: var(--default-font-list);
margin: 2em 0 1.6em;
margin: 2rem 0 1.6rem;
border-bottom: .1rem solid rgba(0, 0, 0, 0.2);
font-size: 3.6em;
font-size: 3.6rem;
font-style: normal;
font-weight: 500;
}
/* -----------------------------------------------------------------------------
CSS loading icon
------------------------------------------------------------------------------*/
@ -197,17 +265,22 @@ a:hover, a:active {
.sorting_desc {
vertical-align: text-bottom;
}
.sorting::before {
content: " ↕\00a0";
}
.sorting_asc::before {
content: " ↑\00a0";
}
.sorting_desc::before {
content: " ↓\00a0";
}
.form { width:100%; }
.form {
width: 100%;
}
.form thead th, .form thead tr {
background: inherit;
@ -219,6 +292,7 @@ a:hover, a:active {
min-width: 25px;
max-width: 30%;
}
.form tr > td:nth-child(even) {
text-align: left;
width: 70%;
@ -227,6 +301,7 @@ a:hover, a:active {
.invisible tbody > tr:nth-child(odd) {
background: inherit;
}
.invisible tr, .invisible td, .invisible th {
border: 0;
}
@ -280,6 +355,7 @@ a:hover, a:active {
border: 1px solid #1f8454;
background: #70dda9;
}
.message.success .icon::after {
content: '✔'
}
@ -305,6 +381,7 @@ a:hover, a:active {
width: 220px;
height: 311px;
margin: var(--normal-padding);
z-index: 0;
}
.media > img,
@ -322,11 +399,10 @@ a:hover, a:active {
.medium_metadata > div,
.row {
text-shadow: var(--shadow);
background: var(--title-overlay-fallback);
background: var(--title-overlay);
color: var(--text-color);
padding: var(--normal-padding);
text-align: right;
z-index: 2;
}
.media_type, .age_rating {
@ -349,42 +425,74 @@ a:hover, a:active {
position: absolute;
top: 0;
}
.small_character:hover > .name,
.character:hover > .name,
.media:hover > .name,
.media:hover > .media_metadata > div,
.media:hover > .medium_metadata > div,
.media:hover > .table .row
{
transition: .25s ease;
.media > .name a {
transition: none;
}
.media .name a::before {
/* background: var(--title-overlay-fallback);
background: var(--title-overlay); */
content: '';
display: block;
height: 311px;
left: 0;
position: absolute;
top: 0;
width: 220px;
z-index: -1; /* Put the pseudo-element behind its parent */
}
.media-list .media:hover .name a::before {
/* transition: .25s ease; */
background: rgba(0, 0, 0, 0.75);
}
.media > .name span.canonical {
font-weight: bold;
}
.media > .name small {
font-weight: normal;
}
.media:hover .name {
background: rgba(0, 0, 0, 0.75);
}
.media-list .media > .name a:hover,
.media-list .media > .name a:hover small {
color: var(--blue-link);
}
.media:hover > button[hidden],
.media:hover > .edit_buttons[hidden]
{
.media:hover > .edit_buttons[hidden] {
transition: .25s ease;
display: block;
}
.media:hover {
transition: .25s ease;
}
.small_character > .name a,
.small_character > .name a small,
.character > .name a,
.character > .name a small,
.media > .name a,
.media > .name a small
{
.media > .name a small {
background: none;
color: #fff;
text-shadow: var(--shadow);
}
/* -----------------------------------------------------------------------------
Anime-list-specific styles
------------------------------------------------------------------------------*/
.anime .name, .manga .name {
background: var(--title-overlay-fallback);
background: var(--title-overlay);
text-align: center;
width: 100%;
padding: 0.5em 0.25em;
@ -401,7 +509,6 @@ a:hover, a:active {
text-align: center;
}
.anime .table, .manga .table {
position: absolute;
bottom: 0;
@ -411,8 +518,6 @@ a:hover, a:active {
.anime .row, .manga .row {
width: 100%;
background: var(--title-overlay-fallback);
background: var(--title-overlay);
display: flex;
align-content: space-around;
justify-content: space-around;
@ -422,6 +527,7 @@ a:hover, a:active {
.anime .row > span, .manga .row > span {
text-align: left;
z-index: 2;
}
.anime .row > div, .manga .row > div {
@ -430,14 +536,26 @@ a:hover, a:active {
align-self: center;
text-align: center;
vertical-align: middle;
z-index: 2;
}
.anime .media > button.plus_one {
border-color: hsla(0, 0%, 100%, .65);
position: absolute;
top: 138px;
top: calc(50% - 21.5px);
left: 44px;
left: calc(50% - 66.5px);
z-index: 50;
}
.anime .media > button.plus_one:hover {
color: hsla(0, 0%, 100%, .65);
background: #888;
}
.anime .media > button.plus_one:active {
background: #444;
}
/* -----------------------------------------------------------------------------
@ -456,11 +574,25 @@ a:hover, a:active {
.manga .media > .edit_buttons {
position: absolute;
top: 86px;
top: calc(50% - 58.5px);
/* top: calc(50% - 58.5px); */
top: calc(50% - 22.4px);
left: 43.5px;
left: calc(50% - 66.5px);
z-index: 50;
}
.manga .media > .edit_buttons button {
border-color: hsla(0, 0%, 100%, .65);
}
.manga .media > .edit_buttons:hover button {
color: hsla(0, 0%, 100%, .65);
background: #888;
}
.manga .media > .edit_buttons button:active {
background: #444;
}
/* -----------------------------------------------------------------------------
Search page styles
@ -493,11 +625,13 @@ a:hover, a:active {
left: 0;
height: 100%;
width: 100%;
z-index: 5;
}
#series_list article.media {
position: relative;
}
#series_list .name, #series_list .name label {
position: absolute;
display: block;
@ -508,6 +642,7 @@ a:hover, a:active {
vertical-align: middle;
line-height: 1.25em;
}
#series_list .name small {
color: #fff;
}
@ -546,6 +681,7 @@ a:hover, a:active {
.details .media_details {
max-width: 300px;
}
.details .media_details td {
padding: 0 1.5rem;
}
@ -559,18 +695,25 @@ a:hover, a:active {
white-space: nowrap;
text-align: right;
}
.details .media_details td:nth-child(even) {
text-align: left;
}
.character,
.small_character {
background: rgba(0,0,0,0.5);
/* background: rgba(0,0,0,0.5); */
width: 225px;
height: 350px;
vertical-align: middle;
white-space: nowrap;
}
.character:hover .name,
.small_character:hover .name {
background: rgba(0, 0, 0, 0.8);
}
.small_character a {
display: inline-block;
width: 100%;
@ -646,9 +789,19 @@ a:hover, a:active {
vertical-align: middle;
}
.cover_streaming_link {
display:none;
}
.media:hover .cover_streaming_link {
display: block;
}
.cover_streaming_link .streaming-logo {
width: 20px;
height: 20px;
-webkit-filter: drop-shadow(0 -1px 4px #fff);
filter: drop-shadow(0 -1px 4px #fff);
}
/* ----------------------------------------------------------------------------

View File

@ -49,7 +49,7 @@
return;
}
if (data.data.status === 'completed') {
if (resData.data.attributes.status === 'completed') {
_.hide(parentSel);
}

View File

@ -1,16 +1,15 @@
const LightTableSorter = (function() {
let _cellIndex, _onClickEvent, _order, _reset, _sort, _text, _th, _toggle;
_th = null;
_cellIndex = null;
_order = '';
_text = function(row) {
return row.cells.item(_cellIndex).textContent.toLowerCase();
'use strict';
const LightTableSorter = (() => {
let th = null;
let cellIndex = null;
let order = '';
const text = (row) => {
return row.cells.item(cellIndex).textContent.toLowerCase();
};
_sort = function(a, b) {
let n, textA, textB;
textA = _text(a);
textB = _text(b);
n = parseInt(textA, 10);
const sort = (a, b) => {
let textA = text(a);
let textB = text(b);
const n = parseInt(textA, 10);
if (n) {
textA = n;
textB = parseInt(textB, 10);
@ -23,51 +22,49 @@ const LightTableSorter = (function() {
}
return 0;
};
_toggle = function() {
let c;
c = _order !== 'sorting_asc' ? 'sorting_asc' : 'sorting_desc';
_th.className = (_th.className.replace(_order, '') + ' ' + c).trim();
return _order = c;
const toggle = () => {
const c = order !== 'sorting_asc' ? 'sorting_asc' : 'sorting_desc';
th.className = (th.className.replace(order, '') + ' ' + c).trim();
return order = c;
};
_reset = function() {
_th.className = _th.className.replace('sorting_asc', 'sorting').replace('sorting_desc', 'sorting');
return _order = '';
const reset = () => {
th.classList.remove('sorting_asc', 'sorting_desc');
th.classList.add('sorting');
return order = '';
};
_onClickEvent = function(e) {
let row, rows, tbody, _i, _len;
if (_th && (_cellIndex !== e.target.cellIndex)) {
_reset();
const onClickEvent = (e) => {
if (th && (cellIndex !== e.target.cellIndex)) {
reset();
}
_th = e.target;
if (_th.nodeName.toLowerCase() === 'th') {
_cellIndex = _th.cellIndex;
tbody = _th.offsetParent.getElementsByTagName('tbody')[0];
rows = tbody.rows;
th = e.target;
if (th.nodeName.toLowerCase() === 'th') {
cellIndex = th.cellIndex;
const tbody = th.offsetParent.getElementsByTagName('tbody')[0];
let rows = Array.from(tbody.rows);
if (rows) {
rows = Array.prototype.slice.call(rows, 0);
rows = Array.prototype.sort.call(rows, _sort);
if (_order === 'sorting_asc') {
Array.prototype.reverse.call(rows);
rows.sort(sort);
if (order === 'sorting_asc') {
rows.reverse();
}
_toggle();
toggle();
tbody.innerHtml = '';
for (_i = 0, _len = rows.length; _i < _len; _i++) {
row = rows[_i];
rows.forEach(row => {
tbody.appendChild(row);
}
});
}
}
};
return {
init: function() {
init: () => {
let ths = document.getElementsByTagName('th');
let _results = [];
for (let _i = 0, _len = ths.length; _i < _len; _i++) {
let th = ths[_i];
th.className = 'sorting';
_results.push(th.onclick = _onClickEvent);
let results = [];
for (let i = 0, len = ths.length; i < len; i++) {
let th = ths[i];
th.classList.add('sorting');
results.push(th.onclick = onClickEvent);
}
return _results;
return results;
}
};
})();