2017-05-01 21:51:45 +02:00
# pragma once
# include "Utilities.h"
# include <iostream>
# include <fstream>
class ThePraArt : Utilities
{
public :
2017-05-02 08:00:52 +02:00
string description = " The place of ThePra's artistic expression " ;
2017-05-01 21:51:45 +02:00
string blog = " index.html " ,
about = " aboutme.html " ,
patreon = " https://www.patreon.com/thepra " ,
youtube = " https://www.youtube.com/channel/UCW-00DYkKRXLO6C_IIy8EEw " ,
youtubePosts = " youtubeposts.html " ,
twitch = " https://www.twitch.tv/thepra " ,
tumblr = " http://thepra.tumblr.com " ,
deviantArt = " http://thepra.deviantart.com " ,
instagram = " https://www.instagram.com/_thepra_ " ,
facebook = " https://www.facebook.com/ThePratribal " ,
twitter = " https://twitter.com/_ThePra_ " ;
string Home = " Blog " ,
AboutMe = " About Me " ,
Patreon = " Patreon " ,
YouTube = " YouTube " ,
Twitch = " Twitch " ,
Tumblr = " Tumblr " ,
DeviantArt = " DeviantArt " ,
Instagram = " Instagram " ,
Facebook = " Facebook " ,
Twitter = " Twitter " ,
Menu = " Menu " ;
string contentFolder = " \\ thepraart \\ content \\ " ;
2017-05-02 08:00:52 +02:00
string contentLinks [ 4 ] {
2017-05-01 21:51:45 +02:00
contentFolder + " index.txt " ,
contentFolder + " aboutme.txt " ,
2017-05-02 08:00:52 +02:00
contentFolder + " youtubeposts.txt " ,
contentFolder + " posttemplate.txt "
2017-05-01 21:51:45 +02:00
} ;
string outputPath { current_path ( ) . append ( " output_thepraart \\ " ) . string ( ) } ;
2017-05-02 08:00:52 +02:00
string outputLinks [ 4 ] {
2017-05-01 21:51:45 +02:00
outputPath + " index.html " ,
outputPath + " aboutme.html " ,
2017-05-02 08:00:52 +02:00
outputPath + " youtubeposts.html " ,
outputPath + " posttemplate.html "
2017-05-01 21:51:45 +02:00
} ;
2017-05-02 08:00:52 +02:00
2017-05-01 21:51:45 +02:00
static void BuildBody ( Document & file , string cPath , Levels level , Col color , PageType ptype = NORMAL ) ;
private :
static list < Node > NavigationBar ( Levels level , DeskOrMob mtype , Col color ) ;
static list < Node > SingleMainContent ( Levels level , string cPath , DeskOrMob mtype , list < string > content = { " " } ) ;
static Node Player ( Levels level , Col color ) ;
} ;
inline void ThePraArt : : BuildBody ( Document & file , string cPath , Levels level , Col color , PageType ptype )
{
list < Node > navBar = NavigationBar ( level , D , color ) ;
list < Node > navBarM = NavigationBar ( level , M , color ) ;
list < Node > main = SingleMainContent ( level , cPath , D ) ;
list < Node > mainM = SingleMainContent ( level , cPath , M ) ;
Node desktop = Node ( " section.desktop " ) ;
Node mobile = Node ( " section.mobile " ) ;
for each ( Node item in navBar )
{
desktop . AppendChild ( item ) ;
}
for each ( Node item in navBarM )
{
mobile . AppendChild ( item ) ;
}
for each ( Node item in main )
{
desktop . AppendChild ( item ) ;
}
for each ( Node item in mainM )
{
mobile . AppendChild ( item ) ;
}
file . AddNodeToBody ( desktop ) ;
file . AddNodeToBody ( mobile ) ;
}
inline list < Node > ThePraArt : : NavigationBar ( Levels level , DeskOrMob mtype , Col color )
{
ThePraArt a ;
string whichLevel = ChooseLevel ( level ) ;
string c = ( color = = White ) ? " " : " t " ;
switch ( mtype )
{
case D :
{
//leftfixed
Node elem00 = Node ( " div.leftfixed " ) ,
2017-05-02 08:00:52 +02:00
elem01 = Node ( " img " ) . SetAttribute ( a . src , " images/navdecups " + c + " .png " ) . SetAttribute ( a . alt , " Upper Left Decoration " ) . UseClosingTag ( false ) ,
2017-05-01 21:51:45 +02:00
elem02 = Node ( a . ul ) ,
elem03 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . blog ) . SetContent ( a . Home ) ) ,
2017-05-02 08:00:52 +02:00
elem04 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . patreon ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Patreon ) ) ,
2017-05-01 21:51:45 +02:00
elem05 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . youtubePosts ) . SetContent ( a . YouTube ) ) ,
elem06 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . about ) . SetContent ( a . AboutMe ) ) ,
elem07 = Node ( a . li ) . SetContent ( " ( ・ω・)ノ<!--Hello there!--> " ) ,
elem08 = Node ( a . li ) . SetContent ( " \\ (゜ロ゜)<!--Oh shit! Look up guys, someone who read the source file!! They uncovered us!!! WE ARE DOOMED!!!!--> " ) ,
elem09 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . twitch ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Twitch ) ) ,
2017-05-02 08:00:52 +02:00
elem10 = Node ( " img " ) . SetAttribute ( a . src , " images/navdecupg " + c + " .png " ) . SetAttribute ( a . alt , " Bottom Left Decoration " ) . UseClosingTag ( false ) ;
2017-05-01 21:51:45 +02:00
elem02 . AppendChild ( elem03 )
. AppendChild ( elem04 )
. AppendChild ( elem05 )
. AppendChild ( elem06 )
. AppendChild ( elem07 )
. AppendChild ( elem08 )
. AppendChild ( elem09 ) ;
elem00 . AppendChild ( elem01 )
. AppendChild ( elem02 )
. AppendChild ( elem10 ) ;
//player
2017-05-02 08:00:52 +02:00
Node player = Player ( level , color ) ;
2017-05-01 21:51:45 +02:00
//rightfixed
Node elem20 = Node ( " div.rightfixed " ) ,
2017-05-02 08:00:52 +02:00
elem21 = Node ( " img " ) . SetAttribute ( a . src , " images/navdecupds " + c + " .png " ) . SetAttribute ( a . alt , " Upper Right Decoration " ) . UseClosingTag ( false ) ,
2017-05-01 21:51:45 +02:00
elem22 = Node ( a . ul ) ,
elem23 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . tumblr ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Tumblr ) ) ,
elem24 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . deviantArt ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . DeviantArt ) ) ,
elem25 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . instagram ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Instagram ) ) ,
elem26 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . facebook ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Facebook ) ) ,
elem27 = Node ( a . li ) . SetContent ( " ヾ(・ω・o)<!--Hello!--> " ) ,
elem28 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . twitter ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Twitter ) ) ,
2017-05-02 08:00:52 +02:00
elem29 = Node ( " img " ) . SetAttribute ( a . src , " images/navdecupdg " + c + " .png " ) . SetAttribute ( a . alt , " Bottom Right Decoration " ) . UseClosingTag ( false ) ;
2017-05-01 21:51:45 +02:00
elem22 . AppendChild ( elem23 )
. AppendChild ( elem24 )
. AppendChild ( elem25 )
. AppendChild ( elem26 )
. AppendChild ( elem27 )
. AppendChild ( elem28 ) ;
elem20 . AppendChild ( elem21 )
. AppendChild ( elem22 )
. AppendChild ( elem29 ) ;
2017-05-02 08:00:52 +02:00
2017-05-01 21:51:45 +02:00
return { elem00 , player , elem20 } ;
}
break ;
case M :
{
2017-05-02 08:00:52 +02:00
Node elem00 = Node ( " img.immagini_laterali " ) . SetAttribute ( a . alt , " Top Left Decoration " ) . SetAttribute ( a . src , " images/mobile/navdecupds " + c + " .png " ) . UseClosingTag ( false ) ,
2017-05-01 21:51:45 +02:00
elem01 = Node ( " div.navigation_barm " ) ,
elem02 = Node ( " nav " ) ,
2017-05-02 08:00:52 +02:00
elem03 = Node ( " label.toggle " ) . SetAttribute ( " for " , " drop " ) . SetContent ( a . Menu ) ,
elem04 = Node ( " input#drop " ) . SetAttribute ( " type " , " checkbox " ) . UseClosingTag ( false ) ,
elem05 = Node ( a . ul + " .menu " ) ,
elem06 = Node ( a . li + " .topRounds " ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . blog ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Home ) ) ,
2017-05-01 21:51:45 +02:00
elem07 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . patreon ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Patreon ) ) ,
elem08 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . youtubePosts ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . YouTube ) ) ,
elem09 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . about ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . AboutMe ) ) ,
elem10 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . twitch ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Twitch ) ) ,
elem11 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . tumblr ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Tumblr ) ) ,
elem12 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . deviantArt ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . DeviantArt ) ) ,
elem13 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . instagram ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Instagram ) ) ,
elem14 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . facebook ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Facebook ) ) ,
elem15 = Node ( a . li ) . AppendChild ( Node ( a . a ) . SetAttribute ( a . href , a . twitter ) . SetAttribute ( " target " , " _blank " ) . SetContent ( a . Twitter ) ) ,
2017-05-02 08:00:52 +02:00
elem16 = Node ( a . li + " .fs60 " ) . SetContent ( " ( ・ω・)ノ <!--Hello there!--> <!--Hello!-->ヾ(・ω・o) " ) ,
elem17 = Node ( a . li + " .bottomRounds.fs60 " ) . SetContent ( " \ (゜ロ゜) <!--Oh shit!Look up guys, someone who read the source file!!They uncovered us!!!WE ARE DOOMED!!!!--> " ) ,
elem18 = Node ( " img.immagini_laterali " ) . SetAttribute ( a . alt , " Top Right Decoration " ) . SetAttribute ( a . src , " images/mobile/navdecups " + c + " .png " ) . UseClosingTag ( false ) ;
2017-05-01 21:51:45 +02:00
elem01 . AppendChild ( elem02
2017-05-02 08:00:52 +02:00
. AppendChild ( elem03 )
. AppendChild ( elem04 )
. AppendChild ( elem05
. AppendChild ( elem06 )
. AppendChild ( elem07 )
. AppendChild ( elem08 )
. AppendChild ( elem09 )
. AppendChild ( elem10 )
. AppendChild ( elem11 )
. AppendChild ( elem12 )
. AppendChild ( elem13 )
. AppendChild ( elem14 )
. AppendChild ( elem15 )
. AppendChild ( elem16 )
. AppendChild ( elem17 ) ) ) ;
2017-05-01 21:51:45 +02:00
return { elem00 , elem01 , elem18 } ;
}
break ;
default : return { { } } ;
break ;
}
}
inline list < Node > ThePraArt : : SingleMainContent ( Levels level , string cPath , DeskOrMob mtype , list < string > content )
{
ThePraArt a ;
string whichLevel = ChooseLevel ( level ) ;
Node mainC = Node ( " div.main " ) ;
Node mainMC = mainC ;
string STRING ;
string contentDesktop = " " ;
string contentMobile = " " ;
FullFillContent ( cPath , & contentDesktop , & contentMobile ) ;
mainC . SetContent ( contentDesktop ) ;
mainMC . SetContent ( contentMobile ) ;
/*for each (string item in contentTest)
{
mainC . SetContent ( item + " \n " ) ;
} */
if ( mtype = = D )
return { mainC } ;
else return { mainMC } ;
}
inline Node ThePraArt : : Player ( Levels level , Col color )
{
ThePraArt a ;
string pl = ( color = = White ) ? " " : " box-shadow: rgba(204,24,30,.5) 0 0 20px 0 " ;
string whichLevel = ChooseLevel ( level ) ;
2017-05-02 08:00:52 +02:00
Node player = Node ( " div.playerfixed " ) . SetAttribute ( " style " , pl )
2017-05-01 21:51:45 +02:00
. AppendChild ( Node ( " audio " )
. SetAttribute ( " controls " , " controls " )
. SetAttribute ( " preload " , " auto " )
2017-05-02 08:00:52 +02:00
. SetAttribute ( " class " , " player " )
2017-05-01 21:51:45 +02:00
. SetContent ( " Your browser does not support the audio element. " )
. AppendChild ( Node ( " source " )
. SetAttribute ( a . src , whichLevel + " videoplayback.ogg " )
. SetAttribute ( " type " , " audio/ogg " )
. UseClosingTag ( false ) ) ) ;
return player ;
}