From 7265033f52fb1bea358bc2c62408be95325cf4f4 Mon Sep 17 00:00:00 2001 From: Jared Smith Date: Sat, 5 Dec 2020 22:03:06 -0500 Subject: [PATCH 1/6] Sprinkle in action hooks for output from conditions plugin --- front-page.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/front-page.php b/front-page.php index f10542e..5b60bbc 100644 --- a/front-page.php +++ b/front-page.php @@ -64,10 +64,14 @@ $obdate->setTimezone(WpDateTimeZone::getWpTimezone()); } ?> - + +

CURRENTLY

@@ -97,6 +101,7 @@ ?>

Forecast

+
Forecast for Charleston updated at formatTime() ?> on formatDate(); ?>
    Date: Sun, 30 Jan 2022 12:49:23 -0500 Subject: [PATCH 2/6] WIP --- header.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/header.php b/header.php index 5f8375f..6678b10 100644 --- a/header.php +++ b/header.php @@ -1,5 +1,6 @@ + @@ -8,11 +9,16 @@ - + + >

    #chswx

    +
    -

    Blog

    +

    Blog

    + \ No newline at end of file From b11e11884357462c17997151afe567f8df9d075a Mon Sep 17 00:00:00 2001 From: Jared Smith Date: Fri, 7 Jul 2023 10:43:26 -0400 Subject: [PATCH 3/6] Why in the world am I loading jquery? --- composer.json | 2 +- front-page.php | 6 +++--- functions.php | 8 -------- header.php | 2 +- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index a4a6b68..7e5e4e2 100644 --- a/composer.json +++ b/composer.json @@ -19,4 +19,4 @@ "email": "jared@chswx.com" } ] -} +} \ No newline at end of file diff --git a/front-page.php b/front-page.php index 5b60bbc..87a187e 100644 --- a/front-page.php +++ b/front-page.php @@ -71,7 +71,7 @@

    CURRENTLY

    @@ -90,7 +90,7 @@
    Temporarily Unavailable
    - +

    Forecast

    - +
    Forecast for Charleston updated at formatTime() ?> on formatDate(); ?>
      - +

      Blog

      From e996d2352555496616065c42c1f6cbf45c354c7c Mon Sep 17 00:00:00 2001 From: Jared Smith Date: Fri, 7 Jul 2023 12:19:37 -0400 Subject: [PATCH 4/6] Decoupling complete --- composer.json | 3 +- composer.lock | 51 ++-------------------- front-page.php | 115 +++---------------------------------------------- 3 files changed, 9 insertions(+), 160 deletions(-) diff --git a/composer.json b/composer.json index 7e5e4e2..34271e2 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,6 @@ } ], "require": { - "rarst/wpdatetime": "0.3", "olifolkerd/convertor": "dev-master" }, "license": "GPLv2", @@ -19,4 +18,4 @@ "email": "jared@chswx.com" } ] -} \ No newline at end of file +} diff --git a/composer.lock b/composer.lock index df9b22b..be48eed 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cc540301c4d9ab9a8b8d8ede4d1c9d13", + "content-hash": "af622f20e7b6a50d9873292dc8d84ea9", "packages": [ { "name": "olifolkerd/convertor", @@ -44,52 +44,6 @@ "issues": "https://github.com/olifolkerd/convertor/issues" }, "time": "2018-04-02T16:26:04+00:00" - }, - { - "name": "rarst/wpdatetime", - "version": "0.3", - "source": { - "type": "git", - "url": "https://github.com/Rarst/wpdatetime.git", - "reference": "d6e48db062f97788fba7ad150d66a3df5a0c9338" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Rarst/wpdatetime/zipball/d6e48db062f97788fba7ad150d66a3df5a0c9338", - "reference": "d6e48db062f97788fba7ad150d66a3df5a0c9338", - "shasum": "" - }, - "require": { - "php": ">=5.5.10" - }, - "require-dev": { - "brain/monkey": "^2.1", - "pds/skeleton": "^1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Rarst\\WordPress\\DateTime\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Andrey Savchenko", - "homepage": "https://www.Rarst.net/" - } - ], - "description": "Extension of PHP’s DateTime and DateTimeZone classes for WordPress context.", - "keywords": [ - "date", - "time", - "timezone", - "wordpress" - ], - "time": "2018-03-16T12:37:09+00:00" } ], "packages-dev": [], @@ -101,5 +55,6 @@ "prefer-stable": false, "prefer-lowest": false, "platform": [], - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.3.0" } diff --git a/front-page.php b/front-page.php index 87a187e..7ae2541 100644 --- a/front-page.php +++ b/front-page.php @@ -1,122 +1,17 @@ 28 && $temperature < 50) { - $tempcolor = "cold"; - } else if ($temperature >= 50 && $temperature < 70) { - $tempcolor = "moderate"; - } else if ($temperature >= 70 && $temperature < 83) { - $tempcolor = "warm"; - } else if ($temperature >= 83 && $temperature < 95) { - $tempcolor = "verywarm"; - } else { - $tempcolor = "hot"; - } - - // Sensible weather - $sky = $ob['weather']; - - // Winds - if ($ob['wind_mph'] === 0) { - $wind = "Calm"; - } else { - $wind = $ob['wind_dir'] . " " . $ob['wind_mph']; - } - - if ($ob['wind_gust_mph'] > 0) { - $wind .= " (gust {$ob['wind_gust_mph']})"; - } - - // Other statistics - $dewpoint = $ob['dewpoint_f'] . "°F"; - $rh = $ob['relative_humidity']; - $pressure = $ob['pressure_in'] . " in"; - $obdate = new WpDateTime(); - $obdate->setTimestamp($ob['observation_epoch']); - $obdate->setTimezone(WpDateTimeZone::getWpTimezone()); -} -?> -

      CURRENTLY

      - -
      - -
      Feels Like
      - -
      -
        -
      • Wind
      • -
      • Pressure
      • -
      • Dewpoint
      • -
      • Humidity
      • -
      -
      last updated at formatTime(); ?> on formatDate(); ?>
      - -
      Temporarily Unavailable
      - +
      -setTimestamp($data['forecast']['updated']); - $fcstdate->setTimezone(WpDateTimeZone::getWpTimezone()); - } -?> -
      -

      Forecast

      - -
      Forecast for Charleston updated at formatTime() ?> on formatDate(); ?>
      -
        -
      • -
        Forecast temporarily unavailable
        - -
      -
      - +
      +

      Forecast

      + +
      'post', From a70d9d27ff4e4da60459c6e01e6a0c2402fb4e8e Mon Sep 17 00:00:00 2001 From: Jared Smith Date: Fri, 7 Jul 2023 12:46:32 -0400 Subject: [PATCH 5/6] Add outdated alert --- css/responsive-style.css | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/css/responsive-style.css b/css/responsive-style.css index 9d89384..881367e 100644 --- a/css/responsive-style.css +++ b/css/responsive-style.css @@ -103,6 +103,21 @@ div#currentwx #temp.hot { color: rgb(146, 0, 0); } +div.system-message.outdated-data { + font-size: 0.75em; + font-weight: bold; + margin: -10px auto 20px auto; + padding: 10px 20px; + border-radius: 0.5em; + text-align: center; + display: inline-block; +} + +div.system-message.outdated-data::before { + content: '\26A0'; + padding-right: 3px; +} + #sky { font-size: 2em; font-weight: 600; From 2fc1271bb612eb3b2b84a8ad96d6a7d9c8ef2706 Mon Sep 17 00:00:00 2001 From: Jared Smith Date: Fri, 7 Jul 2023 13:16:11 -0400 Subject: [PATCH 6/6] failure modes --- css/responsive-style.css | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/css/responsive-style.css b/css/responsive-style.css index 881367e..be0097c 100644 --- a/css/responsive-style.css +++ b/css/responsive-style.css @@ -118,6 +118,28 @@ div.system-message.outdated-data::before { padding-right: 3px; } +div.fail { + margin-bottom: 32px; + color: #555; + display: inline-block; + background-color: #ffdfdf; + border: 1px solid #ff9f9f; + border-radius: 5px; + padding: 30px 30px 32px 30px; +} + +div.fail h3 { + font-size: 2em; + margin: 0px; + padding: 0px; + color: #9f6363; +} + +div.fail p { + font-size: 0.8em; + margin: 3px 0 0 0; +} + #sky { font-size: 2em; font-weight: 600; @@ -680,6 +702,21 @@ article.full-post .entry-footer.tagged .meta { background: linear-gradient(180deg, rgba(39, 39, 142, 1) 0%, rgb(122, 151, 194) 100%); } + div.fail { + color: #EEE; + background-color: #9f6363; + border: 1px solid #7f2f2f; + } + + div.fail h3 { + color: #ffbfbf; + } + + div.system-message { + background-color: #9e8300; + border: 1px solid #a18508; + } + .home h2, .alternate, a {