Commit 3394daf8 authored by Matt Mascarenhas's avatar Matt Mascarenhas

hmml_to_html.c: Partially implement refs [#15]

It is missing the onRefChanged() function

PPiC 051
parent ce2feef7
This diff is collapsed.
#ifndef HMML_H_
#define HMML_H_
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdio.h>
// Data structures
typedef struct {
char* member;
char* twitch;
char* project;
char* title;
char* platform;
char* id;
char* annotator;
} HMML_VideoMetaData;
typedef struct {
char* site;
char* page;
char* url;
char* title;
char* article;
char* author;
char* editor;
char* publisher;
char* isbn;
int offset;
} HMML_Reference;
typedef enum {
HMML_CATEGORY,
HMML_MEMBER,
HMML_PROJECT,
HMML_MARKER_COUNT,
} HMML_MarkerType;
typedef struct {
HMML_MarkerType type;
char* text;
int offset;
} HMML_Marker;
typedef struct {
int id;
char* author;
} HMML_Quote;
typedef struct {
int line;
char* time;
char* text;
char* author;
HMML_Reference* references;
size_t reference_count;
HMML_Marker* markers;
size_t marker_count;
HMML_Quote quote;
bool is_quote;
} HMML_Annotation;
typedef struct {
int line;
char* message;
} HMML_Error;
typedef struct {
bool well_formed;
HMML_VideoMetaData metadata;
HMML_Annotation* annotations;
size_t annotation_count;
HMML_Error error;
} HMML_Output;
// Functions
HMML_Output hmml_parse_file (FILE* file);
void hmml_dump (HMML_Output* output);
void hmml_free (HMML_Output* output);
#endif
This diff is collapsed.
This diff is collapsed.
/* USER-DEFINED */
.marker .content {
width: 320px;
padding: 5px;
font-size: 14px;
}
.timecode {
font-size: 9px;
padding-right: 8px;
position: relative;
top: -2px;
}
.marker {
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.marker:hover > .content {
background-color: #222;
}
.marker:hover .faded .content {
background-color: rgba(139, 61, 35, 0.7);
color: black;
}
.marker > .content {
background-color: #161616;
color: #8A877D;
}
.marker.current > .content {
color: #B57714;
}
.marker .progress .content {
background-color: #8B3D23;
color: black;
}
/* MANDATORY */
.player_container {
display: flex;
flex-direction: row;
}
.video_container {
flex-grow: 1;
overflow: hidden;
}
.markers_container {
overflow-y: scroll;
position: relative;
}
.marker {
position: relative;
cursor: pointer;
}
.marker .content {
display: block;
box-sizing: border-box;
word-wrap: break-word;
}
.marker .progress {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 0px;
overflow: hidden;
}
/* CUSTOM PAGE STYLE */
body {
background-color: #222;
font-family: sans-serif;
color: white;
margin: 0;
padding: 0;
}
.title {
display: flex;
flex-direction: row;
background-color: #444;
}
.title > * {
padding: 10px;
}
.title .episode_name {
flex: 1 1;
}
.title > a {
color: rgba(38, 139, 210, 1);
text-decoration: none;
}
.title > a:visited {
color: rgba(38, 139, 210, 1);
}
.title > a:hover {
text-decoration: underline;
}
.title .refs_container {
position: relative;
transition: box-shadow 800ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
box-shadow: inset 0 0 0 #B57714;
}
.title .refs_container:hover {
background-color: #666;
}
.title .refs_container.current {
box-shadow: inset 0px 0px 30px #B57714;
}
.title .refs_container .mouse_catcher {
position: absolute;
width: 100%;
height: 100%;
top: 0;
right: 0;
}
.title .refs_container:hover .mouse_catcher {
width: 300px;
}
.title .refs_container .refs {
position: absolute;
top: 100%;
right: 0;
width: 350px;
background-color: black;
border: 3px solid #444;
border-top: none;
z-index: 1;
display: none;
}
.title .refs_container:hover .refs {
display: block;
}
.refs .ref {
padding: 10px;
border-bottom: 1px solid rgb(51, 51, 51);
display: flex;
flex-direction: row;
align-items: center;
text-decoration: none;
color: white;
}
.refs .ref.current {
background-color: #8B3D23;
color: black;
}
.refs .ref:hover {
background-color: #222;
}
.refs .ref.current:hover {
background-color: rgba(139, 61, 35, 0.7);
}
.refs .ref:last-child {
border: none;
}
.refs .ref .timecode {
display: inline-block;
min-width: 55px;
font-size: 12px;
padding-right: 10px;
text-align: right;
}
.refs .ref .timecode:hover .time {
text-decoration: underline;
}
.refs .ref .source {
font-size: 10px;
color: #888;
line-height: 8px;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment