Browse Source

refactor: about hero → native vanilla fade-carousel; drop Bootstrap Tooltip

- page-about.php: #caro-lead .carousel/.carousel-fade → .dw-fade-carousel;
  carousel-items → .dw-fade-slide; indicators → .dw-fade-dots buttons.
  Unwrap the tech-icon grid's tooltip anchors (<a data-toggle=tooltip title>)
  to bare icon spans — tooltips dropped entirely.
- js/about.js: rewritten — vanilla fade engine (dots, arrow keys, wrap:false,
  hover-pause), #brain DrawFillSVG draw, #tv video; dw_hidenav ported off
  jQuery; dropped bootstrap.Carousel + .tooltip() + dead caption/debug code.
  jquery-validation + FullCalendar kept.
- css/styles.scss: .dw-fade-dots/.dw-fade-dot styles.

About now uses no Bootstrap JS. Only index.php's carousel remains before
import * as bootstrap can go. (Checkpoint ahead of the work/studio/about
restructuring.)
windhamdavid 2 days ago
parent
commit
a44e6d9fa8
4 changed files with 175 additions and 156 deletions
  1. 26 0
      css/styles.scss
  2. 125 132
      js/about.js
  3. 24 24
      page-about.php
  4. 0 0
      v4-style.min.css

+ 26 - 0
css/styles.scss

@@ -265,3 +265,29 @@ $enable-negative-margins: true;
 #studio-tab .tab-pane.active {
   display: block;
 }
+
+// About fade-carousel indicator dots (replaces Bootstrap .carousel-indicators).
+.dw-fade-dots {
+  position: absolute;
+  bottom: 1.5rem;
+  left: 0;
+  right: 0;
+  z-index: 3;
+  display: flex;
+  justify-content: center;
+  gap: 0.5rem;
+}
+.dw-fade-dot {
+  width: 12px;
+  height: 12px;
+  padding: 0;
+  border: 1px solid #fff;
+  border-radius: 50%;
+  background: transparent;
+  opacity: 0.6;
+  cursor: pointer;
+}
+.dw-fade-dot.active {
+  background: #fff;
+  opacity: 1;
+}

+ 125 - 132
js/about.js

@@ -1,145 +1,138 @@
-
-const aboutCarouselElement = document.querySelector('#caro-lead')
-const carousel = new bootstrap.Carousel(aboutCarouselElement, {
-  interval: 5000,
-  wrap: false
-});
-
-jQuery(document).ready(function($) {
-
-  $(function () {
-    $('[data-toggle="tooltip"]').tooltip()
-  })
-
-  var person = localStorage.getItem('person');
-  console.log('person ' + person + ' from localstorage' )
-
-  $('.nav-toggle').on('touchstart click', function(e) {
-  	e.preventDefault();
-  	$( this ).toggleClass( 'active' );
+// About page hero — vanilla fade-carousel (replaces Bootstrap Carousel).
+(function () {
+  const caro = document.getElementById('caro-lead');
+  const tv = document.getElementById('tv'); // full-bleed grayscale bg video
+  if (tv) { try { tv.play(); } catch (e) {} }
+  if (!caro) return;
+
+  const slides = Array.from(caro.querySelectorAll('.dw-fade-slide'));
+  const dots = Array.from(caro.querySelectorAll('.dw-fade-dot'));
+  const INTERVAL = 5000;
+  let index = 0;
+  let timer = null;
+
+  // The brain slide's #brain SVG ships with .hide-svg; reveal + line-draw it.
+  function drawBrain(slide) {
+    const brain = slide.querySelector('#brain');
+    if (!brain || !window.DrawFillSVG) return;
+    window.setTimeout(function () {
+      brain.classList.remove('hide-svg', 'fade-svg');
+      try { new window.DrawFillSVG({ elementId: 'brain' }).replay(); } catch (e) {}
+    }, 600);
+  }
+
+  function activate(i) {
+    i = Math.max(0, Math.min(slides.length - 1, i)); // wrap:false → clamp
+    index = i;
+    slides.forEach((s, n) => s.classList.toggle('active', n === i));
+    dots.forEach((d, n) => d.classList.toggle('active', n === i));
+    drawBrain(slides[i]);
+  }
+
+  function next() {
+    if (index >= slides.length - 1) { stop(); return; } // wrap:false — stop at end
+    activate(index + 1);
+  }
+  function start() { stop(); timer = window.setInterval(next, INTERVAL); }
+  function stop() { if (timer) { window.clearInterval(timer); timer = null; } }
+
+  dots.forEach(function (d) {
+    d.addEventListener('click', function (e) {
+      e.preventDefault();
+      activate(parseInt(d.dataset.slide, 10) || 0);
+      start();
+    });
   });
 
-  $(function dw_hidenav() {
-    var headerHeight = $('.navbar').height();
-    $(window).on('scroll', { previousTop: 0 },
-    function() {
-      var currentTop = $(window).scrollTop();
-      if (currentTop < this.previousTop) {
-        if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
-          $('.navbar').addClass('visible');
-          $('.site-title a').removeClass('light');
-        } else {
-          $('.navbar').removeClass('visible fixed');
-          $('.site-title a').addClass('light');
-          }
-        }
-        else {
-          $('.navbar').removeClass('visible');
-          if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
-        }
-        this.previousTop = currentTop;
-      }
-    );
+  document.addEventListener('keyup', function (e) {
+    if (e.key === 'ArrowRight') activate(index + 1);
+    else if (e.key === 'ArrowLeft') activate(index - 1);
   });
 
-	var vidout = document.getElementById('tv');
-    vidout.play();
-
-
-  $(document).on('keyup', function(e) {
-    if(e.which === 39){
-  	$('#caro-lead').carousel('next');
-    }
-    else if(e.which === 37){
-  	$('#caro-lead').carousel('prev');
+  caro.addEventListener('mouseenter', stop);
+  caro.addEventListener('mouseleave', start);
+
+  activate(0);
+  start();
+})();
+
+// navbar hide/show on scroll (ported from jQuery dw_hidenav)
+(function () {
+  const navbar = document.querySelector('.navbar');
+  if (!navbar) return;
+  const title = document.querySelector('.site-title a');
+  const headerHeight = navbar.offsetHeight;
+  let previousTop = 0;
+  window.addEventListener('scroll', function () {
+    const currentTop = window.scrollY;
+    if (currentTop < previousTop) {
+      if (currentTop > 0 && navbar.classList.contains('fixed')) {
+        navbar.classList.add('visible');
+        if (title) title.classList.remove('light');
+      } else {
+        navbar.classList.remove('visible', 'fixed');
+        if (title) title.classList.add('light');
+      }
+    } else {
+      navbar.classList.remove('visible');
+      if (currentTop > headerHeight && !navbar.classList.contains('fixed')) {
+        navbar.classList.add('fixed');
+      }
     }
+    previousTop = currentTop;
+  }, { passive: true });
+})();
+
+document.querySelectorAll('.nav-toggle').forEach(function (el) {
+  el.addEventListener('click', function (e) {
+    e.preventDefault();
+    el.classList.toggle('active');
   });
-
-  $('#caro-lead').on('slid.bs.carousel', function(event) {
-  	var consta = $('#caro-lead li.active');
-    //console.log('target: ' + consta.data('target') + ' value: ' + ' slide-to: ' + consta.data('slideTo'));
-    $('.carousel-caption').fadeIn(600);
-  	setTimeout(function() {
-  		if (consta.data('slideTo') === 0) {
-
-  		}
-  		if (consta.data('slideTo') === 1) {
-
-  		}
-  		if (consta.data('slideTo') === 2) {
-
-  		}
-  	}, 10);
-  });
-
-	$('#caro-lead').on('slid.bs.carousel', function() {
-		$('.active #brain').delay(5000).removeClass('hide-svg fade-svg');
-		var animac = new DrawFillSVG({elementId: 'brain'});
-		animac.replay();
-	});
-
-
-
-
-/*============================================
-		      Form
-==============================================*/
-
-$('#commentform').validate({
-	rules: {
-		author: {
-			required: true,
-			minlength: 2
-		},
-		email: {
-			required: true,
-			email: true
-		},
-		comment: {
-			required: true,
-			minlength: 3
-		}
-	},
-	messages: {
-		author: 'Please enter in your name.',
-		email: 'Please enter a valid email address.',
-		comment: 'Nothing to Say?'
-	},
-	errorElement: 'div',
-	errorPlacement: function(error, element) {
-		element.before(error);
-	}
 });
 
-/*============================================
-		      Calendar
-==============================================*/
+// Comment-form validation (jquery-validation) + FullCalendar still use jQuery.
+jQuery(document).ready(function ($) {
 
-var calendarEl = document.getElementById('calendar');
-  var calendar = new FullCalendar.Calendar(calendarEl, {
-    headerToolbar: {
-      start: 'title',
-      center: '',
-      end: 'prev,next'
-    },
-  	firstDay : 1,
-  	height: 380,
-    views: {
-      dayGrid: { hiddenDays: [ 0,6,7 ] },
-      timeGrid: {
-        slotMinTime: '08:00:00',
-        slotMaxTime: '17:00:00',
-        dayHeaderFormat: { weekday: 'short' },
-        hiddenDays: [ 0,6,7 ]
-      },
+  $('#commentform').validate({
+    rules: {
+      author: { required: true, minlength: 2 },
+      email: { required: true, email: true },
+      comment: { required: true, minlength: 3 }
     },
-    googleCalendarApiKey: 'AIzaSyAGowGJYx6dOaQvG_vSUI73uT88VWOTcNQ',
-  	events: {
-      googleCalendarId: 'davidawindham.com_bvrht1f8n2vgldgjenpgfdd4bk@group.calendar.google.com',
-      className: 'gcal-event'
+    messages: {
+      author: 'Please enter in your name.',
+      email: 'Please enter a valid email address.',
+      comment: 'Nothing to Say?'
     },
-    eventDataTransform: function(event) { event.url = ""; return event; },
-    eventClick: function(info) { info.jsEvent.preventDefault(); }
+    errorElement: 'div',
+    errorPlacement: function (error, element) {
+      element.before(error);
+    }
   });
-calendar.render();
+
+  var calendarEl = document.getElementById('calendar');
+  if (calendarEl) {
+    var calendar = new FullCalendar.Calendar(calendarEl, {
+      headerToolbar: { start: 'title', center: '', end: 'prev,next' },
+      firstDay: 1,
+      height: 380,
+      views: {
+        dayGrid: { hiddenDays: [0, 6, 7] },
+        timeGrid: {
+          slotMinTime: '08:00:00',
+          slotMaxTime: '17:00:00',
+          dayHeaderFormat: { weekday: 'short' },
+          hiddenDays: [0, 6, 7]
+        }
+      },
+      googleCalendarApiKey: 'AIzaSyAGowGJYx6dOaQvG_vSUI73uT88VWOTcNQ',
+      events: {
+        googleCalendarId: 'davidawindham.com_bvrht1f8n2vgldgjenpgfdd4bk@group.calendar.google.com',
+        className: 'gcal-event'
+      },
+      eventDataTransform: function (event) { event.url = ''; return event; },
+      eventClick: function (info) { info.jsEvent.preventDefault(); }
+    });
+    calendar.render();
+  }
 });

+ 24 - 24
page-about.php

@@ -11,14 +11,14 @@ get_header(); ?>
 	</video>
 
 	<div class="container-full leader about-caro">
-		<div id="caro-lead" class="carousel slide carousel-fade" data-bs-ride="carousel">
-      <div class="carousel-indicators">
-				<li data-bs-target="#caro-lead" data-bs-slide-to="0" class="active"></li>
-				<li data-bs-target="#caro-lead" data-bs-slide-to="1"></li>
-				<li data-bs-target="#caro-lead" data-bs-slide-to="2"></li>
+		<div id="caro-lead" class="dw-fade-carousel">
+      <div class="dw-fade-dots">
+				<button type="button" class="dw-fade-dot active" data-slide="0" aria-label="Slide 1"></button>
+				<button type="button" class="dw-fade-dot" data-slide="1" aria-label="Slide 2"></button>
+				<button type="button" class="dw-fade-dot" data-slide="2" aria-label="Slide 3"></button>
       </div>
-			<div class="carousel-inner">
-        <div class="carousel-item active" data-id="0">
+			<div class="dw-fade-track">
+        <div class="dw-fade-slide active" data-id="0">
           <div class="container web">
             <h1 class="light super cm-concrete">There are over<br/>1,000,000,000</h1>
             <h2 class="light cm-concrete">Web Sites on the Internet</h2>
@@ -26,14 +26,14 @@ get_header(); ?>
           </div>
         </div>
 
-        <div class="carousel-item" data-id="1">
+        <div class="dw-fade-slide" data-id="1">
           <div class="container constellation">
             <h1 class="light super cm-concrete" data-wow-duration="4s">There are over<br/>400,000,000,000</h1>
             <h2 class="light cm-concrete">Stars in the Milky Way Galaxy</h2>
           </div>
         </div>
 
-        <div class="carousel-item" data-id="2">
+        <div class="dw-fade-slide" data-id="2">
 				  <div class="container brain">
 						<div class="row">
 							<div class="col-sm-6">
@@ -90,26 +90,26 @@ get_header(); ?>
 							<div class="table-responsive icon-grid">
 							  <table class="table table-condensed icons" style><tbody>
 									<tr>
-										<td><a href="#" data-toggle="tooltip" title="Ubuntu"><span style="color:#DD4814" class="icon-ubuntu fa-2x"></span></a></td>
-										<td><a href="#" data-toggle="tooltip" title="Apache"><span style="color:#FB00D5" class="icon-apache fa-2x"></span></a></td>
-										<td><a href="#" data-toggle="tooltip" title="Nginx"><span style="color:#009900" class="icon-nginx fa-2x"></span></a></td>
-										<td><a href="#" data-toggle="tooltip" title="Heroku"><span style="color:#565297" class="icon-heroku fa-2x"></span></a></td>
-										<td><a href="#" data-toggle="tooltip" title="AWS"><span style="color:#F7981D" class="icon-aws fa-2x"></span></a></td>
+										<td><span style="color:#DD4814" class="icon-ubuntu fa-2x"></span></td>
+										<td><span style="color:#FB00D5" class="icon-apache fa-2x"></span></td>
+										<td><span style="color:#009900" class="icon-nginx fa-2x"></span></td>
+										<td><span style="color:#565297" class="icon-heroku fa-2x"></span></td>
+										<td><span style="color:#F7981D" class="icon-aws fa-2x"></span></td>
 
 									</tr>
 									<tr>
-										<td><a href="#" data-toggle="tooltip" title="Rails"><span style="color:#AC2B33" class="icon-ruby-on-rails fa-2x"></span></a></td>
-										<td><a href="#" data-toggle="tooltip" title="Node.js"><span style="color:#80BD01" class="icon-nodejs fa-2x"></span></a></td>
-										<td><a href="#" data-toggle="tooltip" title="Redis"><span style="color:#D71E13" class="icon-redis fa-2x"></span></a></td>
-										<td><a href="#" data-toggle="tooltip" title="MySQL"><span style="color:#E97A00" class="icon-mysql fa-2x"></span></a></td>
-										<td><a href="#" data-toggle="tooltip" title="PostgreSQL"><span style="color:#008AB8" class="icon-postgres fa-2x"></span></a></td>
+										<td><span style="color:#AC2B33" class="icon-ruby-on-rails fa-2x"></span></td>
+										<td><span style="color:#80BD01" class="icon-nodejs fa-2x"></span></td>
+										<td><span style="color:#D71E13" class="icon-redis fa-2x"></span></td>
+										<td><span style="color:#E97A00" class="icon-mysql fa-2x"></span></td>
+										<td><span style="color:#008AB8" class="icon-postgres fa-2x"></span></td>
 									</tr>
 									<tr>
-										<td><a href="#" data-toggle="tooltip" title="Javascript"><span style="color:#F0DB4F" class="icon-javascript fa-2x"></span></a></td>
-										<td><a href="#" data-toggle="tooltip" title="HTML"><span style="color:#E44D26;padding-top:7px;" class="fa fa-2x fa-html5"></span></a></td>
-										<td><a href="#" data-toggle="tooltip" title="Python"><span style="color:#306998" class="icon-python fa-2x"></span></a></td>
-										<td><a href="#" data-toggle="tooltip" title="PHP"><span style="color:#8892BF" class="icon-php fa-2x"></span></a></td>
-										<td><a href="#" data-toggle="tooltip" title="Ruby"><span style="color:#B10F01" class="icon-ruby fa-2x"></span></a></td>
+										<td><span style="color:#F0DB4F" class="icon-javascript fa-2x"></span></td>
+										<td><span style="color:#E44D26;padding-top:7px;" class="fa fa-2x fa-html5"></span></td>
+										<td><span style="color:#306998" class="icon-python fa-2x"></span></td>
+										<td><span style="color:#8892BF" class="icon-php fa-2x"></span></td>
+										<td><span style="color:#B10F01" class="icon-ruby fa-2x"></span></td>
 									</tr>
 								</tbody></table>
 							</div>

File diff suppressed because it is too large
+ 0 - 0
v4-style.min.css


Some files were not shown because too many files changed in this diff