style: 好讀版稿本2
This commit is contained in:
@@ -1,52 +1,4 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* 水晶男孩入坑申請書(表單練習用)
|
|
||||||
* POST 送回本頁;尚未寫入資料庫。
|
|
||||||
*/
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
function fansform_h(?string $value): string
|
|
||||||
{
|
|
||||||
return htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fansform_post(string $key, string $default = ''): string
|
|
||||||
{
|
|
||||||
return isset($_POST[$key]) ? (string) $_POST[$key] : $default;
|
|
||||||
}
|
|
||||||
|
|
||||||
function fansform_post_array(string $key): array
|
|
||||||
{
|
|
||||||
if (!isset($_POST[$key]) || !is_array($_POST[$key])) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return array_map('strval', $_POST[$key]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$isPost = $_SERVER['REQUEST_METHOD'] === 'POST';
|
|
||||||
$submitted = false;
|
|
||||||
$errors = [];
|
|
||||||
|
|
||||||
if ($isPost) {
|
|
||||||
$nickname = trim(fansform_post('fan_nickname'));
|
|
||||||
$email = trim(fansform_post('fan_email'));
|
|
||||||
|
|
||||||
if ($nickname === '') {
|
|
||||||
$errors['fan_nickname'] = '請填寫應援小黃暱稱';
|
|
||||||
}
|
|
||||||
if ($email === '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
|
||||||
$errors['fan_email'] = '請填寫有效的聯絡信箱';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($errors === []) {
|
|
||||||
$submitted = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$biasChecked = ($isPost && !$submitted) ? fansform_post_array('bias') : [];
|
|
||||||
$eventPoll = fansform_post('event_poll');
|
|
||||||
$favoriteSong = fansform_post('favorite_song');
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh-TW">
|
<html lang="zh-TW">
|
||||||
|
|
||||||
|
|||||||
@@ -264,6 +264,49 @@
|
|||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 文繞圖:float + shape-outside(依圖 alpha 輪廓;底需透明 PNG 才非矩形) */
|
||||||
|
body.ebook-ssg2-page.totoga2-page #totoga2-reader .container.readable-text-wrap {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.ebook-ssg2-page.totoga2-page #totoga2-reader .container.readable-text-wrap::after {
|
||||||
|
content: "";
|
||||||
|
display: table;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.ebook-ssg2-page.totoga2-page #totoga2-reader .container.readable-text-wrap>section.ebook-intro.section {
|
||||||
|
clear: none;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.ebook-ssg2-page.totoga2-page #totoga2-reader .container.readable-text-wrap>section.ebook-intro.section::after {
|
||||||
|
content: "";
|
||||||
|
display: table;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.ebook-ssg2-page.totoga2-page #totoga2-reader .container.readable-text-wrap .readable-text-wrap__figure {
|
||||||
|
float: left;
|
||||||
|
width: min(42%, 18rem);
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
object-fit: contain;
|
||||||
|
margin: 0.25rem 0 0.75rem 0;
|
||||||
|
border-radius: 10px;
|
||||||
|
shape-outside: url("/totoga2/readable/04-2_totoka.png");
|
||||||
|
-webkit-shape-outside: url("/totoga2/readable/04-2_totoka.png");
|
||||||
|
shape-margin: 0.65rem;
|
||||||
|
shape-image-threshold: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.ebook-ssg2-page.totoga2-page #totoga2-reader .container.readable-text-wrap>section.ebook-intro.section>h3 {
|
||||||
|
text-align: center;
|
||||||
|
clear: both;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
/* container22 內兩張圖上下排列 */
|
/* container22 內兩張圖上下排列 */
|
||||||
body.ebook-ssg2-page.totoga2-page #totoga2-reader .readable-col-2--stack {
|
body.ebook-ssg2-page.totoga2-page #totoga2-reader .readable-col-2--stack {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Reference in New Issue
Block a user